Compute the Hidalgo-Seo Statistic
This function computes the Hidalgo-Seo statistic for a change in mean model.
stat_hs(dat, estimate = FALSE, corr = TRUE, get_all_vals = FALSE, custom_var = NULL, use_kernel_var = FALSE, kernel = "ba", bandwidth = "and")
dat |
The data vector |
estimate |
Set to |
corr |
If |
get_all_vals |
If |
custom_var |
Can be a vector the same length as |
use_kernel_var |
Set to |
kernel |
If character, the identifier of the kernel function as used in
cointReg (see |
bandwidth |
If character, the identifier for how to compute the
bandwidth as defined in cointReg (see
|
For a data set x_t with n observations, the test statistic is
\max_{1 ≤q s ≤q n - 1} (\mathcal{LM}(s) - B_n)/A_n
where \hat{u}_t = x_t - \bar{x} (\bar{x} is the sample mean), a_n = (2 \log \log n)^{1/2}, b_n = a_n^2 - \frac{1}{2} \log \log \log n - \log Γ (1/2), A_n = b_n / a_n^2, B_n = b_n^2/a_n^2, \hat{Δ} = \hat{σ}^2 = n^{-1} ∑_{t = 1}^{n} \hat{u}_t^2, and \mathcal{LM}(s) = n (n - s)^{-1} s^{-1} \hat{Δ}^{-1} ≤ft( ∑_{t = 1}^{s} \hat{u}_t\right)^2.
If corr
is FALSE
, then the residuals are assumed to be
uncorrelated. Otherwise, the residuals are assumed to be correlated and
\hat{Δ} = \hat{γ}(0) + 2 ∑_{j = 1}^{\lfloor √{n}
\rfloor} (1 - \frac{j}{√{n}}) \hat{γ}(j) with \hat{γ}(j)
= \frac{1}{n}∑_{t = 1}^{n - j} \hat{u}_t \hat{u}_{t + j}.
This statistic was presented in (Hidalgo and Seo 2013).
If both estimate
and get_all_vals
are FALSE
, the
value of the test statistic; otherwise, a list that contains the test
statistic and the other values requested (if both are TRUE
,
the test statistic is in the first position and the estimated change
point in the second)
Hidalgo J, Seo MH (2013). “Testing for structural stability in the whole sample.” Journal of Econometrics, 175(2), 84 - 93. ISSN 0304-4076, doi: 10.1016/j.jeconom.2013.02.008, http://www.sciencedirect.com/science/article/pii/S0304407613000626.
CPAT:::stat_hs(rnorm(1000)) CPAT:::stat_hs(rnorm(1000), corr = FALSE)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.