bayesLife.mcmc | R Documentation |

MCMC simulation object `bayesLife.mcmc`

containing information about one MCMC chain. A set of such objects belonging to the same simulation together with a `bayesLife.mcmc.meta`

object constitute a `bayesLife.mcmc.set`

object.

An object `bayesLife.mcmc`

points to a place on disk (element `output.dir`

) where MCMC results from all iterations are stored. They can be retrieved to the memory using `get.e0.mcmc(...)`

.

The object is in standard cases not to be manipulated by itself, but rather as part of a `bayesLife.mcmc.set`

object.

A `bayesLife.mcmc`

object contains parameters of the Bayesian hierarchical model, more specifically, their initial values (all names with the suffix `.ini`

) and values from the last iteration. These are:

`Triangle/Triangle.ini, lambda/lambda.ini`

- world parameters, containing four values each. They correspond to model parameters `\Delta_1, \dots, \Delta_4`

and `\lambda_1, \dots \lambda_4`

, respectively.

`k/k.ini, z/z.ini, omega/omega.ini, lambda.k/lambda.k.ini,`

`lambda.z/lambda.z.ini`

- world parameters, containing one value each. They correspond to model parameters `k`

, `z`

, `\omega`

, `\lambda_k`

, and `\lambda_z`

, respectively.

`Triangle.c`

- country-specific parameter `\Delta^c_1, \dots, \Delta^c_4`

with four values for each country, i.e. an `4 \times C`

matrix where `C`

is the number of countries.

`k.c, z.c`

- country-specific parameters `k^c`

and `z^c`

(1d arrays of length `C`

).

Furthermore, the object contains components:

`iter` |
Total number of iterations the simulation was started with. |

`finished.iter` |
Number of iterations that were finished. Results from the last finished iteration are stored in the parameters above. |

`length` |
Length of the MCMC stored on disk. It differs from |

`thin` |
Thinning interval used when simulating the MCMCs. |

`id` |
Identifier of this chain. |

`output.dir` |
Subdirectory (relative to |

`traces` |
This is a placeholder for keeping whole parameter traces in the memory. If the processing operates in a low memory mode, it will be 0. It can be filled in using the function |

`traces.burnin` |
Burnin used to retrieve the traces, i.e. how many stored iterations are missing from the beginning in the |

`rng.state` |
State of the random number generator at the end of the last finished interation. |

`meta` |
Object of class |

Hana Sevcikova

`run.e0.mcmc`

, `get.e0.mcmc`

, `bayesLife.mcmc.set`

, `bayesLife.mcmc.meta`

```
sim.dir <- file.path(find.package("bayesLife"), "ex-data", "bayesLife.output")
# loads traces from one chain
m <- get.e0.mcmc(sim.dir, low.memory = FALSE, burnin = 40, chain.ids = 1)
# should have 20 rows, since 60 iterations in total minus 40 burnin
dim(e0.mcmc(m, 1)$traces)
summary(m)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.