Skip to content

Commit

Permalink
clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
jdherman committed Jan 30, 2015
1 parent 59a7985 commit 64f5876
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###Contributing

Thanks to all those who contributed so far, including: [Will Usher](https://github.com/willu47), [Chris Mutel](https://github.com/cmutel), [Matt Woodruff](https://github.com/matthewjwoodruff), [Fernando Rios](https://github.com/zoidy), and [Dan Hyams](https://github.com/dhyams), [xantares](https://github.com/xantares). The library would be far less usable without these efforts.
Thanks to all those who contributed so far, including: [Will Usher](https://github.com/willu47), [Chris Mutel](https://github.com/cmutel), [Matt Woodruff](https://github.com/matthewjwoodruff), [Fernando Rios](https://github.com/zoidy), and [Dan Hyams](https://github.com/dhyams), [xantares](https://github.com/xantares). The library would be in much worse shape without these efforts.

In my view, development should follow a few objectives:

Expand Down
8 changes: 4 additions & 4 deletions README-advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ Parameter files can also be comma-delimited if your parameter names or group nam

#### Command-line interface

First, generate samples ... (the `-p` flag is the parameter file)
**Generate samples** (the `-p` flag is the parameter file)
```
python -m SALib.sample.saltelli \
-n 1000 \
-p ./SALib/test_functions/params/Ishigami.txt \
-o model_input.txt \
```

Then, run the model ... this will usually be a user-defined model, maybe even in another language. Just save the outputs.
**Run the model** this will usually be a user-defined model, maybe even in another language. Just save the outputs.

Finally, perform the analysis ...
**Run the analysis**
```
python -m SALib.analyze.sobol \
-p ./SALib/test_functions/params/Ishigami.txt \
Expand All @@ -34,4 +34,4 @@ python -m SALib.analyze.sobol \

This will print indices and confidence intervals to the command line. You can redirect to a file using the `>` operator.

Other methods include `SALib.sample.morris` and `SALib.sample.fast_sampler`. For an explanation of all command line options for each method, [see the examples here](https://github.com/jdherman/SALib/tree/master/examples).
Other methods include Morris, FAST, Delta-MIM, and DGSM. For an explanation of all command line options for each method, [see the examples here](https://github.com/jdherman/SALib/tree/master/examples).
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Python implementations of commonly used sensitivity analysis methods. Useful in
```python
from SALib.sample import saltelli
from SALib.analyze import sobol
from SALib.test_functions import Ishigami
import numpy as np

problem = {
Expand All @@ -36,25 +37,29 @@ param_values = saltelli.sample(problem, 1000, calc_second_order=True)

# Run model (example)
Y = Ishigami.evaluate(param_values)
# for offline models, save param_values to a file:
# np.savetxt('model_input.txt', param_values, delimiter=' ')
# then load the model outputs with np.loadtxt()

# Perform analysis
Si = sobol.analyze(problem, Y, print_to_console=False)
# Returns a dictionary with keys 'S1', 'S1_conf', 'ST', and 'ST_conf'
# (first and total-order indices with bootstrap confidence intervals)
```

It's also possible to specify the parameter bounds in a file. Parameter files should be created with 3 columns:
It's also possible to specify the parameter bounds in a file with 3 columns:
```
# name lower_bound upper_bound
P1 0.0 1.0
P2 0.0 5.0
...etc.
```

Lots of other options are included for parameter files, as well as a command-line interface--see the [Advanced Readme](README-advanced.md).
Then the `problem` dictionary above can be created from the `read_param_file` function:
```python
from SALib.util import read_param_file
problem = read_param_file('/path/to/file.txt')
# ... same as above
```

Lots of other options are included for parameter files, as well as a command-line interface. See the [advanced readme](README-advanced.md).

Also check out the [examples](https://github.com/jdherman/SALib/tree/master/examples) for a full description of options for each method.

Expand Down

0 comments on commit 64f5876

Please sign in to comment.