View source: R/estimate-functions.R
estimateCounts | R Documentation |
Infer the contents of a demographic array, and fit a model describing the array, using one or more noisy datasets.
estimateCounts(
model,
y,
exposure = NULL,
dataModels,
datasets,
concordances = list(),
jointUpdate = TRUE,
filename = NULL,
nBurnin = 1000,
nSim = 1000,
nChain = 4,
nThin = 1,
parallel = TRUE,
nCore = NULL,
outfile = NULL,
nUpdateMax = 50,
verbose = FALSE,
useC = TRUE
)
model |
An object of class |
y |
An object of class
|
exposure |
A |
dataModels |
A list of objects of class
|
datasets |
A named list of objects of class
|
concordances |
A named list of
|
jointUpdate |
If |
filename |
The name of a file where output is collected. |
nBurnin |
Number of iteration discarded before recording begins. |
nSim |
Number of iterations carried out during recording. |
nChain |
Number of independent chains to use. |
nThin |
Thinning interval. |
parallel |
Logical. If |
nCore |
The number of cores to use, when |
outfile |
Where to direct the ‘stdout’ and ‘stderr’ connection
output from the workers when parallel processing. Passed to function
|
nUpdateMax |
Maximum number of iterations completed before releasing memory. If running out of memory, setting a lower value than the default may help. |
verbose |
Logical. If |
useC |
Logical. If |
See the documentation for estimateModel
for details on
model output and on MCMC settings.
dataModels
is a list of specificiations for data models,
and datasets
is a named list of datasets. The response for each
data model must be the name of a dataset. See below for examples.
estimateModel
, estimateAccount
nat <- demdata::sim.admin.nat
health <- demdata::sim.admin.health
survey <- demdata::sim.admin.survey
nat <- Counts(nat, dimscales = c(year = "Points"))
health <- Counts(health, dimscales = c(year = "Points"))
survey <- Counts(survey)
y <- health + 10
model <- Model(y ~ Poisson(mean ~ age + sex + region,
useExpose = FALSE))
dataModels <- list(Model(nat ~ PoissonBinomial(prob = 0.98)),
Model(health ~ Poisson(mean ~ age)),
Model(survey ~ Binomial(mean ~ 1)))
datasets <- list(nat = nat, health = health, survey = survey)
filename <- tempfile()
## in a real example, nBurnin and nSim would be much larger
## Not run:
estimateCounts(model = model,
y = y,
dataModels = dataModels,
datasets = datasets,
filename = filename,
nBurnin = 50,
nSim = 50,
nThin = 2,
nChain = 2,
parallel = FALSE)
fetchSummary(filename)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.