MAmh: Metropolis--Hastings evaluation of the posterior associated with an MA(p) model
Description
This function implements a Metropolis--Hastings algorithm on the coefficients
of the MA(p) model, involving the simulation of the real and complex roots of
the model. The algorithm includes jumps between adjacent numbers of real and complex roots,
as well as random modifications for a given number of real and complex roots. It is thus
a special case of a reversible jump MCMC algorithm (Green, 1995).
Usage
MAmh(x, p = 1, W = 10^3)
Arguments
x
time series to be modelled as an MA(p) model
p
order of the MA(p) model
W
number of iterations
Value
psismatrix of simulated $\psi_i$'s
musvector of simulated $\mu$'s
sigsvector of simulated $\sigma^2$'s
llikvector of corresponding log-likelihood values (useful to check for convergence)
pcompvector of simulated numbers of complex roots
References
Green, P.J. (1995) Reversible jump MCMC computaton and Bayesian model choice.
Biometrika82, 711--732.