Models

Model base class

class gsa_framework.models.model_base.ModelBase

Common interface for models to be used in sensitivity analysis problems.

This is an abstract class, you must inherit from it instead of using it directly. Subclasses are required to define the three abstract sensitivity_analysis given below.

abstract __call__(input_parameter_values)

Execute the model with the input values in input_parameter_values.

input_parameter_values has parameters as rows, and Monte Carlo sampling iterations as columns.

Must return a 1-d vector with same length as the number of rows in input_parameter_values.

abstract __len__()

Must return number of model parameters

abstract rescale(unit_interval_matrix)

Must rescale an 2-d array from [0-1] space to parameter space.

unit_interval_matrix has parameters as rows, and Monte Carlo sampling iterations as columns.

Test functions

class gsa_framework.models.test_functions.Morris(num_params=100, num_influential=5)

Class that implements the Morris function.

Parameters
  • num_params (int) – Number of model inputs.

  • num_influential (int) – Number of influential inputs.

Returns

y – Model outputs.

Return type

np.array of size [iterations, 1]

References

Paper:

Morris, Moore, and McKay [MMM06]

Useful link:

http://www.sfu.ca/~ssurjano/morretal06.html (there is a typo in the formula, trust the paper)

get_boolean_indices()

Returns boolean array with True values for known influential inputs, and False - for non-influential.

get_first_order(Var_Y_)

Computes analytical first order Sobol index.

get_sensitivity_indices()

Computes analytical first and total order Sobol indices.

get_total_order(Var_Y_)

Computes analytical total order Sobol index.

get_variance_Y()

Computes analytical variance of the model output.

class gsa_framework.models.test_functions.Morris4(num_params=100, num_influential=10)

Class that implements the modified Morris function that can have 4 levels of input importances.

Parameters
  • num_params (int) – Number of model inputs.

  • num_influential (int) – Number of influential inputs.

Returns

y – Model outputs.

Return type

np.array of size [iterations, 1]

References

Papers:

Kim, Mutel, and Froemelt [KMF21]

Useful link:

http://www.sfu.ca/~ssurjano/morretal06.html (there is a typo in the formula, trust the paper)

get_boolean_indices()

Returns boolean array with True values for known influential inputs, and False - for lowly- and non-influential.

get_sensitivity_indices()

Computes analytical first and total order Sobol indices.

class gsa_framework.models.test_functions.Borehole

Class that implements the Borehole function.

Returns

y – Model outputs.

Return type

np.array of size [iterations, 1]

References

Original paper:

Harper and Gupta [HG83] -> here the function is slightly different than in the below paper

Other paper:

Moon, Dean, and Santner [MDS12]

Useful link:

http://www.sfu.ca/~ssurjano/borehole.html

class gsa_framework.models.test_functions.Wingweight

Class that implements the Wing weight function.

Returns

y – Model outputs.

Return type

np.array of size [iterations, 1]

References

Original paper:

Forrester, Sobester, and Keane [FSK08]

Useful link:

http://www.sfu.ca/~ssurjano/wingweight.html

class gsa_framework.models.test_functions.OTLcircuit

Class that implements the OTL circuit function.

Returns

y – Model outputs.s

Return type

np.array of size [iterations, 1]

References

Original paper:

Ben-Ari and Steinberg [BAS07]

Useful link:

http://www.sfu.ca/~ssurjano/otlcircuit.html

class gsa_framework.models.test_functions.Piston

Class that implements the Piston simulation function.

Returns

y – Model outputs.

Return type

np.array of size [iterations, 1]

References

Original paper:

Ben-Ari and Steinberg [BAS07]

Useful link:

http://www.sfu.ca/~ssurjano/piston.html

class gsa_framework.models.test_functions.Moon(num_dummy=29)

Class that implements the Moon function.

Returns

y – Model outputs.

Return type

np.array of size [iterations, 1]

References

Original paper:

Moon, Dean, and Santner [MDS12]

Useful link:

http://www.sfu.ca/~ssurjano/moonetal12.html

class gsa_framework.models.test_functions.SobolLevitan(num_params=None, num_influential=None, case='hard')

Class that implements the Sobol-Levitan function.

Parameters
  • num_params (int) – Number of model inputs

  • num_influential (int) – Number of influential inputs

  • case (str) – Can take values easy and hard, where easy corresponds to b[:num_influential]=1 and the rest to 0, so that influential inputs are clearly active. Whereas hard corresponds to setting b[:20] to an array of gradually decreasing values, and the rest to 0.

Returns

y – Model outputs.

Return type

np.array of size [iterations, 1]

References

Original paper:

Sobol and Levitan [SL99]

Other paper:

Moon, Dean, and Santner [MDS12]

Useful link:

http://www.sfu.ca/~ssurjano/soblev99.html

class gsa_framework.models.test_functions.SobolGstar(num_params=50, num_influential=None, a=None, alpha=None, delta=None)

Class that implements the Sobol G_star function.

Setting alpha=1 and delta=0, reverts Sobol G_star into Sobol G function

Parameters
  • num_params (int) – Number of model inputs

  • num_influential (int) – Number of influential inputs

  • a (np.array of size num_params) – Coefficients for each model input, which determine input importance. Lower a indicates higher importance.

  • alpha (np.array of size num_params) – Default value is 1 for all parameters.

  • delta (np.array of size num_params) – Default value is 0 for all parameters.

Returns

y – Model outputs.

Return type

np.array of size iterations

References

Paper:

Saltelli, Annoni, Azzini, Campolongo, Ratto, and Tarantola [SAA+10]

Useful link:

http://www.sfu.ca/~ssurjano/gfunc.html https://www.gdr-mascotnum.fr/media/impec07_crestaux.pdf - default a values

get_boolean_indices()

Returns boolean array with True values for known influential inputs, and False - for non-influential.

get_sensitivity_indices()

Computes analytical first and total order Sobol indices.

class gsa_framework.models.test_functions.SobolG(num_params=50, num_influential=5, a=None)

Class that implements the Sobol G function.

Parameters
  • num_params (int) – Number of model inputs

  • num_influential (int) – Number of influential inputs

  • a (np.array of size [num_params, 1]) – Coefficients for each model input, which determine input importance. Lower a indicates higher importance.

Returns

y – Model outputs.

Return type

np.array of size [iterations, 1]

References

Paper:

Saltelli, Annoni, Azzini, Campolongo, Ratto, and Tarantola [SAA+10]

Useful link:

http://www.sfu.ca/~ssurjano/gfunc.html https://www.gdr-mascotnum.fr/media/impec07_crestaux.pdf - default a values

get_sensitivity_indices()

Computes analytical first and total order Sobol indices.