Abstract
This article develops improved calculation techniques for estimating the spatial econometric interaction model of LeSage and Pace (2008) by maximum likelihood (MLE), Bayesian Markov Chain Monte Carlo (MCMC) and spatial two-stage least-squares (S2SLS). The refined estimation methods derive the parameter estimates and their standard errors exclusively from moment matrices with low dimensions. For the computation of these moments, we exploit efficiency gains linked to a matrix formulation of the model, which we generalize to make more flexible use of the exogenous variables. To improve the MLE we restructure the Hessian matrix and the quadratic term in the likelihood function. We also derive a moment based formulation of the Bayesian MCMC estimator from the same likelihood restructuring. Finally, the S2SLS estimator presented in this article is the first one to exploit the efficiency gains of the matrix formulation and also solves the problem of collinearity among spatial instruments. Several benchmarks show that these moment based estimators scale very well to large samples and can be used to estimate models with 100 million flows in just a few minutes. In addition to the improved estimation methods, this article presents a new way to define a feasible parameter space for the spatial econometric interaction model, which allows to verify the models consistency with a minimal computational burden. All of these developments indicate that the spatial econometric extension of the traditional gravity model has become an increasingly mature alternative and should eventually be considered a standard modeling approach for origin-destination flows.
Similar content being viewed by others
Data Availability
The data is available in the R package spflow that is published on CRAN (https://cran.r-project.org/package=spflow).
Code Availability
Most of the software used for model estimation is contained in the spflow package. Additional code linked to the example application is available on request.
Notes
More information about the spflow package is available at https://lukece.github.io/spflow.
In fact, Kelejian and Robinson (1995) discuss a model with a single weight matrix and spatial autocorrelation in the error term. However, most of their considerations are also relevant to higher order SDM and LAG models, since they have a very similar expression of the variance-covariance matrix of the dependent variable.
It is probably possible to generalize the developments related to the definition of the feasible parameter space of model (6) to the case where W has large complex eigenvalues, but this enterprise is not the purpose of the present article. In fact, many neighborhood matrices considered in practice fulfill the requirement that none of its complex eigenvalues exceed \(\min (|\lambda _{max}(W)| , |\lambda _{min}(W)|)\) in magnitude. For example, when the neighborhood matrix is derived from contiguity or from distances it is similar to a symmetric matrix which implies that all its eigenvalues are real. Furthermore, when the neighborhood matrix W is row normalized its largest eigenvalue is real and equal to one, in which case we only have to verify that none of its complex eigenvalues exceeds \(\lambda _{min}(W)\) in magnitude.
Efficient algorithms that allow to extract the smallest or largest eigenvalues of large matrices are available in many software packages. Some examples are the https://www.mathworks.com/help/matlab/ref/eigs.html#description or the https://spectralib.org/ C++ library Spectra which offers an interface to the R software.
All benchmarks were run on a 2.20 GHz Intel Xeon Gold 5120 CPU without parallel execution.
The fitted values are calculated according to the in-sample trend signal (TS) predictor, whose statistical properties are described by Goulard et al. (2017).
The models were estimated on a laptop with 2.50 GHz Intel Core i5-7200U CPU.
References
Anderson J (2011) The gravity model. Annual Rev Econ 1:133–160
Anselin L (1988) Spatial econometrics: methods and models. Springer, Netherlands
Arbia G, Ghiringhelli C, Mira A (2019) Estimation of spatial econometric linear models with large datasets: How big can spatial Big Data be? In: Regional Science and Urban Economics, pp. 67–73
Badinger H, Egger P (2011) Estimation of higher-order spatial autoregressive cross-section models with heteroscedastic disturbances. Papers Reg Sci 1:213–235
Barry RP, Pace RK (1999) Monte Carlo estimates of the log determinant of large sparse matrices. Linear Alg Appl 1:41–54
Bivand R, Hauke J, Kossowski T (2013) Computing the jacobian in gaussian spatial autoregressive models: an illustrated comparison of available methods. Geograp Anal 2:150–179
Chun Y, Kim H, Kim C (2012) Modeling interregional commodity flows with incorporating network autocorrelation in spatial interaction models: an application of the US interstate commodity flows. Comput Environ Urb Syst 6:583–591
Curry L (1972) A spatial analysis of gravity flows. Reg Stud 2:131–147
Davidson R, MacKinnon JG (1993) Estimation and inference in econometrics. Oxford University Press, UK
Debarsy N, LeSage JP (2018) “Flexible dependence modeling using convex combinations of different types of connectivity structures”. In: Regional Science and Urban Economics, pp. 48–68
Debarsy N, LeSage JP (2020) Bayesian model averaging for spatial autoregressive models based on convex combinations of different types of connectivity matrices. J Bus Econ Stat 1–12
Elhorst JP (2010) Applied Spatial econometrics: raising the bar. Spat Econ Anal 1:9–28
Elhorst JP, Lacombe DJ, Piras G (2012) On model specification and parameter space definitions in higher order spatial econometric models. Reg Sci Urb Econ 1:211–220
Fischer MM, LeSage JP (2020) Network dependence in multi-indexed data on international trade flows. J Spat Econ 1:4
Goulard M, Laurent T, Thomas-Agnan C (2017) About predictions in spatial autoregressive models: optimal and almost optimal strategies. Spat Econ Anal 2–3:304.325
Hepple LW (1995) “Bayesian Techniques in Spatial and Network Econometrics: 2. Computational Methods and Algorithms”. In: Environment and Planning A: Economy and Space 4, pp. 615.644
Holloway G, Shankar B, Rahmanb S (2002) Bayesian spatial probit estimation: a primer and an application to HYV rice adoption. Agri Econ 3:383.402
Kelejian HH, Prucha IR (1998) “A Generalized Spatial Two-Stage Least Squares Procedure for Estimating a Spatial Autoregressive Model with Autoregressive Disturbances”. In: The Journal of Real Estate Finance and Economics 1, pp. 99.121
Kelejian HH, Prucha IR (2004) Estimation of simultaneous systems of spatially interrelated cross sectional equations. J Econ 1:27.50
Kelejian HH, Prucha IR (2010) Specification and estimation of spatial autoregressive models with autoregressive and heteroskedastic disturbances. J Econ 1:53.67
Kelejian HH, Robinson DP (1995) Spatial Correlation: A Suggested Alternative to the Autoregressive Model. In: ed. by L. Anselin and R. J. G. M. Florax. Springer, pp. 75.95
Kerkman K, Martens K, Meurs H (2017) A multilevel spatial interaction model of transit flows incorporating spatial and network autocorrelation. J Transp Geogr 155.166
Lee L-F (2002) Consistency and efficiency of least squares estimation for mixed regressive, spatial autoregressive models. Econ Theory 2:252.277
Lee L-F (2004) Asymptotic distributions of quasi-maximum likelihood estimators for spatial autoregressive models. Econometrica 6:1899.1925
Lee M-L, Pace RK (2005) “Spatial Distribution of Retail Sales”. In: The Journal of Real Estate Finance and Economics 1, pp. 53.69
LeSage JP (1997) Bayesian estimation of spatial autoregressive models. Int Reg Sci Rev 1–2:113.129
LeSage JP (2020) Fast MCMC estimation of multiple W-matrix spatial regression models and Metropolis. Hastings Monte Carlo log-marginal likelihoods. J Geog Syst 1:47.75
LeSage JP, Pace RK (2008) Spatial econometric modeling of origin-destination flows. J Reg Sci 5:941.967
LeSage JP, Pace RK (2009) Introduction to spatial econometrics. CRC Press, Florida
Margaretic P, Thomas-Agnan C, Doucet R (2017) Spatial dependence in (origin-destination) air passenger flows. Papers in Regional Science 2:357.380
Martin RJ (1992) Approximations to the determinant term in gaussian maximum likelihood estimation of some spatial models. Communications in statistics—theory and methods 1:189.205
Ord K (1975) Estimation methods for models of spatial interaction. J Am Stat Assoc 349:120.126
Oshan TM (2020) “The spatial structure debate in spatial interaction modeling: 50 years on”. In: Progress in Human Geography, p. 0309132520968134
Pace RK, LeSage JP (2004) Chebyshev approximation of log-determinants of spatial weight matrices. Comput Stat Data Anal 2:179.196
Porojan A (2001) Trade flows and spatial effects: the gravity model revisited. Open Econ Rev 3:265.280
Shao J (2003) Mathematical statistics. Springer, New York
Smirnov O, Anselin L (2009) An O(N) parallel method of computing the Log-Jacobian of the variable transformation for models with spatial interaction on a lattice. Comput Stat Data Anal 8:2980.2988
Tamesue K, Tsutsumi M (2016) “Dealing with Intraregional Flows in Spatial Econometric Gravity Models”. In: Spatial Econometric Interaction Modelling. Ed. by R. Patuelli and G. Arbia. Springer International Publishing. Chap. 6, pp. 105.119
Tiefelsdorf M (2003) Misspecifications in interaction model distance decay relations: a spatial structure effect. J Geograp Syst 1:25–50
Wilson AG (1967) A statistical theory of spatial distribution models. Transp Res 3:253–269
Young EC (1924) The movement of farm population. Cornell University Agricultural Experiment Station, Ithaca
Acknowledgements
I acknowledge funding from the French National Research Agency (ANR) under the Investments for the Future (Investissements d’Avenir) program, grant ANR-17-EURE-0010, from the French National Association of Research and Technology (ANRT) and from the market research agency BVA Group.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of interest
The authors declared that there is no conflict of interest.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Appendices
Appendix A Hessian matrix
This appendix develops the simplified analytical expression of the elements of the Hessian matrix that are presented in Sect. 4.2.2. These expressions are derived from the second order derivatives of the likelihood function given in (16). LeSage and Pace (2009) derive similar expressions for a spatial model of order one. Another treatment of the Hessian matrix for the spatial econometric models can be found in (Anselin 1988, ][see pages 74ff.), who provides many computation steps linked to derivatives of the spatial filter matrix that are similar to the ones shown below.
The following paragraphs show that the Hessian matrix of higher order spatial models, in particular the one of model (6), also admits very simple analytical solutions to most of its elements. Since the expression of the likelihood function is invariant by permutation of the terms \(\rho _oW_o\), \(\rho _dW_d\), \(\rho _wW_w\) many elements of the Hessian matrix are up to the indexes (o, d, w) identical. This property allows shorten the following argumentation, since we only have to develop the expressions related to \(\rho _d\), while the expressions related to \(\rho _d\) and \(\rho _w\) are inferred by exchanging the indexes.
1.1 Block \(H_{11}\)
The Hessian block \(H_{11}\) given is the second order derivative of the likelihood function with respect to \(\rho\)
where for \(j,k \in (d,o,w)\), \(V_{jk} = -{{\,\mathrm{tr}\,}}(W_jA^{-1}W_kA^{-1}) -\frac{1}{\sigma ^2}y'W_j'W_ky\). The steps below derive the expression of \(V_{dd}\), while all other elements can be found using the same arguments and only require to exchange the indexes.
1.2 Block \(H_{21}\)
The Hessian block \(H_{21}\) given in (20) corresponds to the cross derivative of the likelihood function which we differentiate first with respect to \(\theta = (\delta ' \sigma ^2)'\) and then with respect to \(\rho\)
where \(L = (W_dy \; W_oy \; W_wy)\). The equations below derive analytical expressions for the elements in the first column of above matrix.
The previously introduced permutation-invariance of the likelihood function then allows to apply the same steps to derive the other two columns. These expressions are simplified further using the multivariate formulation L of the spatial lags of the flow vector.
1.3 Block \(H_{22}\)
The Hessian block \(H_{22}\) given in (20) contains the second order derivatives of the likelihood function with respect to \(\theta\)
The above block has the same expression as the Hessian matrix of a non-spatial linear model, when we evaluate at the maximum likelihood estimators in (17), in particular \({\hat{\sigma }}^2(\rho ) = (Ay - Z\delta (\rho ))'(Ay - Z\delta (\rho ))N^{-1}\) and \({\hat{\delta }}(\rho ) = (Z'Z)^{-1}Z'Ay\).
Appendix B A matrix formulation of spatial instruments
This appendix shows how to derive the moments \(U'y\), \(U'L\) and \(U'U\) of Sect. 4.4.2 that are required to perform S2SLS estimation based on the matrix formulation of the spatial interaction model. The first subsection presents the ten blocks of the moment \(U'U\) that is linked to the empirical variance of the instrumental variables. The second subsection derives the moments \(U'y\) and \(U'L\), which are proportional to the empirical covariances of the instrumental variables with the original and lagged versions of the flow vector.
1.1 The variance moment \(U'U\)
The previously introduced groups of instrumental variables \(U = (U_{\alpha } U_{\alpha _I} U_\beta U_\gamma )\) allow to express the moment matrix \(U'U\) in terms of 16 blocks.
The following four paragraphs derive the diagonal blocks of above matrix. For the six off-diagonal blocks we will start with those in the first row and move from top to bottom and left to right. Since \(U'U\) is a symmetric matrix, we can focus on the upper triangle of the above matrix and infer all blocks on the lower triangle by symmetry.
1.1.1 Block 1 (\(\alpha ^2\))
The first block of the \(U'U\) moment contains only the inner product of intercept term \(U_{\alpha } = \iota _{{N}}\).
1.1.2 Block 2 (\(\alpha _I^2\))
The second diagonal block of the covariance moment \(U_{\alpha _I}'U_{\alpha _I} := U_{\alpha _I\alpha _I}\) contains the inner product of the instruments derived from intra-regional constant. All columns in \(U_{\alpha _I}\) are derived by applying \({{\,\mathrm{VEC}\,}}\)-operator to the matrices \(\mathrm {A}_i^H\), for \(i = 1, ..., 9\), which are defined below.
This structure allows to compute each element of \(U_{\alpha _I\alpha _I}\) as \(U_{\alpha _I\alpha _I,ij} = \iota _n'(\mathrm {A}_i^H \odot \mathrm {A}_i^U)\iota _n\), for \(i,j = 1,...,9\). Since the block is symmetric we only need to compute the elements on the upper triangle. We can further reduce the number of elements to compute if we exploit the following properties: For two square matrices A and B with compatible dimension, we have \(\iota _{{n}}'(A \odot B)\iota _{{n}}\) = \(\iota _{{n}}'(A' \odot B')\iota _{{n}} = \iota _{{n}}'(B \odot A)\iota _{{n}}\). In addition, if either A or B is symmetric we have \(\iota _{{n}}'(A \odot B)\iota _{{n}} = \iota _{{n}}'(A' \odot B)\iota _{{n}}\). Exploiting all symmetries of the problem we only need to compute 21 of the 81 elements that constitute the matrix \(U_{\alpha _I\alpha _I}\) for the case when W itself is not symmetric. When W is symmetric we have to define \(U_\alpha\) in terms of the five instruments \({{\,\mathrm{VEC}\,}}(W^m)\) for \(m=0,1,2,3,4\) since four of the nine vectors in \(\begin{pmatrix} VEC(\mathrm {A}_1^U)&...&VEC(\mathrm {A}_9^U) \end{pmatrix}\) would be redundant.
1.1.3 Block 3 (\(\beta ^2\))
The next diagonal block contains the inner product of the instruments derived from the site attributes \(U_{\beta } = ( \tilde{\tilde{X_d}} \; \tilde{\tilde{X_o}} \; \tilde{\tilde{X_I}} )\). We can exploit the structure of the three matrices \(\tilde{\tilde{X_r}} (r = d,o,I)\) to derive this moment block from matrix products of much the much smaller matrices \(\tilde{\tilde{DX}}, \tilde{\tilde{OX}}\) and \(\tilde{\tilde{DX}}\).
1.1.4 Block 4 (\(\gamma ^2\))
The last diagonal block contains inner product of the instruments derived from the pair attributes \(U_{\gamma } = ( {{\,\mathrm{VEC}\,}}(G) \; {{\,\mathrm{VEC}\,}}({\check{G}}) \; {{\,\mathrm{VEC}\,}}(\check{{\check{G}}}) )\), where \({\check{G}}= WGW'\) and \(\check{{\check{G}}}= W{\check{G}}W'\). This structure allows to express the moment block in terms of the Hadamard product. When the matrix G represents the geographic distance, it is usually symmetric, which implies that \({\check{G}}\) and \(\check{{\check{G}}}\) are also symmetric. In this case, we can exploit that for two symmetric matrices A and B with compatible dimensions, we only require the upper diagonal of both to compute \(\iota _n'(A \odot B)\iota _n\). This reduces the memory and computational requirements by about 50%, which may be worthwhile because this block is responsible for a major part of the computational burden of the S2SLS estimator.
1.1.5 Block 5 (\(\alpha \alpha _I\))
The fifth block of \(U'U\) is obtained as the inner product of the global constant \(U_{\alpha }\) and the instruments derived from the intra-regional constant \(U_{\alpha _I}\). Since all elements of \(U_{\alpha }\) are one, computing this inner product corresponds to summing the elements in each of the nine vectors in \(U_{\alpha _I}\). As W is assumed to be row-stochastic, we can directly conclude that the first five entries of \(U_{\alpha \alpha _I}\) are equal to n. The remaining four entries are computed from the vectors of column sums of \({W}\) and \({W^2}\).
1.1.6 Block 6 (\(\alpha \beta\))
Block six is computed from the constant \(U_{\alpha }\) and the instruments \(U_{\beta }\) that are derived from the site attributes. Computing the elements of this block only requires the scalar n and the column sums of the matrices \(\tilde{\tilde{DX}}, \tilde{\tilde{OX}}\) and \(\tilde{\tilde{IX}}\).
1.1.7 Block 7 (\(\alpha \gamma\))
This block contains the inner product of the constant \(U_{\alpha }\) with the instruments derived from the exogenous attributes of the origin-destination pairs \(U_{\gamma }\).
1.1.8 Block 8 (\(\alpha _I \beta\))
The eighth block of \(U'U\) relates to the empirical covariance between \(U_{\alpha _I}\) the instruments derived from the intra-regional constant and \(U_{\beta }\) the instruments derived from the site attributes. The structure of \(U_{\alpha _I}\) allows to express each of the nine rows of \(U_{\alpha _I}'U_{\beta } := U_{\alpha _I\beta }\) using \(\mathrm {A}_i^U\), for \(i = 1, ... , 9\), as defined in (47).
1.1.9 Block 9 (\(\alpha _I \gamma\))
This block is calculated as the inner product of the instruments derived from the intra-regional \(U_{\alpha _I}\) constant and those derived from the exogenous origin-destination pair attributes \(U_{\gamma }\). It is again possible to derive \(U_{\alpha _I}'U_{\gamma } := U_{\alpha _I\gamma }\) for all rows (\(i = 1,...,9\)) using the notations in (47).
We can reduce the computational burden of this block if we pay attention to symmetries that were already mentioned in the sections on the diagonal blocks \(U_{\alpha _I\alpha _I}\) and \(U_{\gamma \gamma }\).
1.1.10 Block 10 (\(\beta \gamma\))
The last block of the \(U'U\) moment matrix is computed as the inner product of \(U_{\beta }\) the instruments derived from the site attributes with \(U_{\gamma }\) the instruments derived from the pair attributes.
1.2 The covariance moments \(U'y_{\bullet }\)
To construct the moments \(U'y\) and \(U'L\) we use the notations \(Y^{(t)}\) and \(y^{(t)}\) that are defined in (8). The elements of the four moments \(U'y^{(t)}\), for \(t = 1,2,3,4\), represent the columns of \(U'y = U'y^{(1)}\) and \(U'L = (U'y^{(2)}U'y^{(3)}U'y^{(4)})\).
The elements of the above moments are derived below, where the elementwise notation for the nine entries of \(U_{\alpha _I}'y^{(t)}\) uses definition (47) of \(\mathrm {A}_i^U\), for \(i = 1, ... , 9\).
Appendix C Trace plots of the Bayesian MCMC estimates
Rights and permissions
About this article
Cite this article
Dargel, L. Revisiting estimation methods for spatial econometric interaction models. J Spat Econometrics 2, 10 (2021). https://doi.org/10.1007/s43071-021-00016-1
Received:
Accepted:
Published:
DOI: https://doi.org/10.1007/s43071-021-00016-1
Keywords
- Origin-destination flows
- Cross-sectional dependence
- Maximum likelihood
- Two-stage least-squares
- Bayesian Markov chain Monte Carlo