search for: holdout_matrix

Displaying 1 result from an estimated 1 matches for "holdout_matrix".

2010 Feb 07
1
Out-of-sample prediction with VAR
...r.lm = lm(var_model$varresult$ts_Y); # the generated LM ts_Y <- ts(log_residuals[105:155]); ts_XGG <- ts(salesmodeldata$gtrends_global[105:155]); ts_XGL <- ts(salesmodeldata$gtrends_local[105:155]); # Notice how I manually create the lagged values to be used in the Linear Model holdout_matrix <- na.omit(data.frame(ts.union(ts_Y, ts_XGG, ts_XGL, ts_Y.l1 = lag(ts_Y,-1), ts_Y.l2 = lag(ts_Y,-2), ts_Y.l3 = lag(ts_Y,-3), ts_XGG.l1 = lag(ts_XGG,-1), ts_XGG.l2 = lag(ts_XGG,-2), ts_XGG.l3 = lag(ts_XGG,-3), ts_XGL.l1 = lag(ts_XGL,-1), ts_XGL.l2 = lag(ts_XGL,-2), ts_XGL.l3 = lag(ts_XGL,-3), con...