找回密码
 注册
查看: 379|回复: 0

R语言 robustHD包 residuals.sparseLTS()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-27 22:24:49 | 显示全部楼层 |阅读模式
residuals.sparseLTS(robustHD)
residuals.sparseLTS()所属R语言包:robustHD

                                        Extract residuals from sparse LTS regression models
                                         提取稀疏LTS回归模型的残差

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Extract residuals from sparse least trimmed squares regression models.
提取稀疏至少修剪最小二乘回归模型的残差。


用法----------Usage----------


  ## S3 method for class 'sparseLTS'
residuals(object,
    fit = c("reweighted", "raw", "both"),
    standardized = FALSE, ...)

  ## S3 method for class 'sparseLTSGrid'
residuals(object, s,
    fit = c("reweighted", "raw", "both"),
    standardized = FALSE, ...)



参数----------Arguments----------

参数:object
the model fit from which to extract residuals.
模型拟合从中提取残留物。


参数:s
an integer vector giving the indices of the models for which to extract residuals.  If fit is "both", this can be a list with two components, with the first component giving the indices of the reweighted fits and the second the indices of the raw fits.  The default is to use the optimal model for each of the requested estimators.  Note that the optimal models may not correspond to the same value of the penalty parameter for the reweighted and the raw estimator.
整数向量,指数模型中提取残留物。 fit如果是"both",这可以是一个表两部分组成,第一部分给指数的重新加权拟合和第二个指标的原始适合。在默认情况下是使用最优化模型,为每个请求的估计。请注意,优化模型可能不符合相同的刑罚为重加权参数和原始估计值。


参数:fit
a character string specifying which residuals to extract. Possible values are "reweighted" (the default) for the residuals from the reweighted estimator, "raw" for the residuals from the raw estimator, or "both" for the residuals from both estimators.
一个字符串,指定所提取的残留物。可能的值是"reweighted"(默认值),再加权估计的残差,"raw"的残差的原始估计,或"both"都估计的残差。


参数:standardized
a logical indicating whether the residuals should be standardized (the default is FALSE).
一个逻辑残差是否应该规范(默认为FALSE)。


参数:...
currently ignored.
目前被忽略。


值----------Value----------

If (standardized) residuals for only one model are requested, they are returned in the form of a numeric vector.
如果(标准化)只有一个模型残差被请求时,它们在一个数值向量的形式返回。

Otherwise a numeric matrix is returned in which each column contains the (standardized) residuals of the corresponding model.
否则,返回的数字矩阵中的每一列都包含(标准)相应的模型的残差。


(作者)----------Author(s)----------



Andreas Alfons




参见----------See Also----------

residuals, sparseLTS, sparseLTSGrid
residuals,sparseLTS,sparseLTSGrid


实例----------Examples----------


## generate data[#生成数据]
# example is not high-dimensional to keep computation time low[例如不高维的计算时间保持低]
library("mvtnorm")
set.seed(1234)  # for reproducibility[可重复性]
n <- 100  # number of observations[的观测数]
p <- 25   # number of variables[的变量数目]
beta <- rep.int(c(1, 0), c(5, p-5))  # coefficients[系数]
sigma <- 0.5      # controls signal-to-noise ratio[控制的信号 - 噪声比]
epsilon <- 0.1    # contamination level[污染水平]
Sigma <- 0.5^t(sapply(1:p, function(i, j) abs(i-j), 1:p))
x &lt;- rmvnorm(n, sigma=Sigma)    # predictor matrix[预测矩阵]
e &lt;- rnorm(n)                   # error terms[误差项]
i &lt;- 1:ceiling(epsilon*n)       # observations to be contaminated[受到污染的意见]
e[i] &lt;- e[i] + 5                # vertical outliers[垂直离群]
y &lt;- c(x %*% beta + sigma * e)  # response[响应]
x[i,] &lt;- x[i,] + 5              # bad leverage points[坏的平衡点]

## sparse LTS[#稀疏LTS]
# fit model[拟合模型]
fit <- sparseLTS(x, y, lambda = 0.05, mode = "fraction")
# extract residuals[提取残差]
residuals(fit)
residuals(fit, fit = "both")

## sparse LTS over a grid of values for lambda[#稀疏LTS为lambda值一格的]
# fit model[拟合模型]
frac <- seq(0.25, 0.05, by = -0.05)
fitGrid <- sparseLTSGrid(x, y, lambda = frac, mode = "fraction")
# extract residuals[提取残差]
residuals(fitGrid)
residuals(fitGrid, fit = "both")
residuals(fitGrid, s = NULL)
residuals(fitGrid, fit = "both", s = NULL)

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2024-11-25 11:32 , Processed in 0.030240 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表