ARmh {bayess} | R Documentation |
Metropolis–Hastings evaluation of the posterior associated with an AR(p) model
Description
This function is associated with Chapter 6 on dynamic models. It implements a Metropolis–Hastings algorithm on the coefficients of the AR(p) model resorting to a simulation of the real and complex roots of the model. It includes jumps between adjacent numbers of real and complex roots, as well as random modifications for a given number of real and complex roots.
Usage
ARmh(x, p = 1, W = 10^3)
Arguments
x |
time series to be modelled as an AR(p) model |
p |
order of the AR(p) model |
W |
number of iterations |
Details
Even though Bayesian Essentials with R does not cover the reversible jump MCMC techniques due to Green (1995), which allows to explore spaces of different dimensions at once, this function relies on a simple form of reversible jump MCMC when moving from one number of complex roots to the next.
Value
psis |
matrix of simulated |
mus |
vector of simulated |
sigs |
vector of simulated |
llik |
vector of corresponding likelihood values (useful to check for convergence) |
pcomp |
vector of simulated numbers of complex roots |
References
Green, P.J. (1995) Reversible jump MCMC computaton and Bayesian model choice. Biometrika 82, 711–732.
See Also
Examples
data(Eurostoxx50)
x=Eurostoxx50[, 4]
resAR5=ARmh(x=x,p=5,W=50)
plot(resAR5$mus,type="l",col="steelblue4",xlab="Iterations",ylab=expression(mu))