bd_do_inference: Do Demographic Bayesian Inference This is the core function...

Description Usage Arguments Value

View source: R/bd_do_inference.R

Description

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

Usage

1
bd_do_inference(prob, calibDf, saveFile = NA)

Arguments

prob

List with the fields phi_m (vector of radiocarbon measurements as fraction modern), sig_m (vector of measurement errors for phi_m), and hp (list of hyperparameters). In addition, the field control is optional (see above).

calibDf

A dataframe with radiocarbon calibration curve information

Value

soln, a list with three fields: prob (the input), fit (the result of the call to stan), and control (the control parameters used)


MichaelHoltonPrice/BayDem documentation built on Sept. 12, 2019, 9:26 p.m.