lars算法r语言操作指南

上传人:第*** 文档编号:61704022 上传时间:2018-12-10 格式:PDF 页数:10 大小:94.82KB
返回 下载 相关 举报
lars算法r语言操作指南_第1页
第1页 / 共10页
lars算法r语言操作指南_第2页
第2页 / 共10页
lars算法r语言操作指南_第3页
第3页 / 共10页
lars算法r语言操作指南_第4页
第4页 / 共10页
lars算法r语言操作指南_第5页
第5页 / 共10页
点击查看更多>>
资源描述

《lars算法r语言操作指南》由会员分享,可在线阅读,更多相关《lars算法r语言操作指南(10页珍藏版)》请在金锄头文库上搜索。

1、Package lars February 20, 2015 Type Package Version 1.2 Date 2013-04-23 Title Least Angle Regression, Lasso and Forward Stagewise Author Trevor Hastie and Brad Efron Maintainer Trevor Hastie Description Effi cient procedures for fi tting an entire lasso sequence with the cost of a single least squar

2、es fi t. Least angle regression and infi nitesimal forward stagewise regression are related to the lasso, as described in the paper below. Depends R (= 2.10) License GPL-2 URL http:/www-stat.stanford.edu/hastie/Papers/#LARS NeedsCompilation yes Repository CRAN Date/Publication 2013-04-24 09:46:12 R

3、topics documented: cv.lars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 diabetes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 lars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4、 . . . .4 plot.lars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5 predict.lars. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7 summary.lars. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8 Index

5、10 1 2cv.lars cv.larsComputes K-fold cross-validated error curve for lars Description Computes the K-fold cross-validated mean squared prediction error for lars, lasso, or forward stage- wise. Usage cv.lars(x, y, K = 10, index, trace = FALSE, plot.it = TRUE, se = TRUE,type = c(“lasso“, “lar“, “forwa

6、rd.stagewise“, “stepwise“), mode=c(“fraction“, “step“), .) Arguments xInput to lars yInput to lars KNumber of folds indexAbscissa values at which CV curve should be computed. If mode=“fraction“ this is the fraction of the saturated |beta|.The default value in this case is index=seq(from = 0, to =1,

7、length =100). If mode=“step“, this is the number of steps in lars procedure. The default is complex in this case, and depends on whether Np or not. In principal it is index=1:p. Users can supply their own values of index (with care). traceShow computations? plot.itPlot it? seInclude standard error b

8、ands? type type of lars fi t, with default “lasso“ modeThisreferstotheindexthatisusedforcross-validation. Thedefaultis“fraction“ fortype=“lasso“ortype=“forward.stagewise“. Fortype=“lar“ortype=“stepwise“ the default is “step“ .Additional arguments to lars Value Invisibly returns a list with component

9、s (which can be plotted using plotCVlars) indexAs above cvThe CV curve at each value of index cv.errorThe standard error of the CV curve modeAs above diabetes3 Author(s) Trevor Hastie References Efron, Hastie, Johnstone and Tibshirani (2003) “Least Angle Regression“ (with discussion) Annals ofStatis

10、tics; seealsohttp:/www-stat.stanford.edu/hastie/Papers/LARS/LeastAngle_2002. pdf. Examples data(diabetes) attach(diabetes) cv.lars(x2,y,trace=TRUE,max.steps=80) detach(diabetes) diabetesBlood and other measurements in diabetics Description The diabetes data frame has 442 rows and 3 columns. These ar

11、e the data used in the Efron et al “Least Angle Regression“ paper. Format This data frame contains the following columns: x a matrix with 10 columns y a numeric vector x2 a matrix with 64 columns Details The x matrix has been standardized to have unit L2 norm in each column and zero mean. The matrix

12、 x2 consists of x plus certain interactions. Source http:/www-stat.stanford.edu/hastie/Papers/LARS/LeastAngle_2002.ps References Efron, Hastie, Johnstone and Tibshirani (2003) “Least Angle Regression“ (with discussion) Annals of Statistics 4lars lars Fits Least Angle Regression, Lasso and Infi nites

13、imal Forward Stage- wise regression models Description These are all variants of Lasso, and provide the entire sequence of coeffi cients and fi ts, starting from zero, to the least squares fi t. Usage lars(x, y, type = c(“lasso“, “lar“, “forward.stagewise“, “stepwise“), trace = FALSE, normalize = TR

14、UE, intercept = TRUE, Gram, eps = .Machine$double.eps, max.steps, use.Gram = TRUE) Arguments xmatrix of predictors yresponse typeOne of “lasso“, “lar“, “forward.stagewise“ or “stepwise“. The names can be abbreviated to any unique substring. Default is “lasso“. traceIf TRUE, lars prints out its progr

15、ess normalizeIf TRUE, each variable is standardized to have unit L2 norm, otherwise it is left alone. Default is TRUE. interceptif TRUE, an intercept is included in the model (and not penalized), otherwise no intercept is included. Default is TRUE. GramThe XX matrix; useful for repeated runs (bootst

16、rap) where a large XX stays the same. epsAn effective zero max.stepsLimit the number of steps taken; the default is 8 * min(m,n-intercept), with m the number of variables, and n the number of samples. For type=“lar“ or type=“stepwise“, the maximum number of steps is min(m,n-intercept). For type=“lasso“ and especially type=“forward.stagewise“, there can be many more terms, because although no more than min(m,n-intercept) vari- ables can be active during any step, variables are frequentl

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 解决方案

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号