tslars(tslars)
tslars()所属R语言包:tslars
Function to obtain the selected model accoring the the time series LARS algorithm
功能以获取所选的模型accoring的时间序列LARS算法
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The tslars function applies a dynamic variable selection procedure. It is an extension of the LARS algorithm of Efron et al (2004) which is designed for time series analysis. It provides a ranking of the predictors and a selection of which predictors to include in the final model as well as a selection of the appropriate lag length.
tslars功能适用于动态变量的选择过程。它是一个扩展的LARS埃夫隆等人(2004)的算法,其目的是为时间序列分析。它提供了一个排名的预测和选择,包括在最终的模型,以及选择适当的滞后长度的预测。
用法----------Usage----------
tslars(formula, h = 1, p.max = 5, max.x = 10, nr.rank = NA)
参数----------Arguments----------
参数:formula
a formula describing the model to be fitted
描述的模型的公式,以嵌合
参数:h
the forecast horizon, defaults to 1.
预测水平,默认为1。
参数:p.max
the maximal number of lags to allow, defaults to 5.
最大数目的滞后允许,默认为5秒。
参数:max.x
the maximal number of predictors to include in the final model, defaults to 10.
的最大数量的预测,包括在最终的模型,默认为10。
参数:nr.rank
the number of predictors to be ranked. This is especially interesting if the total number of predictors is really large.
数的预测排名。如果总人数的预测是非常大的,这是特别有趣的。
值----------Value----------
A tslars-object is returned, for which print(), summary(), predict() and coef() are available. An object of class "lm" is a list containing the following components: <table summary="R valueblock"> <tr valign="top"><td>active</td> <td> the active set, a vector giving the TS-LARS ordering of the predictors, '0' indicates lagged values of the response.</td></tr> <tr valign="top"><td>fixedp</td> <td> indicates whether the lag length was prespecified (TRUE) or not (FALSE).</td></tr> <tr valign="top"><td>laglength.opt</td> <td> if fixedp is TRUE, the prespecified lag length. If fixedp is FALSE, the optimal lag length selected according to BIC.</td></tr> <tr valign="top"><td>nrvar.opt</td> <td> the optimal number of predictors to include in the final model, according to the BIC.</td></tr> <tr valign="top"><td>bic</td> <td> the BIC values for the nested models.</td></tr> <tr valign="top"><td>h</td> <td> the forecast horizon used.</td></tr> <tr valign="top"><td>call</td> <td> the matched call.</td></tr> <tr valign="top"><td>response</td> <td> the response used.</td></tr> <tr valign="top"><td>predictors</td> <td> the predictors used.</td></tr> </table>
Atslars对象被返回,print(),summary(),predict()和coef()是可用的。类“lm”的对象是一个列表,其中包含以下组件:<table summary="R valueblock"> <tr valign="top"> <TD>active </ TD> <TD>的活动集,一个向量,TS-LARS订购的预测,“0”表示响应的滞后值。</ TD> </ TR> <tr valign="top"> <TD>fixedp</ TD > <TD>表示的滞后长度是否被预先设定(TRUE)或没有(FALSE)</ TD> </ TR> <tr valign="top"> <TD><X > </ TD> <td>如果laglength.opt是fixedp,预先设定的滞后长度。如果TRUE是fixedp,根据BIC的最优滞后长度选择。</ TD> </ TR> <tr valign="top"> <TD> FALSE</ TD> <TD>的最佳数量的预测,包括在最终的模型,根据BIC的。</ TD> </ TR> <tr valign="top"> <TD>nrvar.opt </ TD> <TD BIC值的嵌套模型。</ TD> </ TR> <tr valign="top"> <TD>bic </ TD> <TD>的预测水平。</ TD> < / TR> <tr valign="top"> <TD> h </ TD> <TD>匹配的呼叫。</ TD> </ TR> <tr valign="top"> <TD> call </ TD> <TD>使用的响应。</ TD> </ TR> <tr valign="top"> <TD>response </ TD> <TD>的预测使用。 </ TD> </ TR> </ TABLE>
(作者)----------Author(s)----------
Sarah Gelper
参考文献----------References----------
实例----------Examples----------
n <- 100
m <- 10 #m>5[M>]
x <- matrix(rnorm(n*m), ncol=m)
coefs <- c(rep(1,5),rep(0,m-5))
y <- c(rnorm(1),crossprod(t(x[1n-1),]),coefs) + rnorm(n-1))
mytslars <- tslars(y~x)
summary(mytslars)
# To obtain an h-step-ahead prediction of the response using the selected model fitted by OLS:[要获得使用选定的OLS模型拟合响应了一个“h一步超前预测:]
myprediction <- predict(mytslars)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|