matrix of polynomial trend
[xmat]=ptrend(p,nobs)
* p = order of the time-trend polynomial
. p < 0, xmat = empty vector
. p = 1, xmat = time trend
. p > 1, xmat = higher order polynomial in time
* nobs = size of the matrix
* xmat = matrix containing polynomial trend model data set
ext=ptrend(2,10) // retruns // // ext = //! 1. 1. 1. ! //! 1. 2. 4. ! //! 1. 3. 9. ! //! 1. 4. 16. ! //! 1. 5. 25. ! //! 1. 6. 36. ! //! 1. 7. 49. ! //! 1. 8. 64. ! //! 1. 9. 81. ! //! 1. 10. 100. ! load(GROCERDIR+'/data/bdhenderic.dat') r=ols1('lm1','const','ptrend(1,length(series(lm1)))') // regress lm1 on a constant an a trend | ![]() | ![]() |