Approximately normal test proposed by Clark and West (include test of martingal difference hypothesis)
rdb = clwest(namey,arg1,...,argn)
* namey = observed vector or ts
WARNING: in case of of martingal difference test combined with overlapping regression (for computional purpose):
-(1) this series should be in first difference: overlaping terms are be construct by sumation
Ex: If y(t)-y(t-4) = d(y(t))+d(y(t-1))+d(y(t-2))+d(y(t-3)) is the serie to be forecasted it's d(y) that must be entered
-(2) the serie of forecasts should be in the overlapping form (y(t)-y(t-4) in the example)
* argi = arguments which can be:
- 1 or 2 time series according to the test specified (first series should be the benchmark in case of nested models)
- a real (nx1) or (nx2) vector
- a string equal to the name of a time series or a (nx1)/(nx2) real vector or matrix between quotes
- a list of such elements
- 'bench = ''mdh''' if the user want to test martingal difference hypothesis otherwise 2 nested model are tested (default, 'nm')
- 'overlap=xx' the number of overlapping terms if the user performs the martingal difference test for an overlapping regression or the size of the lag truncation window if the user wants an HAC correction when testing for predictive accuracy bewteen nested models
- the string 'noprint' if the user doesn't want to display the results of the regression
- 'dropna' if the user wants to remove the NA values from the data
* rcw = a results tlist with
- rcw('y') = input forecasted series
- rcw('x') = forecasts
- rcw('namey') = name of forecasted serie
- rcw('namex') = names of forecasts
- rcw('stat') = value of the Clark-West statistics
- rcw('pvalue') = p-value of the Clark-West statistics
- rcw('overlap') = number of overalapping terme if any (0 otherwise)
- rcw('prests') = flag for the presence of time series
- rcw('bounds') = if there is a timeseries in the forecast, the bounds of the regression
- rcw('dropna') = boolean indicating if NAs have been droped
- rcw('nonna') = vector indicating position of non-NA values (if the option 'dropna' was active)
load(GROCERDIR+'\data\industrial.dat') bounds('1979q1','2003q4'); // out-of-sample foreacasts rs = rolreg('delts(log(y))','lagts(ypast)','delts(lagts(yfut))','cte',... 'dates=[''1991q4'' ''2003q4'']','hstep=1'); y_short = rs('yfor') ; bounds('1992q1','2003q4') // select an appropriate sample period rscl=clwest('delts(log(y))','y_short','bench=''mdh''') ; | ![]() | ![]() |