dexpfit {baorista} | R Documentation |
Estimate Exponential Growth rate from Aoristic data
Description
Fits a double exponential growth model to ProbMat
class objects.
Usage
dexpfit(
x,
niter = 1e+05,
nburnin = 50000,
thin = 10,
nchains = 4,
r1Prior = "dnorm(mean=0,sd=0.05)",
r2Prior = "dnorm(mean=0,sd=0.05)",
etaPrior = "dunif(min=1,max=z)",
r1Sampler = NULL,
r2Sampler = NULL,
etaSampler = 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 |
r1Prior |
A string defining prior for the growth parameter r1. Default is 'dnorm(mean=0,sd=0.05)'. |
r2Prior |
A string defining prior for the growth parameter r2. Default is 'dnorm(mean=0,sd=0.05)'. |
etaPrior |
A string defining prior for the change point parameter eta. Default is 'dunif(1,z)', where 'z' is the number of time-blocks. |
r1Sampler |
A list containing settings for the MCMC sampler. Default is null and employs nimble's Default sampler (RW sampler). |
r2Sampler |
A list containing settings for the MCMC sampler. Default is null and employs nimble's Default sampler (RW sampler). |
etaSampler |
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 double exponential growth model on the observed data using MCMC as implemented by the nimble package. The Bayesian model consists of a two growth rate parameters (r1 and r2), with the change from r1 and r2 occurring at inferred point in time eta. Users can define suitable priors using character strings for the argument rPrior1
,rPrior2
, and cPrior
(for details on how this should be specified please consult the nimble manual). 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 fitteddoubleExp
class object containing the original ProbMat class object, posterior of the growth rate, along with its Gelman Rubin statistic and effective sample sizes.