Learn R Programming

CPAT (version 0.1.0)

sim_Zn: R<U+00E8>nyi-Type Statistic Simulation (Assuming Variance)

Description

Simulates multiple realizations of the R<U+00E8>nyi-type statistic when the long-run variance of the data is known.

Usage

sim_Zn(size, kn, n = 500, gen_func = rnorm, args = NULL, sd = 1)

Arguments

size

Number of realizations to simulate

kn

A function returning a positive integer that is used in the definition of the R<U+00E8>nyi-type statistic effectively setting the bounds over which the maximum is taken

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

sd

The square root of the second moment of the data

Value

A vector of simulated realizations of the R<U+00E8>nyi-type statistic

Examples

Run this code
# NOT RUN {
CPAT:::sim_Zn(100, kn = function(n) {floor(log(n))})
CPAT:::sim_Zn(100, kn = function(n) {floor(log(n))},
              gen_func = CPAT:::rchangepoint, args = list(changepoint = 250,
                                                          mean2 = 1))
# }

Run the code above in your browser using DataLab