Gravity Model Calibration in R (Example)
Calibrating a gravity model for the first time is difficult. Â I stumbled upon a webpage from a professor at Ohio State that really helps. Â One thing I like to do is actually do the examples because I can ensure that my code works and it gives me some ideas.
The code to replicate Dr. Viton’s work is below.
Obviously this runs really quick, since it is only three zones. Â It is nice that R has some matrix tricks that help make it easy. Â One thing to note is that running this for a large matrix in R takes forever (at least the way this is written). Â It is possible to run it parallel across all processors, but it still takes forever.
Tags: distribution, R