An algorithm, given by Deming and Stephan in 1940, that can be used to fit log-linear models to contingency tables. The algorithm matches marginal totals by using iterative scaling of a table whose entries are initially all equal to unity. Essentially the same algorithm allows one to revise sample margins to preserve known population values: depending on context this is known as the Cross–Fratar procedure, raking, or structure-preserving estimation (SPREE).