Skip to main content

High Level Sensitivity and Uncertainty (SandU) Analysis Tools.

Project description

sandu License: MIT


High Level Sensitivity and Uncertainty (SandU) analysis tools for python.

Sandu aims to provide high level functionality for sensitivity and uncertainty analysis.


Sandu was developed to provide Sensitivity and Uncertainty analysis functionality for the rampvis-api.

Installation


The package is named sandu and listed on PyPI. You can use the pip to install:

Unix/MacOS

python3 -m pip install sandu

Windows

py -m pip install sandu

Description


The motivation is to provide easy to use, end to end, sensitivity analysis and uncertainty quantification functionality. Thereby lowering the barrier of entry for this type of analysis in python. Sandu was developed to analyse agent based models but may be applied more generally to any model or experimental data.

Illustration of the package's raison d'être.
If you want to implement Sobol sensitivity analysis, using sandu, no direct integration with a model is needed, just a table containing a selection of the models parameter values and associated outputs. A Gaussian process emulator is trained on the input-output data, which then acts as a surrogate model. By sampling from the gaussian process emulator the Sobol sensitivity indices can be effectively estimated with fewer expensive model runs required. This process usually would involve different libraries and a substantial amount of code but using sandu to perform this analysis one simply provides a df` is the pandas dataframe with parameter-output data from the model the names of the relevant columns in the data frame, and N which determines the number of samples drawn from the surrogate model and runs:

import pandas as pd
from sandu.sensitivity_analysis import sobol

Si_df = sobol.get_indices(df, parameters, bounds, quantity_mean, quantity_varaince, N)

Where Si_df is a pandas dataframe with the first and total sensitivity indicies. This is shown in detail, using example data, in /examples/example_sobol.py.

Contents


  1. Sensitivity Analysis Algorithms
    1. Sobol Sensitivity Analysis
  2. Gaussian Process Emulator

Examples


(1.i) Computing Sobol indices

Running /examples/example_sobol.py analyses the parameter sensitivities from parameters_output.csv and produces a plot which should appear as below.

alt text

(2) Training and evaluating a Gaussian Process Emulator.

Running /example/example_gaussian_process_emulator.py trains a model on parameters_output.csv and plot the models test set performance. It should produce a plot as below.

alt text

Credits


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sandu-0.0.3.tar.gz (9.6 kB view hashes)

Uploaded Source

Built Distribution

sandu-0.0.3-py3-none-any.whl (8.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page