Description Usage Arguments Value
View source: R/bd_do_inference.R
Do Demographic Bayesian Inference
This is the core function that implements the Bayesian inference.
The input is a problem statement object (a list), prob, that consists of the input data (the vectors phi_m and sig_m) and the hyperparameters (hp). stan is called via the rstan package to sample from the posterior. The output is the variable soln of class bayDem_soln, which is a list with the fields prob (the input) and fit (the result of the stan fit). prob can also have an optional field control that specifies the following control parameters for the Bayesian inference (default in parentheses): numChains – (4) Number of chains sampsPerChain – (2000) Number of samples per chain initList – The initializations for each chain. The default is to sample from prior using hyperparameters adaptDelta – (.99) The value of the adapt_delta parameter, an input to stan. The stan default is 0.8, but a higher value is sensible for a mixture model with more than a few parameters, hence use 0.99 by default
1 | bd_do_inference(prob, calibDf, saveFile = NA)
|
prob |
List with the fields |
calibDf |
A dataframe with radiocarbon calibration curve information |
soln, a list with three fields: prob (the input), fit (the result of the call to stan), and control (the control parameters used)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.