Giter Club home page Giter Club logo

r-sensitivity-wrapper's Introduction

Command-line wrapper for the R Sensitivity Package

(To be used with Sobol, Method of Morris, and FAST Methods)

Requires the R sensitivity package created by Pujol et al. You can get the package here. For more detailed installation instructions, see this post.

CLI wrapper developed for the following papers:

Herman, J.D., J.B. Kollat, P.M. Reed, and T. Wagener. 2013. From maps to movies: high resolution time-varying sensitivity analysis for spatially distributed watershed models. Hydrology and Earth System Sciences Discussions, 10, 10775โ€“10808. Herman, J.D., J.B. Kollat, P.M. Reed, and T. Wagener. 2013. Technical note: Method of Morris effectively reduces the computational demands of global sensitivity analysis for distributed watershed models. Hydrology and Earth System Sciences, 17, 2893โ€“2903.

Parameter files should be created with 3 columns, name, lower bound, and upper bound, e.g.:

P1 0.0 1.0
P2 0.0 5.0
...etc.

Contents:

  • sampler.R: generate parameter samples. Example usage:
   Rscript --vanilla --slave sampler.R <method> <N> <parameterFile> > <sampleFile>
  • analyzer.R: perform sensitivity analysis on model results. Example:
   Rscript --vanilla --slave analyzer.R <method> <N> <parameterFile> <modelOutputFile> <columnNumber> > <resultsFile>
  • Sobol-G Function and other test functions. These are included just for examples of performing decoupled sensitivity analysis. (Sampling -> Evaluations -> Analysis).

Some notes:

  • For each of the above files, <method> can be sobol, morris, or fast. Each of these gives a different output format during the analysis step.
  • <N> is the number of original samples, which is not the same as the number of parameter sets in sampleFile (these are multiplied approximately by a factor of P, where there are P parameters)
  • By default, samples and results will be printed to stdout. In the examples above they are piped into files.
  • <columnNumber> starts at 1, not 0. If you do not provide a column number, the default is 1

The full process would look something like this:

module load R

# Perform sampling
Rscript --vanilla --slave sampler.R ${METHOD} ${N} ${PARAM_FILE} > ${NAME}.samples

# Run the model executable with these samples (assuming the model receives parameters over stdin and prints output to stdout, your mileage may vary).
./myModel < ${NAME}.samples > ${NAME}.modelout

# Perform the sensitivity analysis using this model output (column 1)
Rscript --vanilla --slave analyzer.R ${METHOD} ${N} ${PARAM_FILE} ${NAME}.modelout 1 > ${NAME}.results

r-sensitivity-wrapper's People

Contributors

jdherman avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.