Name
delda — differentiates a ts ignoring NA values
CALLING SEQUENCE
tsout=delda(arg1[,arg2])
PARAMETERS
- Input
arg1 = the order of differenciation (optional, set to 1 if not provided, can be > 0, =0 or < 0) or a ts
arg2 = a time series if the first argument was set to the order of differentiation
- Output
tsout = the differenciated time series
DESCRIPTION
Computes x(t)-x(t-n) for a timeseries x where all NA values are ignored (that is x(t-n) is the nth non NA value preceding x(t)). Equivalent, but a little bit quicker than x-lagts(n,x).
EXAMPLE
load('GROCERDIR\data\Daily_P.dat')
y = delda(P)
// simple differentiation of the daily ts P
y = delda(1,P)
// simple differentiation of the daily ts P
y = delda(4,P)
// y= P-P(-4)
y = delda(-3,x)
// y= P-P(+3)