sim_Zn_stat: Rènyi-Type Statistic Simulation

Description Usage Arguments Details Value References Examples

Description

Simulates multiple realizations of the Rènyi-type statistic.

Usage

1
2
3
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ènyi-type statistic effectively setting the bounds over which the maximum is taken

use_kernel_var

Set to TRUE to use kernel-based long-run variance estimation (FALSE means this is not employed)

kernel

If character, the identifier of the kernel function as used in the cointReg (see documentation for cointReg::getLongRunVar); if function, the kernel function to be used for long-run variance estimation (default is the Bartlett kernel in cointReg); this parameter has no effect if use_kernel_var is FALSE

bandwidth

If character, the identifier of how to compute the bandwidth as defined in the cointReg package (see documentation for cointReg::getLongRunVar); if function, a function to use for computing the bandwidth; if numeric, the bandwidth to use (the default behavior is to use the \insertCiteandrews91b;textualCPAT method, as used in cointReg); this parameter has no effect if use_kernel_var is FALSE

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 gen_func

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 long-run variance is estimated with this function, while sim_Zn() assumes the long-run variance is known. Estimation can be done in a variety of ways. If use_kernel_var is set to TRUE, long-run variance estimation using kernel-based 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 \insertCitehorvathricemiller19;textualCPAT. See the documentation for stat_Zn for more details.

The parameters kernel and bandwidth control parameters for long-run variance estimation using kernel methods. These parameters will be passed directly to stat_Zn.

Value

A vector of simulated realizations of the Rènyi-type statistic

References

\insertAllCited

Examples

1
2
3
4
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))

CPAT documentation built on May 1, 2019, 6:51 p.m.

Related to sim_Zn_stat in CPAT...