Learn R Programming

CPAT (version 0.1.0)

get_lrv_vec: Long-Run Variance Estimation With Possible Change Points

Description

Computes the estimates of the long-run variance in a change point context, as described in horvathricemiller19CPAT. By default it uses kernel and bandwidth selection as used in the package cointReg, though changing the parameters kernel and bandwidth can change this behavior. If cointReg is not installed, the Bartlett internal (defined internally) will be used and the bandwidth will be the square root of the sample size.

Usage

get_lrv_vec(dat, kernel = "ba", bandwidth = "and")

Arguments

dat

The data vector

kernel

If character, the identifier of the kernel function as used in cointReg (see getLongRunVar); if function, the kernel function to be used for long-run variance estimation (default is the Bartlett kernel in cointReg)

bandwidth

If character, the identifier for how to compute the bandwidth as defined in cointReg (see getBandwidth); if function, a function to use for computing the bandwidth; if numeric, the bandwidth value to use (the default is to use Andrews' method, as used in cointReg)

Value

A vector of estimates of the long-run variance

References

Examples

Run this code
# NOT RUN {
x <- rnorm(1000)
CPAT:::get_lrv_vec(x)
CPAT:::get_lrv_vec(x, kernel = "pa", bandwidth = "nw")
# }

Run the code above in your browser using DataLab