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.

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") A character indicating the model number, indicating different spatial dependence structures (see documentation for details), should be one of paste0("model_", 1:9) A logical which activates the option to use a separate set of parameters for intra-regional flows (origin == destination) 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() A character indicating the name of one column in the node pair data. A character indicating how to define the limits of the parameter space. The only available option is c("approx"). A numeric indicating the order of the Taylor expansion used to approximate the value of the log-determinant term. A character which indicates the method for Hessian calculation 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. 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() A logical whether to perform a PCA to remove (linear) correlation from the instruments generated for the S2SLS estimator 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 (Dargel 2021) . A numeric indicating the number of iterations A numeric indicating the length of the burn in period 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 LeSage and Pace (2008) . The most general specification is "model_9", leading to the model $$y = \rho_dW_dy + \rho_o W_oy + \rho_wW_wy + Z\delta + \epsilon$$. 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 $$\rho_d, \rho_o, \rho_w$$ unconstrained Model 8 $$\rho_d, \rho_o, \rho_w$$ $$\rho_w = - \rho_d \rho_o$$ Model 7 $$\rho_d, \rho_o$$ $$\rho_w = 0$$ Model 6 $$\rho_{dow}$$ $$\rho_d = \rho_o = \rho_w$$ Model 5 $$\rho_{do}$$ $$\rho_d = \rho_o, \rho_w = 0$$ Model 4 $$\rho_w$$ $$\rho_d = \rho_o = 0$$ Model 3 $$\rho_o$$ $$\rho_d = \rho_w = 0$$ Model 2 $$\rho_d$$ $$\rho_o = \rho_w = 0$$ Model 1 none $$\rho_d = \rho_o = \rho_w = 0$$

## References

Dargel L (2021). “Revisiting Estimation Methods for Spatial Econometric Interaction Models.” Toulouse School of Economics.

LeSage JP, Pace RK (2008). “Spatial Econometric Modeling of Origin-Destination Flows.” Journal of Regional Science, 941--967.