# GMAR model
params22 <- c(0.4, 0.39, 0.6, 0.3, 0.4, 0.1, 0.6, 0.3, 0.8)
is_stationary(p=2, M=2, params=params22)
# StMAR model
params12t <- c(-0.3, 1, 0.9, 0.1, 0.8, 0.6, 0.7, 10, 12)
is_stationary(p=1, M=2, params=params12t, model="StMAR")
# G-StMAR model
params12gs <- c(1, 0.1, 1, 2, 0.2, 2, 0.8, 20)
is_stationary(p=1, M=c(1, 1), params=params12gs, model="G-StMAR")
# Restricted GMAR model
params13r <- c(0.1, 0.2, 0.3, -0.99, 0.1, 0.2, 0.3, 0.5, 0.3)
is_stationary(p=1, M=3, params=params13r, restricted=TRUE)
# Such StMAR(3, 2) that the AR coefficients are restricted to be the
# same for both regimes and that the second AR coefficients are
# constrained to zero.
params32trc <- c(1, 2, 0.8, -0.3, 1, 2, 0.7, 11, 12)
is_stationary(p=3, M=2, params=params32trc, model="StMAR", restricted=TRUE,
constraints=matrix(c(1, 0, 0, 0, 0, 1), ncol=2))
Run the code above in your browser using DataLab