by Fedor Iskhakov, ANU
Description: Nested loop MLE estimator. Combining Newton-Kantorovich iterations with gradient based likelihood maximization. Structural estimation of Rust bus engine replacement model.
Maximum likelihood estimator is applicable when the model yields a probability distribution for the observable data
MLE and MSM are two main estimation methods for dynamic economic models
Likelihood function is
$$ \mathcal{L}_n(\theta) = L(Z_n,\theta) = \prod_{i=1}^n L(z_i,\theta) $$Then we have the information matrix equality
$$ \begin{eqnarray} \hat{\mathcal{J}}_n(\theta_0) = - H(\ell_n(\theta_0)) &=& \sum_{i=1}^n \nabla\ell(z_i, \theta_0) \otimes \nabla\ell(z_i, \theta_0)^{T} \\ &=& \nabla\ell(Z_n, \theta_0) \otimes \nabla\ell(Z_n, \theta_0)^{T} \end{eqnarray} $$📖 E.K. Berndt, B.H. Hall, R.E. Hall and J.A. Hausman, 1974 “Estimation and inference in nonlinear structural models”
The only model in the course which satisfies the requirements for MLE.
See videos 28, 29 and 44 for the setup and the code base.
Once the fixed point is found, the policy function is given by the optimal choice probability $ P(d|x) $ which has the logit structure due to assumption EV:
$$ P(0|x) = \frac{\exp[ u(x,0) + \beta EV(x,0) ]}{\sum_{d\in \{0,1\}} \exp[u(x,d) + \beta EV(x,d)]} $$$$ P(0|x) = \frac{1}{1 + \exp[u(x,1) - u(x,0) + \beta EV(x,1) - \beta EV(x,0)]} $$Next: given the data on mileage ($ x $) and choices ($ d $), can form likelihood function $ L(x,d,\theta) $, and proceed with maximum likelihood estimation
Data $ (x_{i,t},d_{i,t}) $ where $ x_{i,t} $ is discretized mileage (bin indexes), and $ d_{i,t} $ is the observed choice at this mileage for each bus $ i $ in each month $ t $
Unconstrained optimiztion, but retires the computation of $ EV_{\theta} $ for each value of parameter $ \theta $
Outer loop = Hill-climbing algorithm
Inner loop = Fixed point algorithm
zurcher
class fully implements the inner loop (see video 44)Alternative implementation: ruspy
module Maximilian Blesch and the computational economics group at the University of Bonn
https://ruspy.readthedocs.io/en/latest/index.html https://github.com/OpenSourceEconomics/ruspy