Notes on Iterative Proportional Fitting
References
- http://www.geog.leeds.ac.uk/wpapers/99-3.pdf -- Paul Norman, Putting Iterative Proportional Fitting on the Researcher's Desk"
- Jessica Guo and Chandra Bhat, "Population Synthesis for Microsimulating Travel Behavior" -- Alan has a copy.
Based on the description in the Leeds paper above I implemented a quick version of IPF -- this is in sandbox/borning/ipf/
This just hardcodes the data in the python file, and just does a fixed number of iterations (just a quick demo rather than a realistic program).
The file ipf.py has a simple example of a 2x3 array. There are two possible sets of initial values (uncomment the other one if you want to experiment with it). The uncommented version in the repository has starting values close to what you get if you just multiply the marginals. The commented version is pretty different from the result of multiplying the marginals. Curiously, the commented version converges in 2 steps to the exact values you get by multiplying the marginals. Hmmm ...
The file ipf_census.py is the same code, but uses the census example in Table 1 in the Leeds paper. It converges to close to the values in the Leeds paper (not sure why it doesn't match exactly though).
