fastcpd_garch {fastcpd} | R Documentation |
Find change points efficiently in GARCH(p
, q
) models
Description
fastcpd_garch()
and fastcpd.garch()
are
wrapper functions of fastcpd()
to find change points in
GARCH(p
, q
) models. The function is similar to fastcpd()
except that the data is by default a one-column matrix or univariate vector
and thus a formula is not required here.
Usage
fastcpd_garch(data, order = c(0, 0), ...)
fastcpd.garch(data, order = c(0, 0), ...)
Arguments
data |
A numeric vector, a matrix, a data frame or a time series object. |
order |
A positive integer vector of length two specifying the order of the GARCH model. |
... |
Other arguments passed to |
Value
A fastcpd object.
See Also
Examples
set.seed(1)
n <- 400
sigma_2 <- rep(1, n + 1)
x <- rep(0, n + 1)
for (i in seq_len(200)) {
sigma_2[i + 1] <- 20 + 0.5 * x[i]^2 + 0.1 * sigma_2[i]
x[i + 1] <- rnorm(1, 0, sqrt(sigma_2[i + 1]))
}
for (i in 201:400) {
sigma_2[i + 1] <- 1 + 0.1 * x[i]^2 + 0.5 * sigma_2[i]
x[i + 1] <- rnorm(1, 0, sqrt(sigma_2[i + 1]))
}
result <- suppressWarnings(
fastcpd.garch(x[-1], c(1, 1), include.mean = FALSE)
)
summary(result)
plot(result)
[Package fastcpd version 0.14.3 Index]