SensitivityModel Class#
- class rocketpy.sensitivity.SensitivityModel[source]#
Performs a ‘local variance based first-order sensitivity analysis’ considering independent input parameters.
The main reference for global variance based sensitivity analysis is [1]. Our method implements a local version that only considers first order terms, which correspond to linear terms. Albeit the flight function is nonlinear, the linear hypothesis might be adequate when performing local sensitivity analysis.
The model is fit using separate multiple linear regression for each target variable passed and using the parameters as covariates.
References
[1] Sobol, Ilya M. “Global sensitivity indices for nonlinear mathematical models and their Monte Carlo estimates.” Mathematics and computers in simulation 55.1-3 (2001): 271-280.
- __init__(parameters_names, target_variables_names)[source]#
Initializes sensitivity model
- Parameters:
parameter_names (
list[str]
) – A list containing the names of the parameters used in the analysis. Note that the order is important and must match the order passed in the parameter data matrix.target_variables_names (
list[str]
) – A list containing the names of the target variables used in the analysis. Note that the order is important and must match the order passed in the target variables data matrix.
- Return type:
None
- set_parameters_nominal(parameters_nominal_mean, parameters_nominal_sd)[source]#
Set parameters nominal mean and standard deviation
- Parameters:
parameters_nominal_mean (
np.array
) – An array containing the nominal mean for parameters in the order specified in parameters names at initializationparameters_nominal_sd (
np.array
) – An array containing the nominal standard deviation for parameters in the order specified in parameters names at initialization
- Return type:
None
- set_target_variables_nominal(target_variables_nominal_value)[source]#
Set target variables nominal value (mean)
- Parameters:
target_variables_nominal_value (
np.array
) – An array containing the nominal mean for target variables in the order specified in target variables names at initialization- Return type:
None
- _estimate_parameter_nominal(parameters_matrix)[source]#
Estimates parameters nominal values
- Parameters:
parameters_matrix (
np.matrix
) – Data matrix whose columns correspond to parameters values ordered as passed in initialization- Return type:
None
- _estimate_target_nominal(target_data)[source]#
Estimates target variables nominal values
- Parameters:
target_data (
np.array | np.matrix
) – Data matrix or array. In the case of a matrix, the columns correspond to target variable values ordered as passed in initialization- Return type:
None
- fit(parameters_matrix, target_data)[source]#
Fits sensitivity model
- Parameters:
parameters_matrix (
np.matrix
) – Data matrix whose columns correspond to parameters values ordered as passed in initializationtarget_data (
np.array | np.matrix
) – Data matrix or array. In the case of a matrix, the columns correspond to target variable values ordered as passed in initialization
- Return type:
None