Choose_pk | R Documentation |
Reversible Jump MCMC algorithm to choose the optimal autoregressive order of each component of a mixture autoregressive model.
Choose_pk(y, model, fix_shift = FALSE, tau, pmax, method, par = NULL, nsim)
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 |
|
out |
a dataframe with |
fix_shift |
the choice made for the shift/mean parameters. |
method |
the method used to increase/decrease AR orders. |
Choose_pk
currenlty supports class "MixARGaussian"
only.
Davide Ravagli
ravagli2020bayesianmixAR
bx_dx
for more details on the method
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.