Flow Associations and Spatial Autoregressive models

In the last few weeks I had the opportunity to attend the 2016 Scipy conference with several of my mentors and contributors to the PySAL project. In this time I also completed the the three types of spatial weights for flows: network-based weights, proximity based weights using contiguity of both origins and destinations, and lastly, distance based weights using a 4-dimensiona ldistance (origin x, origin y, destination x, destination y). These three types of weights can be used within the vector-based Moran's that was coded in previous weeks to explore spatial autocorrelation, as well as within a spatial autoregressive (lag) model. In the process of building the distance-based weights, I was also able to contribute some speed-ups to the general DistancBand class, which have been incorporated into the library. Specificially, the DistanceBand class now avoids looping during construction, and there is a build_sp boolean parameter that when set to false will provide speed-ups if ones is using a relatively large threshold (or no threshold) such that the distance matrix is more dense than sparse.

More recently, work has been focusing on developing a version of the spatial lag model where there is a spatial lag for the origins, destination and origins-destinations spatial relationships. It looks like it will be possible to extend the exisitng ml_lag.py script to estimate parameters, though the proper covariance matrix will be more involved. During last weeks meeting, my mentors and I discussed several apporaches to developing code to carry out the estimation of the covariance matrix, which is what I will continue to work on before pivoting to the final phase of the project where I will clean up the code and finish documentation.