Description Usage Arguments Value Author(s) References See Also Examples
View source: R/dataCount2jags.R
dataCount2jags
prepares the lek count dataset for model fit and
fitModelCount
fits the model.
1 2 3 4 5 6 7 8 9 10 11 12 | dataCount2jags(lek, period, nbobs, nbmales, gr, type, natun, year)
## S3 method for class 'caperpyData'
print(x, ...)
fitModelCount(dataList,
registeredModel=c("modelCountDetectBinREY",
"modelCountDetectBin",
"modelCountDetectBetaBinREY",
"modelCountDetectBinREYObs2"),
parameters, inits, n.chains=4,
n.iter=500000, thin=500)
|
lek |
a vector containing the lek label for each lek count in the dataset. Must be numbered from 1 to L (where L is the total number of leks). |
period |
a vector containing the period label for each lek count in the dataset. Must be numbered from 1 to P (where P is the total number of periods) |
nbobs |
a vector containing the number of observers for each lek count in the dataset. |
nbmales |
a vector containing the number of males counted for each lek count in the dataset. |
gr |
a vector containing the geographic region label for each lek count in the dataset. Must be numbered from 1 to 5. |
type |
a vector containing the type label for each lek count in the dataset. Must be numbered from 1 to 3 (1 = known active leks, 2 = known indeterminate leks, 3 = unknown leks). |
natun |
a vector containing the type label for each lek count in the dataset. Must be numbered from 1 to U (where U is the total number of natural units). |
year |
a vector containing the period label for each lek count in the dataset. Must be numbered from 1 to Y (where Y is the total number of years) |
dataList |
object of class |
registeredModel |
character string containing the name of a registered count model
(see |
parameters |
vector of character string containing name of parameters to monitor during MCMC iterations. Can be left unspecified. |
inits |
The starting values for the MCMC. Can be left unspecified. |
n.chains |
The number of MCMC chain to perform. |
n.iter |
The number of MCMC iterations to monitor. |
thin |
thinning intervals for monitors. |
x |
an object of class |
... |
additional arguments to be passed from and to other functions. |
dataCount2jags
returns an object of class "caperpyData"
fitModelCount
returns an object of class "mcmc.list"
,
returned by rjags
.
Clement Calenge clement.calenge@ofb.gouv.fr
Calenge C., Menoni E., Milhau B., Foulche K, Chiffard J., Marchandeau S. (in prep.). The participatory monitoring of the capercaillie in the French Pyrenees.
simulateModelCount
to simulate datasets with the model,
for residual and prediction analysis.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## We work on the dataset lekcounts
head(lekcounts)
## We prepare the dataset to fit the model with JAGS
dataList <- dataCount2jags(lekcounts$lek, lekcounts$period,
lekcounts$nbobs, lekcounts$nbmales,
lekcounts$gr, as.numeric(factor(lekcounts$type)),
lekcounts$natun, lekcounts$year)
dataList
## We then fit the model. WARNING!!! THIS COMMAND IS VERY SLOW AND
## CAN TAKE SEVERAL HOURS
## Not run:
coefModelCountDetectBinREY <- fitModelCount(dataList, "modelCountDetectBinREY")
## End(Not run)
## To save time for the user, we have stored the result of this
## command in the dataset coefModelCountDetectBinREY.
str(coefModelCountDetectBinREY)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.