spflow_control: Define details of the estimation procedure with the...

Description Usage Arguments Value Details References See Also Examples

View source: R/spflow-control.R

Description

This function creates a list to fine tune the estimation of a spatial interaction model with spflow(). The options allow to adjust the estimation method and give the user full control over the use of the explanatory variables. The user can also adjust the form of autocorrelation to be considered.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
spflow_control(
  estimation_method = "mle",
  model = "model_9",
  use_intra = TRUE,
  sdm_variables = "same",
  weight_variable = NULL,
  parameter_space = "approx",
  loglik_det_aprox_order = 10,
  mle_hessian_method = "mixed",
  mle_optim_limit = 100,
  twosls_instrumental_variables = "same",
  twosls_decorrelate_instruments = FALSE,
  twosls_reduce_pair_instruments = TRUE,
  mcmc_iterations = 5500,
  mcmc_burn_in = 2500,
  mcmc_resampling_limit = 100
)

Arguments

estimation_method

A character which indicates the estimation method, should be one of c("mle","s2sls","mcmc")

model

A character indicating the model number, indicating different spatial dependence structures (see documentation for details), should be one of paste0("model_", 1:9)

use_intra

A logical which activates the option to use a separate set of parameters for intra-regional flows (origin == destination)

sdm_variables

Either a formula or a character; the formula can be used to explicitly declare the variables in SDM specification, the character should be one of c("same", "all") which are short cuts for using all available variables or the same as used in the main formula provided to spflow()

weight_variable

A character indicating the name of one column in the node pair data.

parameter_space

A character indicating how to define the limits of the parameter space. The only available option is c("approx").

loglik_det_aprox_order

A numeric indicating the order of the Taylor expansion used to approximate the value of the log-determinant term.

mle_hessian_method

A character which indicates the method for Hessian calculation

mle_optim_limit

A numeric indicating the number of trials given to the optimizer of the likelihood function. A trial refers to a new initiation of the optimization procedure using different (random) starting values for the parameters. If the optimizer does not converge after the indicated number of trails an error will be thrown after this limit.

twosls_instrumental_variables

Either a formula or a character; the formula can be used to explicitly declare the variables that should be used as instruments during S2SLS estimation, the character should be one of c("same", "all") which are short cuts for using all available variables or the same as used in the main formula provided to spflow()

twosls_decorrelate_instruments

A logical whether to perform a PCA to remove (linear) correlation from the instruments generated for the S2SLS estimator

twosls_reduce_pair_instruments

A logical that indicates whether the number of instruments that are derived from pair attributes should be reduced or not. The default is TRUE, because constructing these instruments is often the most demanding part of the estimation \insertCiteDargel2021spflow.

mcmc_iterations

A numeric indicating the number of iterations

mcmc_burn_in

A numeric indicating the length of the burn in period

mcmc_resampling_limit

A numeric indicating the maximal number of trials during rejection sampling of the autoregressive parameters

Value

A list of parameters used to control the model estimation with spflow()

Details

Adjusting the form of autocorrelation

The option model allows to declare one of nine different forms of autocorrelation that follow the naming convention of \insertCiteLeSage2008;textualspflow. The most general specification is "model_9", leading to the model y = ρ_dW_dy + ρ_o W_oy + ρ_wW_wy + Zδ + ε. All other models special cases of this one. The constraints that lead to the different sub models are summarized in this table.

Model Number Autocorrelation Parameters Constraints
Model 9 ρ_d, ρ_o, ρ_w unconstrained
Model 8 ρ_d, ρ_o, ρ_w ρ_w = - ρ_d ρ_o
Model 7 ρ_d, ρ_o ρ_w = 0
Model 6 ρ_{dow} ρ_d = ρ_o = ρ_w
Model 5 ρ_{do} ρ_d = ρ_o, ρ_w = 0
Model 4 ρ_w ρ_d = ρ_o = 0
Model 3 ρ_o ρ_d = ρ_w = 0
Model 2 ρ_d ρ_o = ρ_w = 0
Model 1 none ρ_d = ρ_o = ρ_w = 0

References

\insertAllCited

See Also

spflow()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# default is MLE estimation of the most comprehensive model
default_control <- spflow_control()

# change the estimation method
custom_control <- spflow_control(estimation_method = "mcmc")

# change the form of autocorrelation to be considered
custom_control <- spflow_control(model = "model_7")

# declare precisely which variables are to be used in the SDM form
custom_control <-
  spflow_control(sdm_variables = ~ O_(v1 + v2) + D_(v2 + v3) + I_(v1 + v4))

# deactivate the intra-regional coefficients and SDM variables
custom_control <- spflow_control(use_intra = FALSE, sdm_variables = "none")

spflow documentation built on Sept. 9, 2021, 5:06 p.m.