logisticfit {baorista}R Documentation

Fits a Logistic growth model on Aoristic data

Description

Fits an exponential growth model to ProbMat class objects.

Usage

logisticfit(
  x,
  niter = 1e+05,
  nburnin = 50000,
  thin = 10,
  nchains = 4,
  rPrior = "dexp(rate=1/0.001)",
  mPrior = "dunif(min=1,max=z)",
  rSampler = NULL,
  mSampler = NULL,
  parallel = FALSE,
  seeds = 1:4
)

Arguments

x

A ProbMat class object

niter

Number of MCMC iterations. Default is 100,000.

nburnin

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

thin

Thinning interval

nchains

Number of MCMC chains

rPrior

A string defining prior for the growth parameter r. Default is 'dexp(1/0.01)'.

mPrior

A string defining prior for the point of maximum growth rate m. Default is 'dunif(1,z)', where 'z' is the number of time-blocks.

rSampler

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

mSampler

A list containing settings for the MCMC sampler for the parameter 'm'. 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 logistic growth model on the observed data using MCMC as implemented by the nimble package. The Bayesian model consists of two parameters, a growth rate (r) and a midpoint (m) defining the inflection point of the growth curve. Priors of the two parameters can be defined by the arguments rPrior and mPrior. In the latter case the object z is a placeholder for the number of blocks (e.g. the default 'dunif(1,z)' is a uniform across all blocks). Priors are defined by character strings following the syntax used by nimble. The distribution parameters defined in rPrior and mPrior are 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 fittedLogistic class object containing the original ProbMat class object, posteriors of the growth rate and midpoint and their MCMC diagnostics (i.e. Gelman Rubin statistic and effective sample sizes).


[Package baorista version 0.2.0 Index]