multimodelClosedSCR {multimark} | R Documentation |
Multimodel inference for 'multimark' spatial population abundance models
Description
This function performs Bayesian multimodel inference for a set of 'multimark' spatial population abundance models using the reversible jump Markov chain Monte Carlo (RJMCMC) algorithm proposed by Barker & Link (2013).
Usage
multimodelClosedSCR(
modlist,
modprior = rep(1/length(modlist), length(modlist)),
monparms = "N",
miter = NULL,
mburnin = 0,
mthin = 1,
M1 = NULL,
pbetapropsd = 1,
sigpropmean = 0.8,
sigpropsd = 0.4,
printlog = FALSE
)
Arguments
modlist |
A list of individual model output lists returned by |
modprior |
Vector of length |
monparms |
Parameters to monitor. Only parameters common to all models can be monitored (e.g., " |
miter |
The number of RJMCMC iterations per chain. If |
mburnin |
Number of burn-in iterations ( |
mthin |
Thinning interval for monitored parameters. |
M1 |
Integer vector indicating the initial model for each chain, where |
pbetapropsd |
Scaler specifying the standard deviation of the Normal(0, pbetapropsd) proposal distribution for " |
sigpropmean |
Scaler specifying the mean of the inverse Gamma proposal distribution for |
sigpropsd |
Scaler specifying the standard deviation of the inverse Gamma proposal distribution for |
printlog |
Logical indicating whether to print the progress of chains and any errors to a log file in the working directory. Ignored when |
Details
Note that setting parms="all"
is required when fitting individual multimarkClosedSCR
or markClosedSCR
models to be included in modlist
.
Value
A list containing the following:
rjmcmc |
Reversible jump Markov chain Monte Carlo object of class |
pos.prob |
A list of calculated posterior model probabilities for each chain, including the overall posterior model probabilities across all chains. |
Author(s)
Brett T. McClintock
References
Barker, R. J. and Link. W. A. 2013. Bayesian multimodel inference by RJMCMC: a Gibbs sampling approach. The American Statistician 67: 150-156.
See Also
multimarkClosedSCR
, processdataSCR
Examples
# This example is excluded from testing to reduce package check time
# Example uses unrealistically low values for nchain, iter, and burnin
#Generate object of class "multimarkSCRsetup"
sim.data<-simdataClosedSCR()
Enc.Mat<-sim.data$Enc.Mat
trapCoords<-sim.data$spatialInputs$trapCoords
studyArea<-sim.data$spatialInputs$studyArea
setup<-processdataSCR(Enc.Mat,trapCoords,studyArea)
#Run single chain using the default model for simulated data. Note parms="all".
example.dot <- multimarkClosedSCR(mms=setup,parms="all",iter=1000,adapt=500,burnin=500)
#Run single chain for simulated data with behavior effects. Note parms="all".
example.c <- multimarkClosedSCR(mms=setup,mod.p=~c,parms="all",iter=1000,adapt=500,burnin=500)
#Perform RJMCMC using defaults
modlist <- list(mod1=example.dot,mod2=example.c)
example.M <- multimodelClosedSCR(modlist=modlist,monparms=c("N","D","sigma2_scr"))
#Posterior model probabilities
example.M$pos.prob
#multimodel posterior summary for abundance and density
summary(example.M$rjmcmc[,c("N","D")])