R, Julia and Python implementation of the fully endogenized finite mixture model used in forthcoming articles by Fuad and Farmer (202-) and Fuad, Farmer, and Abidemi (202-). Codes presented are for two submarkets that can be modified for more than two submarkets.
This model employs a finite mixture model to sort households into endogenously determined latent submarkets. The finite mixture model to predict home prices is:
The mixing model
We also define
Since the submarket identification (
The Expectation step – the E step – involves imputation of the expected value of
-
Generate starting values for
-
Initiate iteration counter for the E-step,
(initial at 0) -
Use
and from Step 2 to calculate provisional from -
Initiate second iteration counter,
, for the M-step -
Interim estimators of
are then used to impute new estimates of and with -
For each prescribed latent class, estimators of
are imputed, via M-step, as well as -
Increase
counter by 1, and repeat M-step until: prescribed constant; if yes, then -
Increase
counter and continue from Step 3 until: prescribed constant
This process is repeated until there is no change in the likelihood function:
The steps above, particularly from Step 3-8 do not necessarily occur sequentially as outlined above but occur simultaneously as the continual updating of estimators. Each
The modified hedonic regression is: