mixSARfit | R Documentation |
Provides estimation via EM-Algorithm for mixture autoregressive models including seasonal AR parameters.
mixSARfit(y, model, est_shift = FALSE, tol = 10^-14)
y |
a time series (currently a numeric vector). |
model |
an object of class |
est_shift |
if missing or |
tol |
threshold for stopping criterion. |
This function only works for "MixAR"
objects in which slot
arcoef
is of class "raggedCoefS"
.
A list of 2:
model |
an object of class |
vallogf |
the value of the loglikelihood function for the returned model. |
Davide Ravagli and Georgi N. Boshnakov
ar1 <- list(c(0.5, -0.5), c(1.1, 0, -0.5))
ar12 <- list(0, c(-0.3, 0.1))
s = 12
rag <- new("raggedCoefS", a = ar1, as = ar12, s = s)
model <- new("MixARGaussian", prob = exampleModels$WL_A@prob, # c(0.5, 0.5)
scale = exampleModels$WL_A@scale, # c(5, 1)
arcoef = rag)
set.seed(1234)
y <- mixAR_sim(model, n = 100, init = rep(0, 24))
mixSARfit(y, model)
## fix the intercepts to zero
mixSARfit(y, model, est_shift = FALSE, tol = 10e-4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.