powered by
Function for generating the n-period rolling geometric growth rate.
geogr(x, n = 1)
The time series for the growth rate to be calculated.
The period for the growth to be calculated over.
The n-period geometric growth rate of the time series.
In order to ensure the growth rate calculated is reliable, the following rule are applied.
50% of the data must be present.
The length of the time series must be greater than n
Otherwise the growth will not be computed.
# NOT RUN { test.ts = abs(rnorm(100)) geogr(test.ts, 1) geogr(test.ts, 3) geogr(test.ts, 10) # }
Run the code above in your browser using DataLab