Library: | cafpe |
See also: | tp/cafpe/xorigex |
Quantlet: | xorigst | |
Description: | Quantlet to cut off starting values from matrices of dependent and independent variables for time series analysis. This is needed if one always wants to cut off the same number of observations when analysing AR(p) models with different orders. |
Usage: | { xnew,ynew } = xorigst(xorig,yorig,xraw,lagmax) | |
Input: | ||
xorig | (nn x p) matrix of lags | |
yorig | (nn x 1) matrix of dependent variable | |
xraw | (n x 1) vector of time series | |
lagmax | scalar, largest lag for consideration (for which starting values have to be cut off) | |
Output: | ||
xnew | ((n-lagmax) x p) matrix of lags | |
ynew | ((n-lagmax x 1) vector of matrix of dependent variable |
pathcafpe = "tp/cafpe/" func(pathcafpe + "xorigex.xpl") func(pathcafpe + "xorigst.xpl") xraw = #(1:100) lags = 1|10 lagmax = 15 { xorigau,yorig }= xorigex(xraw,0,lags,"no") { xnew,ynew } = xorigst(xorigau[1:rows(yorig),],yorig,xraw,lagmax) "xnew~ynew" xnew~ynew
Matrix of dependent variable ynew with lagmax observations cut off such that AR(p) models can be fitted up to p=lagmax. The matrix of lagged variables xnew is adjusted accordingly.
Library: | cafpe |
See also: | tp/cafpe/xorigex |