Description Usage Arguments Details Value References Examples
A function for the calculation of confidence bands for the trend component of the Hodrick-Prescott (HP) filter as proposed by Giles (2013).
1 |
data |
an object of class "mFilter" containing the output of the function |
V_y |
a numeric specifying the variance of the cyclical component. If |
ci |
numeric between 0 and 1 specifying the confidence interval. Defaults to 0.95. |
The function uses the filter matrix F from an "mFilter" object to obtain the matrix Q = ≤ft[I_T + λ K' K]^{-1}\right]. Since Q y provides an estimate of the trend \hat{tau} and F y yields the cyclical component of the process \hat{c} and the time series y is decomposed only into those two components so that y = \hat{tau} + \hat{c}, Q can be obtained from I_T y - Fy = Q y so that Q = I_T - F.
The confidence band is then derived from the covariance matrix V(\hat{tau}) = Q V(y) Q.
By default V_y = NULL
so that the sample variance of the original time series
is used for the construction of V(y). This can be chanced by providing
a numeric value, for example from the output of an esitmated ARIMA model.
A time-series object of four variables
trend: The estimated trend component
ci_lower: The lower bound of the confidence band
ci_upper: The upper bound of the confidence band
y: The actual series
Giles, D. E. (2013). Constructing confidence bands for the Hodrick-Prescott filter. Applied Economics Letters, 20(5), 480–484. https://doi.org/10.1080/13504851.2012.714057
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.