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
1) gx = growthr(x)
2) ga = growthr(x,12)
gx is simply the growth rate of ts x; if ts is a monthly ts, ga is mom annual growth rate.