mosum.criticalValue: MOSUM asymptotic critical value

Description Usage Arguments Value Examples

View source: R/mosum_test.R

Description

Computes the asymptotic critical value for the MOSUM test.

Usage

1
mosum.criticalValue(n, G.left, G.right, alpha)

Arguments

n

an integer value for the length of the input data

G.left, G.right

integer values for the left and right moving sum bandwidth (G.left, G.right)

alpha

a numeric value for the significance level with 0 <= alpha <= 1

Value

a numeric value for the asymptotic critical value for the MOSUM test

Examples

1
2
3
4
5
6
7
x <- testData(lengths = rep(100, 3), means = c(0, 5, -2), sds = rep(1, 3), seed = 1234)$x
m <- mosum(x, G = 40)
par(mfrow = c(2, 1))
plot(m$stat, type = "l", xlab = "Time", ylab = "", main = "mosum")
abline(h = mosum.criticalValue(300, 40, 40, .1), col = 4)
abline(v = m$cpts, col = 2)
plot(m, display = "mosum") # identical plot is produced 

mosum documentation built on June 25, 2021, 5:08 p.m.