prms(formula, data, a, fun = "Hampel", probp1 = 0.95, hampelp2 = 0.975,
hampelp3 = 0.999, center = "median", scale = "qn", usesvd = FALSE,
numit = 100, prec = 0.01)
"Hampel"
(preferred), "Huber"
or "Fair"
.fun="Hampel"
.fun="Hampel"
."mean"
or "median"
."sd"
or "qn"
or alternatively "no"
for no scaling.FALSE
. If TRUE
singular value decomposition is performed.Functions summary
, predict
and plot
are available. Also the generic functions coefficients
, fitted.values
and residuals
can be used to extract the corresponding elements from the prm object.
w=wy*wt
.scores=Xs%*%R
.a
is the number of components in the model. Note that it is not possible to simply reduce the number of weighting vectors to obtain a model with a smaller number of components. Each model has to be estimated separately due to its dependence on robust case weights.
Serneels, S., Croux, C., Filzmoser, P., Van Espen, P.J. (2005). Partial Robust M-Regression. Chemometrics and Intelligent Laboratory Systems, 79, 55-64.
prmsCV
, plot.prm
, biplot.prm
, predict.prm
, sprms
set.seed(5023)
U <- c(rep(2,20), rep(5,30))
X <- replicate(6, U+rnorm(50))
beta <- c(rep(1, 3), rep(-1,3))
e <- c(rnorm(45,0,1.5),rnorm(5,-20,1))
y <- X%*%beta + e
d <- as.data.frame(X)
d$y <- y
mod <- prms(y~., data=d, a=2, fun="Hampel")
summary(mod)
Run the code above in your browser using DataLab