This code reproduces the paper: 'Estimating primary demand for substitutable products from sales transaction data': https://www0.gsb.columbia.edu/mygsb/faculty/research/pubfiles/5397/PrimaryDemandEM-Rev3v4.pdf
The aim of the paper is to estimate substitute and lost demand when only sales and product availability data are observed. It is particularly interesting in cases of product stockouts and uses the EM algorithm for estimating primary demand.