Name
growthr — growth rate of a ts
CALLING SEQUENCE
ts=growthr(ts,lag)
PARAMETERS
- Input
ts = a timeseries
lag = an integer (optional, set to 1 if not provided)
- Output
ts = the growthr of the time series
DESCRIPTION
Computes ts(t)/ts(t-lag)-1. If a value for ts is 0, then the corresponding value is set to 'NA'.
EXAMPLE
load(GROCERDIR+'\data\pigiron.dat')
gx = growthr(prigiron)
// growth rate of the monthly series pigiron used for the Bry-Bosachna demo
ga = growthr(x,12)
// year on year growth rate of the monthly series pigiron.