View source: R/updateeDNAoccModel.R
updateOccModel | R Documentation |
This function computes additional iterations of a Markov chain Monte Carlo algorithm that was used to fit a multi-scale occupancy model to a data set.
updateOccModel(fit, niter, niterInterval)
fit |
object of class occModel that contains data and previous state of the model's Markov chain |
niter |
no. iterations of MCMC algorithm |
niterInterval |
no. iterations for reporting progress of MCMC algorithm |
This function is used to update a multi-scale occupancy model fitted using occModel
. The model is fitted using Bayesian methods (specifically, a Markov chain Monte Carlo (MCMC) algorithm that is run for a finite number of iterations). Output from the MCMC algorithm is stored in the file "mc.csv" and can be summarized using functions plotTrace
, plotACF
, and posteriorSummary
.
A list (object of class occModel) containing the following objects:
total number of iterations MCMC algorithm was run
the value of each model parameter after the last iteration of the MCMC algorithm
M x J matrix of numbers of detections per sample
M x J matrix of numbers of replicates per sample
matrix of regressors associated with model parameter beta
array of regressors associated with model parameter alpha
array of regressors associated with model parameter delta
logical indicator of whether model parameter alpha contains M elements (that is, one element per site)
vector of names of regressors in X
vector of names of regressors in W
vector of names of regressors in V
where M = no. sites and J = maximum no. samples per site
occModel
, scaleData
data(gobyDetectionData)
detections = occData(gobyDetectionData, "site", "sample")
data(gobySurveyData)
gobySurveyData = scaleData(gobySurveyData) # center and scale numeric covariates
fit1 = occModel(formulaSite = ~ veg,
formulaSiteAndSample = ~ sal + twg,
formulaReplicate = ~ sal + fish,
detectionMats = detections,
siteData = gobySurveyData,
niter = 110,
niterInterval = 10,
siteColName = 'site',
)
# Update the Markov chain of the model specified in fit1
fit2 = updateOccModel(fit1, niter=50, niterInterval=10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.