We implement three different estimators of spatial econometric interaction models (Dargel 2021) that allow the user to estimate origin-destination flows with spatial autocorrelation.

By default the estimation will include spatial dependence in the dependent variable and the explanatory variables which leads to the spatial Durbin model (SDM) (Anselin 1988) . Moreover, the model includes an additional set of parameters for intra regional flows that start and end in the same geographic site (as proposed by LeSage and Pace (2009) ). Both default options can be deactivated via the flow_control argument, which gives fine grained control over the estimation.

spflow(
flow_formula,
sp_multi_network,
network_pair_id = id(sp_multi_network)[["network_pairs"]][[1]],
flow_control = spflow_control()
)

Arguments

flow_formula A formula specifying the spatial interaction model (for details see section Formula interface) A sp_multi_network() object that contains information on the origins, and the destinations and their neighborhood structure A character indicating the id of a sp_network_pair() (only relevant if the sp_multi_network() contains multiple sp_network_pair-objects: defaults to the of them) A list generated by spflow_control() that provides fine grained control over the estimation procedure

Value

An S4 class of type spflow_model-class()

Details

Our estimation procedures makes use of the matrix formulation introduced by LeSage and Pace (2008) and further developed by Dargel (2021) to reduce the computational effort and memory requirements. The estimation procedure can be adjusted through the estimation_method argument in spflow_control().

Maximum likelihood estimation (MLE)

Maximum likelihood estimation is the default estimation procedure. The matrix form estimation in the framework of this model was first developed by LeSage and Pace (2008) and then improved by Dargel (2021) .

Spatial two-stage least squares (S2SLS)

The S2SLS estimator is an adaptation of the one proposed by Kelejian and Prucha (1998) , to the case of origin-destination flows, with up to three neighborhood matrices Dargel (2021) . A similar estimation is done by Tamesue and Tsutsumi (2016) . The user can activate the S2SLS estimation via the flow_control argument using the input spflow_control(estimation_method = "s2sls").

Bayesian Markov Chain Monte Carlo (MCMC)

The MCMC estimator is based on the ideas of LeSage and Pace (2009) and incorporates the improvements proposed in Dargel (2021) . The estimation is based on a tuned Metropolis-Hastings sampler for the auto-regressive parameters, and for the remaining parameters it uses Gibbs sampling. The routine uses 5500 iterations of the sampling procedure and considers the first 2500 as burn-in period. The user can activate the S2SLS estimation via the flow_control argument using the input spflow_control(estimation_method = "mcmc").

Formula interface

The function offers a formula interface adapted to spatial interaction models, which has the following structure: Y ~ O_(X1) + D_(X2) + I_(X3) + G_(X4) This structure reflects the different data sources involved in such a model. On the left hand side there is the independent variable Y which corresponds to the vector of flows. On the right hand side we have all the explanatory variables. The functions O_(...) and D_(...) indicate which variables are used as characteristics of the origins and destinations respectively. Similarly, I_(...) indicates variables that should be used for the intra-regional parameters. Finally, G_(...) declares which variables describe origin-destination pairs, which most frequently will include a measure of distance.

All the declared variables must be available in the provided sp_multi_network() object, which gathers information on the origins and destinations (inside sp_network_nodes() objects), as well as the information on the origin-destination pairs (inside a sp_network_pair() object).

Using the short notation Y ~ . is possible and will be interpreted as usual, in the sense that we use all variables that are available for each data source. Also mixed formulas, such as Y ~ . + G_(log(X4) + 1), are possible. When the dot shortcut is combined with explicit declaration, it will only be used for the non declared data sources. The following examples illustrate this behaviour.

Formula interface (examples)

Consider the case where we have the flow vector Y and the distance vector DIST available as information on origin-destination pairs. In addition we have the explanatory variables X1, X2 and X3 which describe the regions that are at the same time origins and destinations of the flows.

For this example the four formulas below are equivalent and make use of all explanatory variables X1, X2 and X3 for origins, destinations and intra-regional observations.

• Y ~ .

• Y ~ . + G_(DIST)

• Y ~ X1 + X2 + X3 + G_(DIST)

• Y ~ D_(X1 + X2 + X3) + O_(X1 + X2 + X3) + I_(X1 + X2 + X3) + G_(DIST)

Now if we only want to use X1 for the intra-regional model we can do the following (again all four options below are equivalent).

• Y ~ . + I_(X1)

• Y ~ . + I_(X1) + G_(DIST)

• Y ~ X1 + X2 + X3 + I_(X1) + G_(DIST)

• Y ~ D_(X1 + X2 + X3) + O_(X1 + X2 + X3) + I_(X1) + G_(DIST)

This behaviour is easily combined with transformation of variables as the two equivalent options below illustrate.

• log(Y + 1) ~ sqrt(X1) + X2 + G_(log(DIST + 1))

References

Anselin L (1988). Spatial Econometrics: Methods and Models. Springer Netherlands.

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

Kelejian HH, Prucha IR (1998). “A Generalized Spatial Two-Stage Least Squares Procedure for Estimating a Spatial Autoregressive Model with Autoregressive Disturbances.” The Journal of Real Estate Finance and Economics, 99--121.

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

LeSage JP, Pace RK (2009). Introduction to Spatial Econometrics. CRC Press.

Tamesue K, Tsutsumi M (2016). “Dealing with Intraregional Flows in Spatial Econometric Gravity Models.” In Patuelli R, Arbia G (eds.), Spatial Econometric Interaction Modelling, chapter 6, 105--119. Springer International Publishing.

spflow_control() spflow_network_classes()

Examples


# Estimate flows between the states of Germany
spflow(flow_formula = y9 ~ . + G_(DISTANCE),
sp_multi_network = multi_net_usa_ge,
network_pair_id = "ge_ge")
#> --------------------------------------------------
#> Spatial interaction model estimated by: MLE
#> Autocorrelation structure: model_9 (SDM)
#> Observations: 256
#>
#> --------------------------------------------------
#> Coefficients:
#>                 est    sd  t.stat  p.value
#> rho_d          0.48  0.03   15.75     0.02
#> rho_o          0.36  0.03   10.59     0.03
#> rho_w         -0.25  0.04   -5.95     0.05
#> (Intercept)   10.00  1.92    5.21     0.06
#> (Intra)       11.32  3.07    3.69     0.08
#> DEST_X         0.94  0.06   14.97     0.02
#> DEST_X.lag1    0.62  0.11    5.80     0.05
#> ORIG_X        -0.78  0.04  -21.20     0.02
#> ORIG_X.lag1   -0.32  0.08   -3.93     0.08
#> INTRA_X        1.95  0.08   23.98     0.01
#> INTRA_X.lag1  -0.34  0.19   -1.76     0.16
#> DISTANCE      -2.80  0.34   -8.25     0.04
#>
#> --------------------------------------------------
#> R2_corr: 0.9927709
# Same as above with explicit declaration of variables...
# ... X is the only variable available
# ... it is used for origins, destination and intra-state flows
spflow(flow_formula = y9 ~ X + G_(DISTANCE),
sp_multi_network = multi_net_usa_ge,
network_pair_id = "ge_ge")
#> --------------------------------------------------
#> Spatial interaction model estimated by: MLE
#> Autocorrelation structure: model_9 (SDM)
#> Observations: 256
#>
#> --------------------------------------------------
#> Coefficients:
#>                 est    sd  t.stat  p.value
#> rho_d          0.48  0.03   15.75     0.02
#> rho_o          0.36  0.03   10.59     0.03
#> rho_w         -0.25  0.04   -5.95     0.05
#> (Intercept)   10.00  1.92    5.21     0.06
#> (Intra)       11.32  3.07    3.69     0.08
#> DEST_X         0.94  0.06   14.97     0.02
#> DEST_X.lag1    0.62  0.11    5.80     0.05
#> ORIG_X        -0.78  0.04  -21.20     0.02
#> ORIG_X.lag1   -0.32  0.08   -3.93     0.08
#> INTRA_X        1.95  0.08   23.98     0.01
#> INTRA_X.lag1  -0.34  0.19   -1.76     0.16
#> DISTANCE      -2.80  0.34   -8.25     0.04
#>
#> --------------------------------------------------
#> R2_corr: 0.9927709
# Same as above
spflow(flow_formula = y9 ~ O_(.) + D_(.) + I_(.) + G_(DISTANCE),
sp_multi_network = multi_net_usa_ge,
network_pair_id = "ge_ge")
#> --------------------------------------------------
#> Spatial interaction model estimated by: MLE
#> Autocorrelation structure: model_9 (SDM)
#> Observations: 256
#>
#> --------------------------------------------------
#> Coefficients:
#>                 est    sd  t.stat  p.value
#> rho_d          0.48  0.03   15.75     0.02
#> rho_o          0.36  0.03   10.59     0.03
#> rho_w         -0.25  0.04   -5.95     0.05
#> (Intercept)   10.00  1.92    5.21     0.06
#> (Intra)       11.32  3.07    3.69     0.08
#> DEST_X         0.94  0.06   14.97     0.02
#> DEST_X.lag1    0.62  0.11    5.80     0.05
#> ORIG_X        -0.78  0.04  -21.20     0.02
#> ORIG_X.lag1   -0.32  0.08   -3.93     0.08
#> INTRA_X        1.95  0.08   23.98     0.01
#> INTRA_X.lag1  -0.34  0.19   -1.76     0.16
#> DISTANCE      -2.80  0.34   -8.25     0.04
#>
#> --------------------------------------------------
#> R2_corr: 0.9927709
# Same as above
spflow(flow_formula = y9 ~ O_(X) + D_(X) + I_(X) + G_(DISTANCE),
sp_multi_network = multi_net_usa_ge,
network_pair_id = "ge_ge")
#> --------------------------------------------------
#> Spatial interaction model estimated by: MLE
#> Autocorrelation structure: model_9 (SDM)
#> Observations: 256
#>
#> --------------------------------------------------
#> Coefficients:
#>                 est    sd  t.stat  p.value
#> rho_d          0.48  0.03   15.75     0.02
#> rho_o          0.36  0.03   10.59     0.03
#> rho_w         -0.25  0.04   -5.95     0.05
#> (Intercept)   10.00  1.92    5.21     0.06
#> (Intra)       11.32  3.07    3.69     0.08
#> DEST_X         0.94  0.06   14.97     0.02
#> DEST_X.lag1    0.62  0.11    5.80     0.05
#> ORIG_X        -0.78  0.04  -21.20     0.02
#> ORIG_X.lag1   -0.32  0.08   -3.93     0.08
#> INTRA_X        1.95  0.08   23.98     0.01
#> INTRA_X.lag1  -0.34  0.19   -1.76     0.16
#> DISTANCE      -2.80  0.34   -8.25     0.04
#>
#> --------------------------------------------------
#> R2_corr: 0.9927709