e0.coda.mcmc.list: Convertion to coda's Objects

Description Usage Arguments Value Author(s) See Also Examples

Description

The functions convert MCMC traces (simulated using run.e0.mcmc) into objects that can be used with the coda package.

Usage

1
2
3
4
5
6
e0.coda.list.mcmc(mcmc.list = NULL, country = NULL, chain.ids = NULL, 
    sim.dir = file.path(getwd(), "bayesLife.output"), 
    par.names = NULL, par.names.cs = NULL, low.memory = FALSE, ...)
    
## S3 method for class 'bayesLife.mcmc'
coda.mcmc(mcmc, country = NULL, par.names = NULL, par.names.cs = NULL, ...)

Arguments

mcmc.list

List of bayesLife.mcmc objects, or an object of class bayesLife.mcmc.set or bayesLife.prediction. If it is NULL, the MCMCs are loaded from sim.dir. Either mcmc.list or sim.dir must be given.

mcmc

Object of class bayesLife.mcmc.

country

Country name or code. It is used in connection with the par.names.cs argument (see below).

chain.ids

Vector of chain identifiers. By default, all chains available in the mcmc.list object are included.

sim.dir

Directory with the MCMC simulation results. Only used if mcmc.list is NULL.

par.names

Names of country-independent parameters to be included.

par.names.cs

Names of country-specific parameters to be included. The argument country is used to filter out traces that correspond to a specific country. If country is not given, for each parameter, traces for all countries are included.

low.memory

Logical indicating if the function should run in a memory-efficient mode.

...

Additional arguments passed to the coda's mcmc function, such as burnin and thin.

Value

The function e0.coda.list.mcmc returns an object of class “mcmc.list”. The function coda.mcmc returns an object of class “mcmc”, both defined in the coda package.

Author(s)

Hana Sevcikova

See Also

e0.partraces.plot for plotting the MCMC traces and summary.bayesLife.mcmc.set.

Examples

1
2
3
sim.dir <- file.path(find.package("bayesLife"), "ex-data", "bayesLife.output")
coda.list <- e0.coda.list.mcmc(sim.dir = sim.dir, country = "France", burnin = 30)
summary(coda.list)

Example output

Loading required package: bayesTFR

Iterations = 31:60
Thinning interval = 1 
Number of chains = 1 
Sample size per chain = 30 

1. Empirical mean and standard deviation for each variable,
   plus standard error of the mean:

                      Mean       SD  Naive SE Time-series SE
Triangle_1        13.88415 0.355970 0.0649910      0.0879497
Triangle_2        36.88456 0.534465 0.0975795      0.0975795
Triangle_3         4.94208 0.448882 0.0819542      0.0822012
Triangle_4        22.26042 0.766625 0.1399660      0.2128078
k                  3.92515 0.116218 0.0212184      0.0385733
z                  0.63388 0.015159 0.0027676      0.0031035
lambda_1           0.04529 0.005708 0.0010422      0.0019238
lambda_2           0.02961 0.005381 0.0009824      0.0017655
lambda_3           0.05729 0.010879 0.0019862      0.0049697
lambda_4           0.01441 0.002766 0.0005050      0.0009202
lambda.k           0.71538 0.116953 0.0213525      0.0493475
lambda.z          25.12721 5.263903 0.9610527      2.3444870
omega              1.55942 0.030284 0.0055291      0.0040968
Triangle.c_1_c250 16.00254 4.147351 0.7571992      2.6123178
Triangle.c_2_c250 36.76225 2.894180 0.5284026      1.0139025
Triangle.c_3_c250  6.75113 3.690510 0.6737919      1.2050704
Triangle.c_4_c250 24.23176 4.479895 0.8179131      1.7626584
k.c_c250           3.27158 0.832721 0.1520334      0.3115243
z.c_c250           0.53108 0.117030 0.0213667      0.0424239

2. Quantiles for each variable:

                      2.5%      25%      50%      75%    97.5%
Triangle_1        13.21003 13.73756 13.84827 14.13828 14.43122
Triangle_2        35.94335 36.53868 36.89442 37.17755 37.95282
Triangle_3         4.19061  4.62149  4.85188  5.24671  5.83927
Triangle_4        20.87072 21.72349 22.25731 22.72818 23.69165
k                  3.69603  3.84248  3.92480  4.00369  4.11600
z                  0.60263  0.62470  0.63756  0.64620  0.65159
lambda_1           0.03630  0.04138  0.04485  0.04843  0.05758
lambda_2           0.02166  0.02554  0.02971  0.03277  0.04164
lambda_3           0.03979  0.04724  0.05877  0.06759  0.07187
lambda_4           0.01049  0.01258  0.01447  0.01546  0.02204
lambda.k           0.52757  0.63943  0.68968  0.79685  0.98418
lambda.z          17.99780 20.77272 24.68492 28.10930 36.89491
omega              1.50360  1.53810  1.56052  1.58131  1.60873
Triangle.c_1_c250 10.41029 12.74063 16.06111 17.85545 23.32795
Triangle.c_2_c250 32.50136 34.54734 36.89756 38.91193 41.18008
Triangle.c_3_c250  0.45638  4.42216  7.37143  8.86237 14.34091
Triangle.c_4_c250 15.85184 20.90804 23.90846 27.65357 31.03577
k.c_c250           2.27408  2.69082  3.08834  3.58897  5.20246
z.c_c250           0.29017  0.43780  0.57371  0.61991  0.64773

bayesLife documentation built on April 5, 2021, 5:06 p.m.