sim_Zn_stat {CPAT}  R Documentation 
RènyiType Statistic Simulation
Description
Simulates multiple realizations of the Rènyitype statistic.
Usage
sim_Zn_stat(size, kn = function(n) { floor(sqrt(n)) },
use_kernel_var = FALSE, kernel = "ba", bandwidth = "and",
n = 500, gen_func = rnorm, args = NULL, parallel = FALSE)
Arguments
size 
Number of realizations to simulate 
kn 
A function returning a positive integer that is used in the definition of the Rènyitype statistic effectively setting the bounds over which the maximum is taken 
use_kernel_var 
Set to 
kernel 
If character, the identifier of the kernel function as used in
the cointReg (see documentation for

bandwidth 
If character, the identifier of how to compute the bandwidth
as defined in the cointReg package (see
documentation for 
n 
The sample size for each realization 
gen_func 
The function generating the random sample from which the statistic is computed 
args 
A list of arguments to be passed to 
parallel 
Whether to use the foreach and doParallel packages to parallelize simulation (which needs to be initialized in the global namespace before use) 
Details
This differs from sim_Zn()
in that the longrun variance is estimated
with this function, while sim_Zn()
assumes the longrun variance is
known. Estimation can be done in a variety of ways. If use_kernel_var
is set to TRUE
, longrun variance estimation using kernelbased
techniques will be employed; otherwise, a technique resembling standard
variance estimation will be employed. Any technique employed, though, will
account for the potential break points, as described in
Rice et al. (). See the documentation for
stat_Zn
for more details.
The parameters kernel
and bandwidth
control parameters for
longrun variance estimation using kernel methods. These parameters will be
passed directly to stat_Zn
.
Value
A vector of simulated realizations of the Rènyitype statistic
References
Andrews DWK (1991). “Heteroskedasticity and Autocorrelation Consistent Covariance Matrix Estimation.” Econometrica, 59(3), 817858.
Rice G, Miller C, Horváth L (????). “A new class of change point test of Rényi type.” inpress.
Examples
CPAT:::sim_Zn_stat(100)
CPAT:::sim_Zn_stat(100, kn = function(n) {floor(log(n))},
use_kernel_var = TRUE, gen_func = CPAT:::rchangepoint,
args = list(changepoint = 250, mean2 = 1))