estimateAccount: Estimate demographic account and models from multiple noisy...

View source: R/estimate-functions.R

estimateAccountR Documentation

Estimate demographic account and models from multiple noisy datasets.

Description

Infer the contents of a demographic account, and fit models describing series within the account, using multiple noisy datasets.

Usage

estimateAccount(
  account,
  systemModels,
  datasets,
  dataModels,
  concordances = list(),
  weights = list(),
  dominant = c("Female", "Male"),
  updateInitialPopn = TRUE,
  usePriorPopn = TRUE,
  probSmallUpdate = 0,
  scaleNoise = 0,
  filename = NULL,
  nBurnin = 1000,
  nSim = 1000,
  nChain = 4,
  nThin = 1,
  parallel = TRUE,
  nCore = NULL,
  outfile = NULL,
  nUpdateMax = 50,
  verbose = FALSE,
  useC = TRUE
)

Arguments

account

An object of class DemographicAccount, giving the initial values for the estimation of the account.

systemModels

A list of objects of class SpecModel specifying models for the demographic series.

datasets

A named list of objects of class Counts.

dataModels

A list of objects of class SpecModel specifying models for the datasets.

concordances

A named list of concordances, which are applied to the series in the account before they are supplied to the corresponding data model.

weights

A named list of Counts objects, providing weights for any Normal models among the system models.

dominant

Either "Female" (the default) or "Male". Determines which sex is used to generate exposures in the system model for births.

updateInitialPopn

If TRUE (the default) population counts in the first year of the account are inferred as part of the overall estimation process. If FALSE, the values supplied for the first year are treated as error-free and never updated.

usePriorPopn

Whether to take account of the prior model for population when inferring values for the account. Defaults to TRUE.

probSmallUpdate

Proportion of updates of components that are 'small', ie that only consist of exchanging values between two neighbouring Lexis triangles.

scaleNoise

Governs noise added to Metropolis-Hastings ratio. Should be non-zero only when trying to generate initial values. Currently experimental, and may change.

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 TRUE (the default), parallel processing is used.

nCore

The number of cores to use, when parallel is TRUE. If no value supplied, defaults to nChain.

outfile

Where to direct the ‘stdout’ and ‘stderr’ connection output from the workers when parallel processing. Passed to function [parallel]{makeCluster}.

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 TRUE (the default) a message is printed at the end of the calculations.

useC

Logical. If TRUE (the default), the calculations are done in C. Setting useC to FALSE may be useful for debugging.

Details

The problems with integer overflow can occur when dealing with large populations, eg China.

References

Bryant, J., Graham, P. Bayesian demographic accounts: Subnational population estimation using multiple datasources. 2013. Bayesian Analysis

See Also

estimateModel, estimateCounts


StatisticsNZ/demest documentation built on Nov. 2, 2023, 7:56 p.m.