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

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

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

                                        Sparse least trimmed squares regression
                                         稀疏至少修剪最小二乘回归

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

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

Compute least trimmed squares regression with an L1 penalty on the regression coefficients, which allows for sparse model estimates, over a grid of values for the penalty parameter.
计算至少修剪最小二乘回归与L1刑罚的回归系数,这使得稀疏模型估计,超过一格罚参数的值。


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


  sparseLTSGrid(x, ...)

  ## S3 method for class 'formula'
sparseLTSGrid(formula, data, ...)

  ## Default S3 method:
sparseLTSGrid(x, y, lambda,
    mode = c("lambda", "fraction"), crit = "BIC", ...,
    model = TRUE)



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

参数:formula
a formula describing the model.
描述的模型的公式。


参数:data
an optional data frame, list or environment (or object coercible to a data frame by as.data.frame) containing the variables in the model.  If not found in data, the variables are taken from environment(formula), typically the environment from which sparseLTS is called.
一个可选的数据框,列表或环境(或对象转换成一个数据框由as.data.frame)包含在模型中的变量。如果没有找到,数据,变量environment(formula),通常是sparseLTS被称为环境。


参数:x
a numeric matrix containing the predictor variables.
一个包含预测变量的数值矩阵。


参数:y
a numeric vector containing the response variable.
一个数字包含响应变量的向量。


参数:lambda
a numeric vector of non-negative numeric values to be used as penalty parameter.
罚参数被用来作为非负的数值的一个数值向量。


参数:mode
a character string specifying the type of penalty parameter.  If "lambda", lambda gives the grid of values for the penalty parameter directly.  If "fraction", the smallest value of the penalty parameter that sets all coefficients to 0 is first estimated based on bivariate winsorization, then lambda gives the fractions of that estimate to be used (hence all values of lambda should be in the interval [0,1] in that case).
一个字符串指定类型参数的罚款。如果"lambda",lambda给出了的电网直接罚参数的值。如果"fraction",罚参数,设置所有的系数为0的值最小的第一估计基于二元极值调整,然后lambda给出的馏分,估计要使用(因此所有值lambda应该是在区间[0,1]在这种情况下)。


参数:crit
a character string specifying the optimality criterion to be used for selecting the final model. Currently, only "BIC" for the Bayes information criterion is implemented.
一个字符的字符串指定的最优性准则用于选择最终模型。目前,仅是"BIC"贝叶斯信息标准的实施。


参数:...
additional arguments to be passed to sparseLTS.
额外的参数传递给sparseLTS。


参数:model
a logical indicating whether the data x and y should be added to the return object.  If intercept is TRUE, a column of ones is added to x to account for the intercept.
逻辑指示是否数据x和y应该被添加到返回的对象。如果interceptTRUE“的一列被添加到x考虑到拦截。


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

An object of class "sparseLTSGrid" (inheriting from class "seqModel") with the following components:
类的一个对象"sparseLTSGrid"(继承自类"seqModel")以下部分组成:


参数:best
an integer matrix in which each column contains the best subset of h observations found and used for computing the raw estimates with the corresponding penalty parameter.
一个整数的矩阵,其中每列包含h观测发现和用于计算与相应的罚参数的原始估计的最佳子集。


参数:objective
a numeric vector giving the values of the sparse LTS objective function, i.e., the L1 penalized sum of the h smallest squared residuals from the raw fits.
给一个数值向量的稀疏LTS目标函数,即,L1且处罚金额的h的最小残差平方的原始适合。


参数:coefficients
a numeric matrix in which each column contains the coefficient estimates of the corresponding reweighted fit (including the intercept if intercept is TRUE).
一个数字矩阵中的每一列都包含系数估计相应的重加权拟合(包括intercept拦截如果TRUE)。


参数:fitted.values
a numeric matrix in which each column contains the fitted values of the response of the corresponding reweighted fit.
一个数字的矩阵,其中每个列中包含的响应对应的重加权拟合的拟合值。


参数:residuals
a numeric matrix in which each column contains the residuals of the response of the corresponding reweighted fit.
一个数字的矩阵,其中每个列中包含的响应对应的重加权拟合的残差。


参数:center
a numeric vector giving the robust center estimates of the residuals from the reweighted fits.
提供强大的中心一个数值向量估计的重加权拟合后的残差。


参数:scale
a numeric vector giving the robust scale estimates of the residuals from the reweighted fits.
提供强大的规模估计一个数值向量的重新加权拟合后的残差。


参数:lambda
a numeric vector giving the values of the penalty parameter.
一个数值向量给予惩罚参数的值。


参数:intercept
a logical indicating whether the model includes a constant term.
逻辑指示是否该模型包括一个常数项。


参数:alpha
a numeric value giving the percentage of the residuals for which the L1 penalized sum of squares was minimized.
一个数字值,该值给人L1惩罚平方和最小化的残差的百分比。


参数:quan
the number h of observations used to compute the raw estimates.
的数目h用于计算的原始估计的观测。


参数:cnp2
a numeric vector giving the consistency factors applied to the scale estimates of the residuals from the reweighted fits.
一个数字矢量,应用的规模估计残差重加权拟合的一致性因素。


参数:weights
an integer matrix in which each column contains binary weights that indicate outliers from the corresponding reweighted fit, i.e., the weights are 1 for observations with reasonably small reweighted residuals and 0 for observations with large reweighted residuals.
一个整数矩阵中的每一列都包含二进制表示异常值的权重,相应的重加权拟合,即,权重是1观测相当小的重加权残差和0大重加权残差观测。


参数:df
an integer vector giving the degrees of freedom of the obtained reweighted model fits, i.e., the number of nonzero coefficient estimates.
适合程度的自由所获得的重加权模型给一个整数向量,即非零系数的估计数。


参数:raw.coefficients
a numeric matrix in which each column contains the coefficient estimates of the corresponding raw fit (including the intercept if intercept is TRUE).
一个数字矩阵中的每一列都包含系数估计相应的原始配合(包括intercept拦截如果TRUE)。


参数:raw.residuals
a numeric matrix in which each column contains the residuals of the corresponding raw fit.
一个数字的矩阵,其中每个列中包含的相应的原始拟合的残差。


参数:raw.center
a numeric vector giving the robust center estimates of the residuals from the raw fits.
提供强大的中心估计一个数值向量的原始适合的残差。


参数:raw.scale
a numeric vector giving the robust scale estimates of the residuals from the raw fits.
提供强大的规模估计一个数值向量的原始适合的残差。


参数:raw.cnp2
a numeric vector giving the consistency factors applied to the scale estimates of the residuals from the raw fits.
提供的一致性因素的规模估计一个数值向量的原始适合的残差。


参数:raw.weights
an integer matrix in which each column contains binary weights that indicate outliers of the corresponding raw fit, i.e., the weights used for the reweighted fits.
一个整数的矩阵,其中每一列包含二进制权重,表明相应的原料配合,即,权重用于重加权配合的离群值。


参数:crit
a character string specifying the optimality criterion used for selecting the optimal model.
一个字符串,指定用于选择的最优模型的最优标准。


参数:critValues
a numeric vector containing the values of the optimality criterion from the reweighted fits.
一个数值向量的最优标准值重加权拟合。


参数:sOpt
an integer giving the optimal reweighted fit.
一个整数,给出最佳的重加权拟合。


参数:raw.critValues
a numeric vector containing the values of the optimality criterion from the raw fits.
含有从原料配合的最优性准则的值的一个数值向量。


参数:raw.sOpt
an integer giving the optimal raw fit.
一个整数,给出的最佳原料配合。


参数:x
the predictor matrix (if model is TRUE).
如果model的预测矩阵(是TRUE“)。


参数:y
the response variable (if model is TRUE).
model响应变量(如果TRUE)。


参数:call
the matched function call.
匹配的函数调用。


注意----------Note----------

Package robustHD has a built-in back end for sparse least trimmed squares using the C++ library Armadillo. Another back end is available through package sparseLTSEigen, which uses the C++ library Eigen. The latter is faster, but not available on all platforms. For instance, sparseLTSEigen currently does not work on 32-bit R for Windows.  In addition, there is currently no binary package for OS X available on CRAN due to problems with the PowerPC architecture. Nevertheless, OS X users with Intel machines can install RcppEigen and sparseLTSEigen from source if the standard R developer tools are installed.
套件robustHD有一个内置的后端稀疏至少修剪广场使用C + +库的犰狳。另一个后端是通过包sparseLTSEigen,使用C + +库征。后者速度较快,但并不适用于所有平台。例如,sparseLTSEigen目前不用于Windows的32位R。此外,目前在CRAN OS X PowerPC架构的问题,由于没有二进制包。然而,与Intel的机器可以安装OS X用户RcppEigen和sparseLTSEigen源标准的R开发工具的安装。


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



Andreas Alfons




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

sparseLTS, coef.sparseLTSGrid, fitted.sparseLTSGrid, plot.sparseLTSGrid, diagnosticPlot, predict.sparseLTSGrid, residuals.sparseLTSGrid, weights.sparseLTSGrid,
sparseLTS,coef.sparseLTSGrid,fitted.sparseLTSGrid,plot.sparseLTSGrid,diagnosticPlot,predict.sparseLTSGrid,residuals.sparseLTSGrid,weights.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[坏的平衡点]

## fit sparse LTS models over a grid of values for lambda[#适合稀疏LTS模型的lambda值的网格]
frac <- seq(0.25, 0.05, by = -0.05)
fitGrid <- sparseLTSGrid(x, y, lambda = frac, mode = "fraction")
coef(fitGrid, zeros = FALSE)

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-25 12:23 , Processed in 0.048715 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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