What formula does PLS Toolbox use to calculate the Q-residual confidence limit?
조회 수: 19 (최근 30일)
이전 댓글 표시
I understand that the confidence limit for Q-residuals can be obtained by using the "residuallimit" function, but even with looking at the code, I cannot decipher how the actual limit is calculated. Any help would be greatly appreciated.
댓글 수: 2
Swatantra Mahato
2021년 7월 5일
편집: Swatantra Mahato
2021년 7월 5일
Hi Adam,
"PLS Toolbox" is a Third-Party toolbox, so I would recommend reaching out to the original authors for help in understanding any functions.
You can reach out to them from https://eigenvector.com/
Hope this helps
Zifeng Li
2021년 11월 22일
You can open the help in Matlab, type in the funciton name, and the below eigenvector help page shows up. There are various options for calculating Q residual limit. You can further look up eqn. used for each method.
Here are some of my notes: jm gives higher value
Of limit. It is based on a F-distribution. This is better when
Sample size is small, say, 300. This is more robust
Some software, e.g., unsrambler uses chi2 algorithm. is based on a
chisquare-distribution. This is better when sample
Size is larger. It is sensitive to outliers.
Hope this helps!
Purpose
Esitmates confidence limits for the sum of squared residuals.
Synopsis[rescl,s] = residuallimit(residuals,cl,options)[rescl,s] = residuallimit(model,cl,options)rescl = residuallimit(s,cl,options)cl = residuallimit(model,q,options)
Description
This function is used to calculate confidence limits for the sum of squared residuals of a model, rescl, given a user-requested confidence level cl. There are three methods of calling RESIDUALLIMIT:
(a) Input the model residuals matrix residuals,(b) When using the Jackson-Mudholkar method (see options, below) the eigenvalues of the model residuals, s, can be input instead of the model residuals themselves. This is typically a faster option.(c) A standard model structure, model, can be input instead of the residuals. In this case, RESIDUALLIMIT will locate valid residual information within the model structure, and use that to calculate the limit.
A fourth method using input model and confidence interval value, q, returns a confidence level value.
See Jackson (1991) for details regarding this calculation.Inputs
- residuals = matrix of model residuals
- cl = fractional confidence limit, where 0<cl<1 {default = 0.95}
- Note: To calculate multiple confidence limits, cl can be a vector of fractional confidence limits.
- model = standard model structure, containing relevant residuals information
- s = eigenvalues of the model residuals
For example, for a PCA model:X = TPT + E,
the input residuals is the matrix E , which can be calculated using the datahat function. Alternatively, these residuals can be obtained from a standard model structure model.
Optional Inputs
- options = options structure, discussed below.
Outputs
- rescl = the estimated residual limit
- s = contains the eigenvalues of E; applies only when using the Jackson-Mudholkar algorithm
- To improve speed, s can be used in place of residuals in subsequent calls to RESIDUALLIMIT for the same data.
Options
options = a structure array with the following fields:
- algorithm: [ {'jm'} | 'chi2' | 'auto' ], governs choice of algorithm:
- 'jm', uses Jackson-Mudholkar method (slower, more robust),
- 'invjm', uses Jackson-Mudholkar method (slower, more robust) to calculate a confidence limit from a given sum of squares residual. Output is a confidence limit.
- 'chi2', uses chi-squared moment method (faster, less robust with outliers),
- 'invchi2', uses chi^2 moment method to calculate a confidence limit from a given sum square residual. Output is a confidence limit, and
- 'auto' automatically selects based on data size (<300 rows or columns, use 'jm', otherwise, use 'chi2')
The default options can be retrieved using:options = residuallimit('options');.Examples
The following example will calculate the 95 percent confidence limit for the sum of squared residuals of a model, model, using the residual eigenvalues stored in the model structure model:
rescl = residuallimit(model,0.95);
The following example will also calculate the 95 percent confidence limit for the sum of squared residuals of a model, but by using the actual residuals calculated from the calibration data, data, using the datahat function:
[xhat,residuals] = datahat(model,data);rescl = residuallimit(residuals,0.95);
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!