residuals.seqModel(robustHD)
residuals.seqModel()所属R语言包:robustHD
Extract residuals from a sequence of regression models
从一个序列的回归模型中提取残差
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Extract residuals from a sequence of regression models such as submodels along a robust least angle regression sequence.
如子模型沿一个强大的至少角回归序列从一个序列的回归模型中提取残差。
用法----------Usage----------
## S3 method for class 'seqModel'
residuals(object, s, ...)
参数----------Arguments----------
参数:object
the model fit from which to extract residuals.
模型拟合从中提取残留物。
参数:s
an integer vector giving the steps of the submodels for which to extract the residuals (the default is to use the optimal submodel).
整数向量,子模型的步骤中提取的残留物(默认是使用的最佳子模型)。
参数:...
additional arguments are currently ignored.
目前被我们忽略额外的参数。
值----------Value----------
If only one submodel is requested, a numeric vector containing the corresponding residuals.
如果只有一个子模型被请求时,一个数值向量含有相应的残差。
If multiple submodels are requested, a numeric matrix in which each column contains the residuals of the corresponding submodel.
如果有多个子模型的要求,一个数字矩阵,其中每一列都包含相应的子模型的残差。
(作者)----------Author(s)----------
Andreas Alfons
参见----------See Also----------
residuals, rlars
residuals,rlars
实例----------Examples----------
## generate data[#生成数据]
# example is not high-dimensional to keep computation time low[例如不高维的计算时间保持低]
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[污染水平]
x <- replicate(p, rnorm(n)) # predictor matrix[预测矩阵]
e <- rnorm(n) # error terms[误差项]
i <- 1:ceiling(epsilon*n) # observations to be contaminated[受到污染的意见]
e[i] <- e[i] + 5 # vertical outliers[垂直离群]
y <- c(x %*% beta + sigma * e) # response[响应]
x[i,] <- x[i,] + 5 # bad leverage points[坏的平衡点]
## fit robust LARS model[配合强大的LARS模型]
fit <- rlars(x, y)
## extract residuals[#提取残差]
residuals(fit)
residuals(fit, s = 1:5)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|