statcomp: Computes structural change test statistic

Description Usage Arguments Value Examples

Description

Computes test statistic value for each time point. Likelihood-ratio test (LRT), Cumulative sum test (CUSUM) and Darling-Erdös-type test (DET) statistics are supported.

Usage

1
statcomp(model, type = "CUSUM", trim = NULL)

Arguments

model

A list returned by VAR or VARMA functions from MTS package

type

A character string which determines type of the test statistic returned by the function, either "CUSUM", "LRT" or "DET". The default is "CUSUM"

trim

A number of time points on data edges for which test statistic is not computed

Value

statcomp returns a list of class "VARCP" with following items

values

Named vector of values of selected test statistic, where name is time index for which statistic is computed

type

Character string which states type of the computed test statistic

Examples

1
2
3
4
5
6
7
8
9
## Simulation of time series of length 200
phi <- matrix(c(0.2,-0.6,0.3,1),2,2)
sig <- matrix(c(4,0.8,0.8,1),2,2)
data <- VARMAsim(200, arlags = 1, phi = phi, sigma = sig)
model <- VAR(data[["series"]], p = 1)

## Tests estimation
CUSUM <- statcomp(model, type = "CUSUM")
LRT <- statcomp(model, type = "LRT", trim = 15)

MasimovR/VARCP documentation built on May 28, 2019, 1:48 p.m.