odis | R Documentation |
odis
calculates orthogonal distances (OD = "X
-residuals") from a PCA or PLS model, i.e. the Euclidean distances between the row observations of a data set and their projections on the score space (see e.g. Hubert et al. 2005, Van Branden & Hubert 2005, p. 66; Varmuza & Filzmoser, 2009, p. 79).
lodis
does the same calculation for each local model (i.e. for each new observation to predict) generated by functions locw
, lwplsr
, etc.
odis(fm, Xr, Xu = NULL,
ncomp = NULL,
robust = FALSE, alpha = .01)
lodis(fm, Xr, Xu,
ncomp = NULL,
robust = FALSE, alpha = .01)
fm |
For |
Xr |
The matrix or data frame of reference (= training) observations that was used for building the preliminary model |
Xu |
A |
ncomp |
Number of components to consider for the distance calculations. If |
robust |
Logical. If |
alpha |
Risk I level for defining the cutoff detecting extreme values (see the code). |
The cutoff for detecting extreme OD values is computed using a moment estimation of a Chi-squared distrbution for the squared distance (see Nomikos & MacGregor 1995, and Pomerantzev 2008).
Column dstand
in the output is a "standardized" OD defined as OD / cutoff
where the cutoff
is calculated such as in Hubert et al. (2005 p.66) (). A value dstand > 1
may be considered as extreme.
A list of outputs (see examples).
M. Hubert, P. J. Rousseeuw, K. Vanden Branden (2005). ROBPCA: a new approach to robust principal components analysis. Technometrics, 47, 64-79.
Nomikos, P., MacGregor, J.F., 1995. Multivariate SPC Charts for Monitoring Batch Processes. null 37, 41â59. https://doi.org/10.1080/00401706.1995.10485888
Pomerantsev, A.L., 2008. Acceptance areas for multivariate classification derived by projection methods. Journal of Chemometrics 22, 601â609. https://doi.org/10.1002/cem.1147
K. Vanden Branden, M. Hubert (2005). Robuts classification in high dimension based on the SIMCA method. Chem. Lab. Int. Syst, 79, 10-21.
K. Varmuza, P. Filzmoser (2009). Introduction to multivariate statistical analysis in chemometrics. CRC Press, Boca Raton.
n <- 8
p <- 6
set.seed(1)
X <- matrix(rnorm(n * p, mean = 10), ncol = p, byrow = TRUE)
y1 <- 100 * rnorm(n)
y2 <- 100 * rnorm(n)
Y <- cbind(y1, y2)
set.seed(NULL)
Xr <- X[1:6, ] ; Yr <- Y[1:6, ]
Xu <- X[7:8, ] ; Yu <- Y[7:8, ]
fm <- pls(Xr, Yr, ncomp = 3)
#fm <- plsr(Xr, Yr, Xu, ncomp = 3)
odis(fm, Xr)
odis(fm, Xr, Xu)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.