fastcpd_arima {fastcpd} | R Documentation |
Find change points efficiently in
ARIMA(p
, d
, q
) models
Description
fastcpd_arima()
and fastcpd.arima()
are
wrapper functions of fastcpd()
to find change points in
ARIMA(p
, d
, 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_arima(data, order = 0, ...)
fastcpd.arima(data, order = 0, ...)
Arguments
data |
A numeric vector, a matrix, a data frame or a time series object. |
order |
A vector of length three specifying the order of the ARIMA model. |
... |
Other arguments passed to |
Value
A fastcpd object.
See Also
Examples
set.seed(1)
n <- 271
w <- rnorm(n + 1, 0, 3)
dx <- rep(0, n + 1)
x <- rep(0, n + 1)
for (i in 1:180) {
dx[i + 1] <- 0.8 * dx[i] + w[i + 1] - 0.5 * w[i]
x[i + 1] <- x[i] + dx[i + 1]
}
for (i in 181:n) {
dx[i + 1] <- -0.6 * dx[i] + w[i + 1] + 0.3 * w[i]
x[i + 1] <- x[i] + dx[i + 1]
}
result <- fastcpd.arima(
diff(x[1 + seq_len(n)]),
c(1, 0, 1),
segment_count = 3,
include.mean = FALSE
)
summary(result)
plot(result)
[Package fastcpd version 0.14.3 Index]