simulateAccount: Create a synthetic demographic account

View source: R/simulate-functions.R

simulateAccountR Documentation

Create a synthetic demographic account

Description

WARNING - THIS FUNCTION IS STILL UNDER DEVELOPMENT

Usage

simulateAccount(
  account,
  systemModels,
  datasets = list(),
  dataModels = list(),
  concordances = list(),
  weights = list(),
  dominant = c("Female", "Male"),
  usePriorPopn = TRUE,
  updateSystemModel = NULL,
  updateDataModel = NULL,
  updateInitialPopn = TRUE,
  probSmallUpdate = 0,
  scaleNoise = 0,
  filename = NULL,
  nBurnin = 1000,
  nSim = 1000,
  nChain = 4,
  nThin = 1,
  parallel = TRUE,
  nCore = NULL,
  outfile = NULL,
  nUpdateMax = 50,
  verbose = TRUE,
  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.

usePriorPopn

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

updateSystemModel

Names of any system models containing parameters that need to be estimated (as oppsed to simply drawn from the prior distribution) as part of the simulation.

updateDataModel

Names of any data models containing parameters that need to be estimated (as oppsed to simply drawn from the prior distribution) as part of the simulation.

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.

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.


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