lqs(MASS)
lqs()所属R语言包:MASS
Resistant Regression
耐回归
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Fit a regression to the good points in the dataset, thereby achieving a regression estimator with a high breakdown point. lmsreg and ltsreg are compatibility wrappers.
适合回归到DataSet中的好点,从而实现了具有高击穿点的回归估计。 lmsreg和ltsreg兼容性包装。
用法----------Usage----------
lqs(x, ...)
## S3 method for class 'formula'[类formula的方法]
lqs(formula, data, ...,
method = c("lts", "lqs", "lms", "S", "model.frame"),
subset, na.action, model = TRUE,
x.ret = FALSE, y.ret = FALSE, contrasts = NULL)
## Default S3 method:[默认方法]
lqs(x, y, intercept = TRUE, method = c("lts", "lqs", "lms", "S"),
quantile, control = lqs.control(...), k0 = 1.548, seed, ...)
lmsreg(...)
ltsreg(...)
参数----------Arguments----------
参数:formula
a formula of the form y ~ x1 + x2 + ....
形式y ~ x1 + x2 + ...公式。
参数:data
data frame from which variables specified in formula are preferentially to be taken.
数据框中指定的变量formula是优先要采取的。
参数:subset
an index vector specifying the cases to be used in fitting. (NOTE: If given, this argument must be named exactly.)
索引向量指定要在装修中使用的情况下。 (注:如果给定的,这个参数必须准确命名。)
参数:na.action
function to specify the action to be taken if NAs are found. The default action is for the procedure to fail. Alternatives include na.omit and na.exclude, which lead to omission of cases with missing values on any required variable. (NOTE: If given, this argument must be named exactly.)
函数指定了应采取的行动如果NAS被发现。默认操作是失败的过程。替代品包括na.omit和na.exclude,导致遗漏的情况下,缺少任何所需的变量值。 (注:如果给定的,这个参数必须准确命名。)
参数:model, x.ret, y.ret
logical. If TRUE the model frame, the model matrix and the response are returned, respectively.
逻辑。如果TRUE模型框架,模型矩阵和响应返回,分别。
参数:contrasts
an optional list. See the contrasts.arg of model.matrix.default.
可选列表。参见contrasts.argmodel.matrix.default。
参数:x
a matrix or data frame containing the explanatory variables.
矩阵或数据框包含的解释变量。
参数:y
the response: a vector of length the number of rows of x.
回应:一个长度为向量x行数。
参数:intercept
should the model include an intercept?
模型应该包括拦截?
参数:method
the method to be used. model.frame returns the model frame: for the others see the Details section. Using lmsreg or ltsreg forces "lms" and "lts" respectively.
要使用的方法。 model.frame返回的模型框架:为他人看到Details部分。使用lmsreg或ltsreg力量"lms"和"lts"分别。
参数:quantile
the quantile to be used: see Details. This is over-ridden if method = "lms".
要使用的位数:Details。这是如果method = "lms"缠身。
参数:control
additional control items: see Details.
额外的控制项目:见Details。
参数:k0
the cutoff / tuning constant used for chi() and psi() functions when method = "S", currently corresponding to Tukey's "biweight".
截止/chi()和psi()功能调整不断使用时method = "S",目前相应的Tukey的biweight“。
参数:seed
the seed to be used for random sampling: see .Random.seed. The current value of .Random.seed will be preserved if it is set..
采用随机抽样的种子:.Random.seed。电流值的.Random.seed将被保留,如果它被设置......
参数:...
arguments to be passed to lqs.default or lqs.control, see control above and Details.
参数被传递到lqs.default或lqs.control,看到control以上Details的。
Details
详情----------Details----------
Suppose there are n data points and p regressors, including any intercept.
假设有n数据点和p回归,包括任何拦截。
The first three methods minimize some function of the sorted squared residuals. For methods "lqs" and "lms" is the quantile squared residual, and for "lts" it is the sum of the quantile smallest squared residuals. "lqs" and "lms" differ in the defaults for quantile, which are floor((n+p+1)/2) and floor((n+1)/2) respectively. For "lts" the default is floor(n/2) + floor((p+1)/2).
前三种方法,尽量减少一些排序的残差平方的函数。对于方法"lqs"和"lms"是quantile平方剩余,"lts"它是最小quantile残差平方的总和。 "lqs"和"lms"不同的默认quantile,这是floor((n+p+1)/2)和floor((n+1)/2)分别。 "lts"默认floor(n/2) + floor((p+1)/2)。
The "S" estimation method solves for the scale s such that the average of a function chi of the residuals divided by s is equal to a given constant.
"S"估计方法,解决了规模s等,平均一个s除以残差的功能智是等于一个给定的常数。
The control argument is a list with components
control参数是一个组件列表
psamp: the size of each sample. Defaults to p.
psamp:每个样本的大小。 p默认。
nsamp: the number of samples or "best" (the default) or "exact" or "sample". If "sample" the number chosen is min(5*p, 3000), taken from Rousseeuw and Hubert (1997). If "best" exhaustive enumeration is done up to 5000 samples; if "exact" exhaustive enumeration will be attempted however
nsamp:样本数量或"best"(默认)或"exact"或"sample"。如果"sample"选择min(5*p, 3000),从Rousseeuw和Hubert(1997)。如果"best"做了详尽的列举5000个;如果"exact"详尽列举将试图然而
adjust: should the intercept be optimized for each
adjust:应该拦截优化每个
值----------Value----------
An object of class "lqs". This is a list with components
对象类"lqs"。这是一个组件列表
参数:crit
the value of the criterion for the best solution found, in the case of method == "S" before IWLS refinement.
找到最佳的解决方案的价值标准,在method == "S"前IWLS完善的情况下。
参数:sing
character. A message about the number of samples which resulted in singular fits.
字符。关于导致奇异一刀切的样本数量的消息。
参数:coefficients
of the fitted linear model
拟合线性模型
参数:bestone
the indices of those points fitted by the best sample found (prior to adjustment of the intercept, if requested).
发现那些装上最好的样本点指数(截距的调整之前,如果要求的话)。
参数:fitted.values
the fitted values.
拟合值。
参数:residuals
the residuals.
残差。
参数:scale
estimate(s) of the scale of the error. The first is based on the fit criterion. The second (not present for method == "S") is based on the variance of those residuals whose absolute value is less than 2.5 times the initial estimate.
(S)估计错误规模。首先是基于合适的标准。第二个(不method == "S")是基于残差的绝对值小于2.5倍,初步估计的方差。
注意----------Note----------
There seems no reason other than historical to use the lms and lqs options. LMS estimation is of low efficiency (converging at rate n^{-1/3}) whereas LTS has the same asymptotic efficiency as an M estimator with trimming at the quartiles (Marazzi, 1993, p.201). LQS and LTS have the same maximal breakdown value of (floor((n-p)/2) + 1)/n attained if floor((n+p)/2) <= quantile <= floor((n+p+1)/2). The only drawback mentioned of LTS is greater computation, as a sort was thought to be required (Marazzi, 1993, p.201) but this is not true as a partial sort can be used (and is used in this implementation).
似乎没有理由比历史使用lms和lqs选项。低效率的LMS估计(率趋同n^{-1/3})三烯而具有相同的修剪在四分(Marazzi,1993,p.201)作为M估计的渐近效率。 LQS及其(floor((n-p)/2) + 1)/n如果floor((n+p)/2) <= quantile <= floor((n+p+1)/2)达到相同的最大细分值。三烯提到的唯一的缺点是更大的计算,排序被认为须(Marazzi,1993,p.201),但作为一个部分排序可以用来(实施),这是不正确的。
Adjusting the intercept for each trial fit does need the residuals to be sorted, and may be significant extra computation if n is large and p small.
调整每个审判合适的拦截确实需要残差进行排序,可能是显着的额外的计算,如果n大p小。
Opinions differ over the choice of psamp. Rousseeuw and Hubert (1997) only consider p; Marazzi (1993) recommends p+1 and suggests that more samples are better than adjustment for a given computational limit.
意见不同在psamp选择。 rousseeuw和Hubert(1997)只考虑P; Marazzi(1993)建议P +1和建议,更多的样本比调整对于一个给定的计算限制。
The computations are exact for a model with just an intercept and adjustment, and for LQS for a model with an intercept plus one regressor and exhaustive search with adjustment. For all other cases the minimization is only known to be approximate.
计算精确的模型只是一个拦截和调整,并与截距模型加上一个回归量与调整穷举搜索LQS。对于所有其他情况下的最小化是唯一已知的近似。
参考文献----------References----------
Robust Regression and Outlier Detection. Wiley.
Algorithms, Routines and S Functions for Robust Statistics. Wadsworth and Brooks/Cole.
L1-Statistical Procedures and Related Topics, ed Y. Dodge, IMS Lecture Notes volume 31, pp. 201–214.
参见----------See Also----------
predict.lqs
predict.lqs
举例----------Examples----------
set.seed(123) # make reproducible[使重现]
lqs(stack.loss ~ ., data = stackloss)
lqs(stack.loss ~ ., data = stackloss, method = "S", nsamp = "exact")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|