stat_Vn {CPAT}  R Documentation 
Compute the CUSUM Statistic
Description
This function computes the CUSUM statistic (and can compute weighted/trimmed
variants, depending on the values of kn
and tau
).
Usage
stat_Vn(dat, kn = function(n) { 1 }, tau = 0, estimate = FALSE,
use_kernel_var = FALSE, custom_var = NULL, kernel = "ba",
bandwidth = "and", get_all_vals = FALSE)
Arguments
dat 
The data vector 
kn 
A function corresponding to the trimming parameter 
tau 
The weighting parameter 
estimate 
Set to 
use_kernel_var 
Set to 
custom_var 
Can be a vector the same length as 
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

get_all_vals 
If 
Details
The definition of the statistic is
T^{1/2} \max_{1 \leq t \leq T} \hat{\sigma}_{t,T}^{1} \left
\sum_{s = 1}^t X_s  \frac{t}{T}\sum_{s = 1}^T \right
A more general version is
T^{1/2} \max_{t_T \leq t \leq T  t_T} \hat{\sigma}_{t,T}^{1}
\left(\frac{t}{T}
\left(\frac{T  t}{T}\right)\right)^{\tau} \left \sum_{s = 1}^t X_s 
\frac{t}{T}\sum_{s = 1}^T \right
The parameter kn
corresponds to the trimming parameter t_T
and
the parameter tau
corresponds to \tau
.
See (Rice et al. ) for more details.
Value
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)
References
Rice G, Miller C, Horváth L (????). “A new class of change point test of Rényi type.” inpress.
Examples
CPAT:::stat_Vn(rnorm(1000))
CPAT:::stat_Vn(rnorm(1000), kn = function(n) {0.1 * n}, tau = 1/2)
CPAT:::stat_Vn(rnorm(1000), use_kernel_var = TRUE, bandwidth = "nw", kernel = "bo")