estimateMobilityNetwork {MoNAn}R Documentation

estimateMobilityNetwork

Description

The core function of the package in which the model for the analysis of mobility tables is estimated.

Usage

estimateMobilityNetwork(
  state,
  effects,
  algorithm,
  initialParameters = NULL,
  prevAns = NULL,
  parallel = FALSE,
  cpus = 1,
  verbose = FALSE,
  returnDeps = FALSE,
  fish = FALSE,
  saveAlg = TRUE,
  cache = NULL
)

estimateDistributionNetwork(
  state,
  effects,
  algorithm,
  initialParameters = NULL,
  prevAns = NULL,
  parallel = FALSE,
  cpus = 1,
  verbose = FALSE,
  returnDeps = FALSE,
  fish = FALSE,
  saveAlg = TRUE,
  cache = NULL
)

monan07(
  state,
  effects,
  algorithm,
  initialParameters = NULL,
  prevAns = NULL,
  parallel = FALSE,
  cpus = 1,
  verbose = FALSE,
  returnDeps = FALSE,
  fish = FALSE,
  saveAlg = TRUE,
  cache = NULL
)

monanEstimate(
  state,
  effects,
  algorithm,
  initialParameters = NULL,
  prevAns = NULL,
  parallel = FALSE,
  cpus = 1,
  verbose = FALSE,
  returnDeps = FALSE,
  fish = FALSE,
  saveAlg = TRUE,
  cache = NULL
)

## S3 method for class 'result.monan'
print(x, covMat = FALSE, ...)

Arguments

state

An object of class "processState.monan" which contains all relevant information about the outcome in the form of an edgelist, the nodesets, and covariates.

effects

An object of class "effectsList.monan" that specifies the model.

algorithm

An object of class "algorithm.monan" which specifies the algorithm used in the estimation.

initialParameters

Starting values for the parameters. Using starting values, e.g., from a multinomial logit model (see getMultinomialStatistics()) increases the chances of model convergence in the first run of the estimation considerably.

prevAns

If a previous estimation did not yield satisfactory convergence, the outcome object of that estimation should be specified here to provide new starting values for the estimation.

parallel

Logical: computation on multiple cores?

cpus

Number of cores for computation in case parallel = TRUE.

verbose

Logical: display information about estimation progress in the console?

returnDeps

Logical: should the simulated values of Phase 3 be stored and returned? This is necessary to run GoF tests. Note that this might result in very large objects.

fish

Logical: display a fish?

saveAlg

Specify whether the algorithm object should be saved in the results object. Defaults to FALSE.

cache

Outdated parameter, no need to specify.

x

An object of class "result.monan".

covMat

Logical: indicating whether the covariance matrix should be printed.

...

For internal use only.

Value

The function estimateMobilityNetwork returns an object of class "result.monan" that contains the estimates, standard errors, and convergence statistics. Furthermore, the covariance matrix used to calculate the standard errors is included, which also shows collinearity between effects. In case returnDeps = TRUE, the simulations of Phase 3 are included, too.

The function print.result.monan prints the results from a monan estimation with three columns indicating the estimate, the standard error, and the convergence statistic.

See Also

createProcessState(), createEffectsObject(), createAlgorithm()

Examples


# estimate mobility network model

myAlg_short <- createAlgorithm(myState, myEffects, multinomialProposal = FALSE,
                               nsubN2 = 1, iterationsN3 = 100)

myResDN <- estimateMobilityNetwork(myState, myEffects, myAlg_short,
                                   initialParameters = NULL,
                                   # in case a pseudo-likelihood estimation was run, replace with
                                   # initialParameters = initEst,
                                   parallel = TRUE, cpus = 4,
                                   verbose = TRUE,
                                   returnDeps = TRUE,
                                   fish = FALSE
)

# check convergence
max(abs(myResDN$convergenceStatistics))

# view results
myResDN

myResDN

[Package MoNAn version 1.0.0 Index]