mixSARfit: Fit mixture autoregressive models with seasonal AR parameters

View source: R/mixSARfit.R

mixSARfitR Documentation

Fit mixture autoregressive models with seasonal AR parameters

Description

Provides estimation via EM-Algorithm for mixture autoregressive models including seasonal AR parameters.

Usage

mixSARfit(y, model, est_shift = FALSE, tol = 10^-14)

Arguments

y

a time series (currently a numeric vector).

model

an object of class "MixAR" including seasonal components.

est_shift

if missing or FALSE, fix the intercepts to zero, otherwise estimate them.

tol

threshold for stopping criterion.

Details

This function only works for "MixAR" objects in which slot arcoef is of class "raggedCoefS".

Value

A list of 2:

model

an object of class "MixAR". The estimated model.

vallogf

the value of the loglikelihood function for the returned model.

Author(s)

Davide Ravagli and Georgi N. Boshnakov

Examples

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)

mixAR documentation built on May 3, 2022, 5:08 p.m.