Compute rolling or recursive out-of-sample prevision
rreg = rolreg(namey0,,arg1,...,argn)
* namey0 = a time series, a real (nx1) vector or a string equal to the name of a time series or a (nx1) real vector between quotes
* argi = arguments which can be:
- a time series
- a real (nx1) vector
- a real (nxk) matrix
- a string equal to the name of a time series or a (nxk) real vector or matrix between quotes
- a list of such elemnts
- 'simu =''roll''' or ''recu''' : if the user want to use a rolling or recursice window (default=recursive)
- 'hstep = xx': number of out-of-sample forecast which determine frequence of restimation of the model)
- 'mul = 1' : if the user wants to keep forecast from 1 to hstep (otherwise the hstep forecast is conserved)
- 'dates = [''xx'',''yy'']': end of first estimation and end of sample
- 'cte' if the user want a constant in the regression
- 'meth=nwest' / 'ols' estimation
- 'win = xx" truncation window for newey-west estimation
- 'xsmpl=1' allow program to extand the last hstep-ahead forecasts beyond the last date of endogenous variable (provided exogenous data are available, the program tests it)
* prt = %f if the user does not want to print the results (optional)
* rreg = a results tlist with
- rreg('meth') = 'rolling' / 'recursive'
- rreg('beta') = rolling/recursive betas
- rreg('tstat') = rolling/recursive tstats
- rreg('pvalue') = rolling/recursive pvalue of the betas
- rreg('rsqr') = rolling/recursive rsquared
- rreg('rbar') = rolling/recursiverbar-squared
- rreg('yhat') = out-of-sample forecasts
- rreg('prescte') = boolean indicating the presence or absence of a constant in the regression
- rreg('bounds') = begin-end of first estimation and end of sample
- rreg('nfor') = vector of number of realized forecast and number of desired forecast
//Examples taken from rolreg_d() : global GROCERDIR ; load(GROCERDIR+'\data\industrial.dat') bounds() ri = rolreg('delts(log(y))','ypast','delts(yfut)','cte','dates=[''1992q1'' ''2003q4'']','hstep=4','mul=1','simu=''recu''') // Out-of-sample forecasts 4 quarters ahead, forecasts from 1 to 4 quater are stored, with recursive estimation ri = rolreg('delts(log(y))','ypast','delts(yfut)','cte','dates=[''1992q1'' ''2003q4'']','hstep=1','simu=''roll''') // Out-of-sample forecasts 1 quarter ahead with rolling estimation | ![]() | ![]() |