View source: R/detectors_monitoring.R
Q.mon | R Documentation |
Performs the multivariate forward CUSUM monitoring procedure with linear boundary
Q.mon( formula, T, m = 10, alternative = c("two.sided", "greater", "less"), H = NULL )
formula |
Specification of the linear regression model by an object of the class "formula" |
T |
Length of the training sample. Monitoring starts at T+1. |
m |
The length of the relative monitoring period m > 1; default is m = 10. Horizons larger than m=10 are not implemented. |
alternative |
A character string specifying the alternative hypothesis; must be one of "two.sided" (default), "greater" or "less". The output detector is the maximum norm of Q_t ("two.sided"), the maximum entry of Q_t ("greater"), or maximum entry of -Q_t ("less"), respectively. |
H |
An optional matrix for the partial hypothesis H'β_t = H'β_0, where H'Q_t is considered instead of Q_t. H must have orthonormal columns. For a test for a break in the intercept, H can also set to the string "intercept". The full structural break test is considered as the default setting (NULL). |
A list containing the following components:
detector |
A vector containing the path of the detector statistic from T+1 onwards depending on the specificaton for the alternative hypothesis |
boundary |
A vector containing the values of the linear boundary function from T+1 onwards |
detector.scaled |
A vector containing the path of the detector divided by the boundary |
statistic |
The test statistic; maximum of detector.scaled |
detectontime |
The vector containing the detection time points for different significance levels, which are the time indices of the first boundary crossing; NA if the null hypothesis is not rejected |
alternative |
The specification for the alternative hypothesis |
critical.value |
A vector containing critical values for different significance levels; NA if critical value for this specification is not implemented |
rejection |
A logical vector containing the test decision for different significance levels; TRUE for rejection; NA if critical value is not implemented |
T <- 100 t <- 5*T u <- rnorm(t,0,1) x <- rnorm(t,1,2) y <- c(rep(0,480), rep(5,20)) + x + I(x^2) + u Q.mon(y~1+x+I(x^2), T) Q.mon(y~1+x+I(x^2), T, alternative = "greater") H <- matrix(c(1,0,0), ncol = 1) Q.mon(y~1+x+I(x^2), T, m=6, H = H)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.