expfit {baorista}R Documentation

Estimate Exponential Growth rate from Aoristic data

Description

Fits an exponential growth model to ProbMat class objects.

Usage

expfit(
  x,
  niter = 1e+05,
  nburnin = 50000,
  thin = 10,
  nchains = 4,
  rPrior = "dnorm(mean=0,sd=0.05)",
  rSampler = NULL,
  parallel = FALSE,
  seeds = 1:4
)

Arguments

x

A ProbMat class object

niter

Number of MCMC iterations. Default is 500,000.

nburnin

Number of iterations discarded for burn-in. Default is 250,000.

thin

Thinning interval

nchains

Number of MCMC chains

rPrior

A string defining prior for the growth parameter r. Default is 'dnorm(mean=0,sd=0.05)'.

rSampler

A list containing settings for the MCMC sampler. Default is null and employs nimble's Default sampler (RW sampler).

parallel

Logical specifying whether the chains should be run in parallel or not.

seeds

Random seed for each chain. Default is 1:4.

Details

The function fits a discrete bounded exponential growth model on the observed data using MCMC as implemented by the nimble package. The Bayesian model consists of a single growth rate parameter (r), and users can define suitable priors using character strings for the argument rPrior (for details on how this should be specified please consult the nimble manual). The distribution parameters defined in rPrior is also used to generate initialisation values for the MCMC. Please note that the function returns posterior of the growth rate normalised by the resolution defined in the ProbMat class object. MCMC settings such as the choice the sampler, number of iterations, chains, etc can also be specified.

Value

A fittedExp class object containing the original ProbMat class object, posterior of the growth rate, along with its Gelman Rubin statistic and effective sample sizes.


[Package baorista version 0.2.0 Index]