Transform Series
transform_series.Rd
Returns a suitably transformed, lagged and/or differenced data. Inspired by the GAUSS procs originally written by Mark Watson.
Arguments
- y
numeric vector, input time series, eg class ts
- take_log
logical, take the natural logarithm? Default is no (FALSE)
- dcode
character option to specify how y is differenced:
"nd", No difference, i.e., level, default
"d1", 1st Difference, i.e., (1 - B)y
"d4", 4th Difference, i.e., (1 - B^4)y, use with quarterly data
"d12", 12th Difference, i.e., (1 - B^12)y, use with monthly data
- pcode
character, option to specify if percentages are computed:
"np", no change, default
"p1", multiply by 100
"p4", multiply by 400, eg. for annualized quarterly rate
"p12", multiply by 1200, eg. for annualized monthly rate