coefPlot(robustHD)
coefPlot()所属R语言包:robustHD
Coefficient plot of a sequence of regression models
在序列的回归模型的系数图
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Produce a plot of the coefficients from a sequence of regression models, such as submodels along a robust least angle regression sequence, or sparse least trimmed squares regression models for a grid of values for the penalty parameter.
产生一个图从一个序列的回归模型的系数,如子模型,以及一个强大的最小角度回归序列,或至少修剪稀疏最小二乘回归模型的电网罚参数的值。
用法----------Usage----------
coefPlot(x, ...)
## S3 method for class 'seqModel'
coefPlot(x,
abscissa = c("step", "df"), zeros = FALSE, grid = TRUE,
labels, pos = 4, offset = 0.5, ...)
## S3 method for class 'sparseLTSGrid'
coefPlot(x,
fit = c("reweighted", "raw", "both"),
abscissa = c("step", "df"), zeros = FALSE, grid = TRUE,
labels, pos = 4, offset = 0.5, ...)
参数----------Arguments----------
参数:x
the model fit to be plotted.
要绘制的模型拟合。
参数:fit
a character string specifying for which estimator to produce the plot. Possible values are "reweighted" (the default) for the reweighted fits, "raw" for the raw fits, or "both" for both estimators.
一个字符串,指定估计的图。可能的值是"reweighted"(默认值)的重加权拟合,"raw"为原料的配合,或"both"两个估计。
参数:abscissa
a character string specifying what to plot on the x-axis. Possible values are "step" for the step number (the default), or "df" for the degrees of freedom.
一个字符串,指定绘制x-轴。可能的值是"step"的步数(默认值),或"df"的自由度。
参数:zeros
a logical indicating whether predictors that never enter the model and thus have zero coefficients should be included in the plot (TRUE) or omitted (FALSE, the default). This is useful if the number of predictors is much larger than the number of observations, in which case many coefficients are never nonzero.
逻辑的预测,从来没有进入模型,从而有非零系数是否应包括在图中(TRUE)或省略(FALSE,默认值)。这是非常有用的,如果的预测变量数比的观测值,在这种情况下,许多的系数是从未非零的数目大得多。
参数:grid
a logical indicating whether vertical grid lines should be drawn at each step.
一个逻辑指示是否应在每个步骤中绘制垂直网格线。
参数:labels
an optional character vector containing labels for the predictors.
一个的可选字符向量的预测标签。
参数:pos
an integer position specifier for the labels. Possible values are 1, 2, 3 and 4, respectively indicating positions below, to the left of, above and to the right of the corresponding coefficient values from the last step.
整数位置说明的标签。可能的值是1,2,3和4,分别表示的位置下面,上方的左侧和右侧的相应的系数的值从最后一步。
参数:offset
a numeric value giving the offset of the labels from the corresponding coefficient values from the last step (in fractions of a character width).
一个数字值,该值的标签对应的系数的值从最后一步(一个字符宽度的馏分),给出了偏移。
参数:...
for the generic function, additional arguments to be passed down to methods. For the "seqModel" and "sparseLTSGrid" methods, additional arguments to be passed down to xyplot.
的通用函数,其他参数传下来的方法。对于"seqModel"和"sparseLTSGrid"方法,其他参数传递给xyplot。
值----------Value----------
An object of class "trellis" (see xyplot).
类的一个对象"trellis"(见xyplot)。
(作者)----------Author(s)----------
Andreas Alfons
参见----------See Also----------
xyplot, rlars, sparseLTSGrid
xyplot,rlars,sparseLTSGrid
实例----------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)
## create plot[#创建一个图]
coefPlot(fit, zeros = FALSE)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|