get.longrun.growth {tdata}R Documentation

Calculate Long-run Growth

Description

Use this function to calculate the long-run growth of a time-series data.

Usage

get.longrun.growth(
  data,
  continuous = FALSE,
  isPercentage = FALSE,
  trimStart = 0,
  trimEnd = 0,
  skipZero = TRUE
)

Arguments

data

A numeric vector that represents the data of the series.

continuous

A logical value indicating whether to use the continuous formula.

isPercentage

A logical value indicating whether the unit of measurement in data is a percentage (e.g., growth rate). If TRUE, the long-run growth rate is calculated by the arithmetic mean for the continuous case and the geometric mean otherwise. If missing data exists, it returns NA.

trimStart

If the number of leading NAs is larger than this number, the function returns NA. Otherwise, it finds the first non-NA value and continues the calculations.

trimEnd

Similar to trimStart, but for the end of the series.

skipZero

If TRUE, leading and trailing zeros are skipped, similar to NA.

Details

A variable can have discrete growth (y(t)=y(0) (1+g_1)(1+g_2)\ldots (1+g_t)) or continuous growth (y(t)=y(0)e^{g_1}e^{g_2}\ldots e^{g_t}) over t periods. y(0) is the first value and y(n) is the last value. By long-run growth rate, we mean a number such as g such that if we start from y(0) and the variable growth is g every period, we reach y(t) after t periods. This number summarizes all g_is, however, it is not generally the average of these rates.

Value

The long-run growth rate (percentage).

Examples

y <- c(60, 70, 80, 95)
g <- get.longrun.growth(y, isPercentage = TRUE, continuous = FALSE)
# Note that 'g' is different from 'mean(y)'.


[Package tdata version 0.3.0 Index]