Skip to contents

Function that computes the growth-rate series of a given time series.

Usage

compute_gr(x, s)

Arguments

x

(ts) A time series.

s

(int) Lag at which the growth-rate is computed.

Value

Series of growth-rates.

Examples

compute_gr(gdp_current, 4)
#>              Qtr1         Qtr2         Qtr3         Qtr4
#> 1996   6.08867935   5.73366955   6.94101827   6.18686456
#> 1997   5.32681999   5.82833781   5.81264625   7.46501855
#> 1998   6.98155490   7.27951434   7.29008445   6.67717099
#> 1999   8.08741157   7.00562308   6.95832050   6.61438891
#> 2000   9.06819247   8.74976630   8.98005651   8.40994962
#> 2001   8.35264254   8.37426628   8.22058324   8.04739915
#> 2002   6.77166868   7.57023801   6.74191279   6.75074862
#> 2003   7.42351445   6.86315302   7.10328334   6.88637531
#> 2004   6.77696252   7.10300641   7.12200283   7.54900113
#> 2005   7.82270050   8.26277426   7.72777345   7.83441834
#> 2006   8.50975754   8.15453015   8.13385108   8.33167442
#> 2007   7.59546737   7.38800486   6.56169370   7.33162575
#> 2008   4.60891079   4.62357092   3.49269979   0.45317484
#> 2009  -3.58531607  -4.47171250  -3.34082391  -2.78017391
#> 2010  -0.13945870   0.57487679   0.48714645   0.59819611
#> 2011   0.52689199  -0.30509116  -0.81355571  -2.43296975
#> 2012  -2.47403400  -3.65549932  -2.36515908  -3.68960917
#> 2013  -2.12405793  -1.20572806  -0.77565679   0.08553608
#> 2014   0.61601229   0.69904045   1.56383653   2.26817223
#> 2015   3.92026445   4.62423561   4.80097010   5.15049549
#> 2016   3.41225868   3.49451206   3.39643280   2.91170979
#> 2017   3.83693314   4.22874193   4.13297782   4.53170863
#> 2018   3.61508079   3.69190051   3.38047734   3.74782208
#> 2019   4.36985390   3.46733865   2.95875393   2.93721012
#> 2020  -3.45277544 -20.65877496  -7.83749740  -7.43836816
#> 2021  -1.99739321  21.58771832   8.21233576  11.34964963
#> 2022  12.33458843  12.09859711  11.23976250   9.32055904
#> 2023  11.43661303   9.37664582   8.16222021   7.59735073
#> 2024   5.92433536   6.54964911   6.55500425   6.26887302