get.tfr.parameter.traces {bayesTFR} | R Documentation |
Accessing MCMC Parameter Traces
Description
Functions for accessing traces of the MCMC parameters, either country-independent or country-specific. Functions get.tfr.parameter.traces
and get.tfr.parameter.traces.cs
access Phase II MCMCs; Functions get.tfr3.parameter.traces
and get.tfr3.parameter.traces.cs
access Phase III MCMCs.
Usage
get.tfr.parameter.traces(mcmc.list, par.names = tfr.parameter.names(),
burnin = 0, thinning.index = NULL, thin = NULL)
get.tfr.parameter.traces.cs(mcmc.list, country.obj,
par.names=tfr.parameter.names.cs(),
burnin=0, thinning.index=NULL, thin=NULL)
get.tfr3.parameter.traces(mcmc.list, par.names = tfr3.parameter.names(), ...)
get.tfr3.parameter.traces.cs(mcmc.list, country.obj,
par.names=tfr3.parameter.names.cs(), ...)
Arguments
mcmc.list |
List of |
country.obj |
Country object list (see |
par.names |
Names of country-independent parameters (in case of |
burnin |
Burnin indicating how many iterations should be removed from the beginning of each chain. |
thinning.index |
Index of the traces for thinning. If it is |
thin |
Alternative to |
... |
Arguments passed to underlying functions (i.e. to |
Value
All functions return a matrix with columns being the parameters and rows being the MCMC values, attached to one another in case of multiple chains. get.tfr.parameter.traces
and get.tfr3.parameter.traces
return country-independent parameters, get.tfr.parameter.traces.cs
and get.tfr3.parameter.traces.cs
return country-specific parameters.
Author(s)
Hana Sevcikova
See Also
coda.list.mcmc
for another way of retrieving parameter traces.
Examples
sim.dir <- file.path(find.package("bayesTFR"), "ex-data", "bayesTFR.output")
m <- get.tfr.mcmc(sim.dir)
tfr.values <- get.tfr.parameter.traces(m$mcmc.list, burnin=10, par.names="sigma0")
## Not run:
hist(tfr.values, main=colnames(tfr.values))
## End(Not run)
tfr.values.cs <- get.tfr.parameter.traces.cs(m$mcmc.list,
get.country.object("Canada", meta=m$meta),
burnin=10, par.names="Triangle_c4")
## Not run:
hist(tfr.values.cs, main=colnames(tfr.values.cs))
## End(Not run)