MAmh {bayess} | R Documentation |
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).
MAmh(x, p = 1, W = 10^3)
x |
time series to be modelled as an MA(p) model |
p |
order of the MA(p) model |
W |
number of iterations |
psis |
matrix of simulated ψ_i's |
mus |
vector of simulated μ's |
sigs |
vector of simulated σ^2's |
llik |
vector of corresponding log-likelihood values (useful to check for convergence) |
pcomp |
vector of simulated numbers of complex roots |
Green, P.J. (1995) Reversible jump MCMC computaton and Bayesian model choice. Biometrika 82, 711–732.
data(Eurostoxx50) x=Eurostoxx50[1:350, 5] resMA5=MAmh(x=x,p=5,W=50) plot(resMA5$mus,type="l",col="steelblue4",xlab="Iterations",ylab=expression(mu))