q1q2l(bug, sims, ymean, hmean = NULL, MU, COV, P = NULL)
data.frame
of simulated parameter values with column names labelled according to output from the R2OpenBUGS package.
data.frame
of mean values for $y$, the fitted mean process. Columns represent time and rows represent simulations.
data.frame
of mean values for $h$, the fitted volatility process. Columns represent time and rows represent simulations. This argument is not used.
data.frame
of model fits for each binary parameter, used in the simulation of equivalent parameters from a normalised density. Rows represent simulation number, and columns binary parameters. Only necessary for random variance shift models.
data.frame
with columns:
q1
and q2
.data.frame
with three columns. The first column returns q1(.), the second q2(.) and third l(.) for a given set of simulations. Will only operate for simulations from BUGS models with either constant variance, stochastic volatility or a random variance shift created in the tsbugs package. This function is intended to be run twice in order to obtain 1) q1(w1) and q2(w1) based on a unnormalised MCMC simulation (w1) and 2) q1(w2) and q2(w2) based on a simulations from a normalised density (w2). Values of q1
are based on posterior model densities calculated in either the dcvts
, dsvts
or drvts
. Values of q2
are based on densities of a multivariate normal distribution (using MU
and COV
in the dmvnorm
function of the mvtnorm
package) when the BUGS model (bug
) has a constant variance or stochastic volatility component. When BUGS model has a random variance shift component, the q2
density is estimated using the dmvnb
function.
The data.frame
outputs can be directly used as input into the bridge
function to obtain estimates of normalising constants.
Alan Genz, Frank Bretz, Tetsuhisa Miwa, Xuefei Mi, Friedrich Leisch, Fabian Scheipl, Torsten Hothorn (2012). mvtnorm: Multivariate Normal and t Distributions. R package version 0.9-9994. http://CRAN.R-project.org/package=mvtnorm
Meng, X.-L., & Wong, W. H. (1996). Simulating Ratios of Normalizing Constants via a Simple Identity: A Theoretical Exploration. Statistica Sinica, 6, 831-860.
dcvts
, dsvts
, drvts
, dmvnb
, dmvnorm
, bridge
## Not run:
# # demo example with constant variance models for differenced growth rate
# # of England and Wales population as used in Abel et. al. (2013)
# demo("cv_bma", "tsbridge")
# ## End(Not run)
Run the code above in your browser using DataLab