问题描述
我的问题有两个方面.
如何为我的回归方程选择合适的滞后?我有房价的因变量,以及租金、房屋供应、全国股市指数、抵押贷款利率和房屋空置率的自变量.
How do I select an appropriate lag for my regression equation? I've got a dependent variable of house price, and independent variables of rent, house supply, national stock market index, mortgage rate, and house vacancy rate.
我做了一些阅读,发现 VARselect(data,lag.max=1 or 2 or 3 etc)
可以帮助我选择合适的延迟.
I did some reading and found that VARselect(data,lag.max=1 or 2 or 3 etc)
can help me select an appropriate lag.
data
是一个包含上述变量的 csv 文件.所以下面是我得到的.我该怎么解释它?
data
is a csv file with the above variables. So the below is what I got. How am I supposed to interpret it?
> var=VARselect(data,lag.max=8)
> var
$selection
AIC(n) HQ(n) SC(n) FPE(n)
3 3 1 3
$criteria
1 2 3 4 5 6 7 8
AIC(n) 1.716881 1.575052 1.474927 1.543878 1.493210 1.651975 1.624066 1.773173
HQ(n) 1.807505 1.726093 1.686385 1.815752 1.825500 2.044682 2.077189 2.286712
SC(n) 1.962629 1.984634 2.048341 2.281125 2.394289 2.716887 2.852810 3.165750
FPE(n) 5.569664 4.841214 4.396341 4.741887 4.556023 5.424803 5.393498 6.451249
我想,简而言之,我想知道的是 - 我应该将租金、房屋供应、全国股市指数、抵押贷款利率和房屋空置率相对于房价滞后多少,以创造一个好"够了"模型.
I guess, long in short, what I want to find out is - how much should I lag each of rent, house supply, national stock market index, mortgage rate, and house vacancy rate against house price to create a 'good enough' model.
我愿意接受其他帮助我找出我应该做什么的方法,但请帮助我解决代码.谢谢.
I am open to other methods that help me find out what I should do but please help me out with the code. Thanks.
推荐答案
查看 vars 包的 nofollow noreferrer">文档,特别是 VARselect
函数(与 ?VARselect
的信息相同,但已格式化很好).
Check out the documentation for the vars
package, in particular for the VARselect
function (same information as ?VARselect
, but formatted nicely).
$selection
对象告诉您的是通过最小化 4 个条件中的每一个来选择的总滞后顺序 (赤池, Hannan-Quinn、Schwarz 和 最终预测误差);
What the $selection
object is telling you is the total lag order selected by minimizing each of the 4 criteria (Akaike, Hannan-Quinn, Schwarz, and Final Prediction Error);
$criteria
对象告诉您的是给定滞后时每个标准的值(例如,$criteria[3L, p]
告诉您什么施瓦茨标准是 p
th 滞后规范).如果有很多具有相似标准值的滞后,这可能很有用,如果最小化器的 p
非常高,但 p 的值要低得多,则允许您选择更简约的规范
给你一个类似的标准.
What the $criteria
object tells you is the value of each criteria at the given lag (so that $criteria[3L, p]
, for example, tells you what the Schwarz criterion was for the p
th lag specification). This may be useful if there are a lot of lags that have similar criterion values, allowing you to choose a more parsimonious specification if the minimizer has p
very high, but a much lower value of p
gives you a similar criterion.
另请注意,如果您只运行 VARselect(data)
,它将联合评估拟合模型的标准——我不确定您是什么重新开始,但从您的问题来看,您似乎想要评估数据中每个列的滞后选择过程单独.为此,您必须运行 lapply(data, VARselect)
.
Please also note that if you just run VARselect(data)
, it will evaluate the criterion for fitting the model jointly-- I'm not sure what you're going for, but from your question it seems like you might have wanted to evaluate the lag selection process for each of the columns in your data separately. To do so you'd have to run lapply(data, VARselect)
.
这篇关于为回归方程选择合适的滞后以及如何解释 VARselect 的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!