cond_loglik | R Documentation |
Compute the log-likelihood of a MixAR model for a univariate time series.
cond_loglik(model, x, index)
cond_loglikS(model, x, index)
model |
a MixAR model. |
x |
a time series or numeric vector. |
index |
a vector of integers giving the indices in |
cond_loglik
computes the conditional log-likelihood of a MixAR
model. Conditional here means conditional on the first p
values
being fixed, where p
is the maximum AR order of the components
of the model.
Argument index
can be used to compute the sum over a subset of
time points.
cond_loglikS
is a variant of cond_loglik
for the case
when the input model contains seasonal AR coefficients.
the log-likelihood, a numeric value
Georgi N. Boshnakov and Davide Ravagli
## data(ibmclose, package = "fma") # doesn't work with fma v2.4, using '::'
cond_loglik(exampleModels$WL_ibm, as.numeric(fma::ibmclose))
cond_loglik(exampleModels$WL_ibm_gen, as.numeric(fma::ibmclose))
data(lynx) # for 'lynx' data
sar <- new("raggedCoefS", a = list(c(1.1022, -0.2835), c(1.5279, -0.8871)),
as = list(c(0, 0), 0), s = 10)
## SMAR(2; 2, 2)(2, 1)_10
model_s10 <- new("MixARGaussian", prob = c(.3, .7), scale = c(.08, .202),
arcoef = sar, shift = c(.7,1))
cond_loglikS(model_s10, log(lynx))
cond_loglikS(model_s10, log(lynx), index = 45:114) # on reduced dataset
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.