<< polymult Basic functions readxls2bd >>

Grocer >> Basic functions > ptrend

ptrend

matrix of polynomial trend

CALLING SEQUENCE

[xmat]=ptrend(p,nobs)

PARAMETERS

Input

* 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

 

Output

* xmat = matrix containing polynomial trend model data set

DESCRIPTION

Produces an explanatory variables matrix containing a polynomial time-trend.

EXAMPLE

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

AUTHOR

Eric Dubois 2002

Report an issue
<< polymult Basic functions readxls2bd >>