<< growthr Time series lagts >>

Grocer >> Time series > lagda

lagda

lag a ts ignoring NA values

CALLING SEQUENCE

ts=lagda(arg1[,arg2])

PARAMETERS

Input

* arg1 = the order of differenciation (optional, set to 1 if not provided) or a ts

* arg2 (if arg1 was he order of differenciation) = a time series

 

Output

* ts = the lagged time series

DESCRIPTION

Computes x(t-n) for a timeseries x(t) where all NA values are ignored (that is x(t-n) is the nth non NA value preceding x(t)).

EXAMPLE

load('GROCERDIR\data\Daily_P.dat')
y = lagda(P)
// y is P lagged once.
y = lagda(4,P)
// y is x lagged four times.
y = lagda(-1,x)
// y is P forwarded once.

AUTHOR

Eric Dubois 2007

Report an issue
<< growthr Time series lagts >>