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

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

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

                                        Cross-validation for sparse LTS regression models
                                         稀疏LTS回归模型的交叉验证

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

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

Estimate the prediction error of a previously fit sparse least trimmed squares regression model via (repeated) K-fold cross-validation.  If the model fit contains estimates over a grid of values for the penalty parameter (i.e., for objects of class "sparseLTSGrid"), then in each iteration of cross-validation the optimal model is selected from the training data and used to make predictions for the test data.
(重复)K的-折交叉验证通过先前适合稀疏至少修剪最小二乘回归模型的预测误差估计。如果模型拟合估计超过一格的惩罚参数的值(即类的对象"sparseLTSGrid"),然后在每次迭代交叉验证的最佳模式选择的训练数据,使为测试数据的预测。


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


  ## S3 method for class 'sparseLTS'
repCV(object, cost = rtmspe, K = 5,
    R = 1,
    foldType = c("random", "consecutive", "interleaved"),
    folds = NULL, fit = c("reweighted", "raw", "both"),
    seed = NULL, ...)

  ## S3 method for class 'sparseLTSGrid'
repCV(object, cost = rtmspe,
    K = 5, R = 1,
    foldType = c("random", "consecutive", "interleaved"),
    folds = NULL, fit = c("reweighted", "raw", "both"),
    seed = NULL, ...)



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

参数:object
the model fit for which to estimate the prediction error.
估计的预测误差的模型拟合。


参数:cost
a robust cost function measuring prediction loss.  It should expect vectors to be passed as its first two arguments, the first corresponding to the observed values of the response and the second to the predicted values, and must return a non-negative scalar value.  The default is to use the root trimmed mean squared prediction error (see cost).
一个强大的成本函数测量预测的损失。它应该期待向量就可以通过它的前两个参数,第一个对应的观测值的响应和第二年的预测值,并且必须返回一个非负的标值。默认情况下是使用根修剪平均预测误差平方(见cost“)。


参数:K
an integer giving the number of groups into which the data should be split (the default is five). Keep in mind that this should be chosen such that all groups are of approximately equal size.  Setting K equal to n yields leave-one-out cross-validation.
一个整数,数组的数据应该分开(默认为5)。请记住,这应该是所有组大小约等于选择了这样。设置Kn产量留一交叉验证。


参数:R
an integer giving the number of replications for repeated K-fold cross-validation.  This is ignored for for leave-one-out cross-validation and other non-random splits of the data.
一个整数,代表数的重复,重复K倍交叉验证。这是离开了交叉验证和其他非随机的数据分割忽略。


参数:foldType
a character string specifying the type of folds to be generated.  Possible values are "random" (the default), "consecutive" or "interleaved".
一个字符串指定要产生的褶皱的类型。可能值是"random"(默认值),"consecutive"或"interleaved"。


参数:folds
an object of class "cvFolds" giving the folds of the data for cross-validation (as returned by cvFolds).  If supplied, this is preferred over K and R.
类的一个对象"cvFolds"给的数据进行交叉验证的褶皱(返回cvFolds)。如果提供,这是优于K和R。


参数:fit
a character string specifying for which fit to estimate the prediction error.  Possible values are "reweighted" (the default) for the prediction error of the reweighted fit, "raw" for the prediction error of the raw fit, or "both" for the prediction error of both fits.
一个字符的字符串,它指定的适合的预测误差的估计。可能的值是"reweighted"(默认值)的预测误差的重加权拟合,"raw"的预测误差的原料配合,或"both"的预测误差都适合。


参数:seed
optional initial seed for the random number generator (see .Random.seed).
可选的初始种子的随机数发生器(见.Random.seed“)。


参数:...
additional arguments to be passed to the prediction loss function cost.
额外的参数传递的预测损失函数cost。


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

An object of class "cv" with the following components:
对象的类"cv"以下组件:


参数:n
an integer giving the number of observations.
一个整数,给出了若干意见。


参数:K
an integer giving the number of folds.
一个整数,给出的倍数的数目。


参数:R
an integer giving the number of replications.
一个整数,复制数量。


参数:cv
a numeric vector containing the estimated prediction errors for the requested model fits.  For repeated cross-validation, this contains the average values over all replications.
符合所要求的模型的预测误差估计的数字向量。对于重复交叉验证,这包含了对所有重复的平均值。


参数:se
a numeric vector containing the estimated standard errors of the prediction loss for the requested model fits.
符合一个数字向量所要求的模型的预测损失的估计标准误差。


参数:reps
a numeric matrix in which each column contains the estimated prediction errors from all replications for the requested model fits.  This is only returned for repeated cross-validation.
一个数字矩阵,其中每一列都包含所有复制的模型拟合估计的预测误差。这是只返回进行反复交叉验证。


参数:seed
the seed of the random number generator before cross-validation was performed.
进行交叉验证之前的随机数发生器的种子。


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


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



Andreas Alfons




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

sparseLTS, sparseLTSGrid, predict.sparseLTS, cvFolds, cost
sparseLTS,sparseLTSGrid,predict.sparseLTS,cvFolds,cost


实例----------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 and evaluate sparse LTS model[#适应和评估模型稀疏LTS]
fit <- sparseLTS(x, y, lambda = 0.05, mode = "fraction")
cv <- repCV(fit)
cv

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-25 10:00 , Processed in 0.023632 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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