To analyze how the parameters and states (collectively referred to as parameters) of a Simulink® model influence the design requirement on the model signals, you first generate samples of the parameters. You then define the cost function by creating a design requirement on the model signals, and evaluate the cost function for each sample. Finally, you analyze the relationship between the parameter variations and the cost function values. You can perform this analysis in the following ways:
View a plot of the cost function evaluations against the parameter samples to identify trends. This method is informal and provides visual intuition about how the various parameters affect the cost function.
In the Sensitivity Analysis tool, after the evaluation is complete,
an evaluation result scatter plot is generated in the tool. The plot
displays the evaluated cost function value as a function of each parameter
in the parameter set. The last column subplot displays the probability
distribution of the evaluated cost function values. You can add a
best-fit line to the scatter subplots by right-clicking in the plot,
and selecting Overlay linear fit in the
context menu. In this plot, the best-fit line indicates that the
has a lot of influence on the requirement.
You can also plot a contour plot of the evaluated results. To learn more about these plots, see Interact with Plots in the Sensitivity Analysis Tool. For an example, see Identify Key Parameters for Estimation (GUI).
At the command line, you can use tools such as:
For an example, see Identify Key Parameters for Estimation (Code).
In addition to visually analyzing the effect of parameters on the cost function, you can also compute statistics to quantify the relation.
Obtain summary statistics about the relationship between cost function evaluations and parameters samples. Available analysis methods include:
Use to analyze how a model parameter and the cost function output are correlated.
|Partial Correlation (requires Statistics and Machine Learning Toolbox™ software)|
Use to analyze how a model parameter and the cost function are correlated, removing the effects of the remaining parameters.
Use when you expect that the model parameters linearly influence the cost function.
For each of these methods, you specify what data to use for the analysis by choosing from the following analysis types:
Linear analysis, also referred to as Pearson analysis — Uses raw data for analysis. Use linear analysis when you expect a linear relation between the parameters and cost function, and when the residuals about the best-fit line are expected to be normally distributed. Linear analysis is also recommended when the number of samples, and so the number of residual points is large.
Ranked analysis, also referred to as Spearman analysis and ranked transformation — Uses ranks of data for analysis. Use ranked analysis when you expect a nonlinear monotonic relation between the parameters and the cost function and when the residuals about the best-fit line are not normally distributed. Ranked analysis is also recommended when the number of samples, and so the number of residual points is small.
Linear analysis retains information about intervals between data values, whereas ranked analysis does not. Suppose that you had the following data set:
Here x1 and x2 are model parameters, and y is the cost function. Each row represents a sample and the associated cost function evaluation.
The data is ranked on a per column basis. For example, when you rank the data in column 1 (x1), which contains the entries 9, 5, and 2.3, the ranked data is equal to 3, 2, and 1. The ranked data set for the samples of x1, x2 and y are as follows:
The ranked data set can be used for correlation, partial correlation, or standardized regression analysis.
Kendall — Kendall’s tau rank correlation coefficient is calculated.
Applicable when the analysis method is Correlation. Requires Statistics and Machine Learning Toolbox software.
Calculates the correlation coefficients, R. Use this method to analyze how a model parameter and the cost function outputs are correlated.
R is calculated as follows:
x contains Ns samples
of Np model parameters.
y contains Ns rows,
each row corresponds to the cost function evaluation for a sample
R values are in the [-1 1] range. The (i,j) entry of R indicates the correlation between x(i) and y(j).
R(i,j) > 0 — Variables
have positive correlation. The variables increase together.
R(i,j) = 0 — Variables have
R(i,j) < 0 — Variables
have negative correlation. As one variable increases, the other decreases.
Calculates the partial correlation coefficients, R. This method requires Statistics and Machine Learning Toolbox software. Use this method to analyze how a model parameter and the cost function are correlated, adjusting to remove the effect of the other parameters.
R is calculated using
the Statistics and Machine
Learning Toolbox software.
Calculates the standardized regression coefficients, R. Use this method when you expect that the model parameters linearly influence the cost function.
R is calculated as follows:
Consider a single sample (x1,...,xNp) and the corresponding single output, y. bx is the regression coefficient vector calculated using least squares assuming a linear model . R standardizes each element of bx by multiplying it with the ratio of the standard deviation of the corresponding x sample (σx) to the standard deviation of y (σy).
In the Sensitivity Analysis tool, after you have evaluated the design requirements, specify the analysis methods and types in the Statistics tab of the tool.
Select the evaluation results you want to analyze in the Evaluation Results to Analyze list. After that, you specify the analysis methods and types, and click Compute Statistics. You can compute all applicable combinations of analysis methods and types.
The results of the analysis are returned in the
in the Results area of the tool. In this case,
StatsResult variable includes the linear (Pearson)
correlation coefficients and linear standardized regression coefficients
calculated between the cost function and each parameter. To see the
StatsResult, and select Open in
A tornado plot is generated that displays the results of the
analysis in order of influence of parameters on the cost function.
The parameter that most influences the cost function is displayed
on the top. As was seen in the results scatter plot, in this tornado
Gain parameter has the most influence
on the design requirement cost function.
To learn more about tornado plots, see Interact with Plots in the Sensitivity Analysis Tool. For an example, see Identify Key Parameters for Estimation (GUI).
At the command line, specify the analysis methods and types
sdo.analyze. This function
performs linear correlation analysis by default. To specify other
analysis methods, use
sdo.AnalyzeOptions. For an example, see Identify Key Parameters for Estimation (Code).