Choose_pk {mixAR} | R Documentation |
Choose the autoregressive order of MixAR components
Description
Reversible Jump MCMC algorithm to choose the optimal autoregressive order of each component of a mixture autoregressive model.
Usage
Choose_pk(y, model, fix_shift = FALSE, tau, pmax, method, par = NULL, nsim)
Arguments
y |
a time series. Currently a |
model |
an object inheriting from class |
fix_shift |
whether the shift/mean parameter should be kept fixed to its
starting value or not. Default is |
tau |
tuning parameters for Metropolis-Hastings algorithm in sampling AR coefficients. |
pmax |
the largest autoregressive order allowed for each component. |
method |
character vector of length 1. Method for calculating probability of
new AR order to be increased/decreased by 1 unit. Currently
available |
par |
|
nsim |
|
Value
out |
a dataframe with |
fix_shift |
the choice made for the shift/mean parameters. |
method |
the method used to increase/decrease AR orders. |
Note
Choose_pk
currenlty supports class "MixARGaussian"
only.
Author(s)
Davide Ravagli
References
Ravagli D, Boshnakov GN (2020). “Bayesian analysis of mixture autoregressive models covering the complete parameter space.” 2006.11041, https://arxiv.org/abs/2006.11041.
See Also
bx_dx
for more details on the method
Examples
model <- new("MixARGaussian",
prob = exampleModels$WL_At@prob, # c(0.5, 0.5)
scale = exampleModels$WL_At@scale, # c(1, 2)
arcoef = list(-0.5, 1) )
# note: arcoef != list(-0.5, 1.1) == exampleModels$WL_At@arcoef@a
set.seed(1234)
n <- 50 # 200
y <- mixAR_sim(model, n, rep(0, max(model@order)), nskip = 100)
nsim <- 25 # 100
pk_star <- Choose_pk(y, model, tau = c(.15, .25), pmax = 5, method = "NULL", nsim = nsim)