This repository contains MATLAB code for replicating the numerical results in Abbring and Salimans (2021). This covers the computation of the likelihood of the mixed hitting-time (MHT) model, maximum likelihood (ML) estimation of parametric versions of this model, and an application to the analysis of Kennan's (1985) strike data.
The results in Abbring and Salimans (2021) were obtained using v1.1.1 of this package, by running make
on a MacBook Pro (2018, 15inch, 2.9GHz 6-Core Intel Core i9, 32 GB 2400 MHz DDR4) with macOS 10.15.7, MATLAB R2020b (with Optimization Toolbox), and TeX Live 2018 (make.log logs this run). As specified in the makefile, this executes the MATLAB scripts
- figure1.m - replicates Figure 1
- figure2.m - replicates Figure 2
- figure3.m - replicates Figure 3
- table1.m - replicates Table 1 and estimates a version with gamma shocks
- table1lowM.m - recalculates Table 1 with M=15
- table1mig.m - recalculates Columns I-V of Table 1 using the exact likelihood for the Gaussian case
- figure4.m - replicates Figure 4
- checkgradient.m - checks analytic gradients against numerical ones
and then runs pdfTeX on replication.tex, which depends on csv
and tex
files outputted by MATLAB in the previous step, to display the resulting figures and tables in replication.pdf. As an extra check, the scripts for computing Figures 1-4 can be adapted, by changing dispplot=false
into dispplot=true
, to plot these figures directly.
The repository also contains a script
- simtest.m - simulates data and estimates the model on these data
Users can adapt these scripts to apply the procedures they call in other contexts. In particular, table1.m
shows how to use the package to estimate the MHT model with jumps.
The scripts require a range of MATLAB functions and a data set.
The procedures require parametric specifications <heter>
of the unobserved heterogeneity specification and <shocks>
of the jumps in the latent Lévy process. The calculation of the factors entering the summands in the approximations of the mixed survival function and probability density are coded up as functions <heter><shocks>
in files <heter><shocks>.m
:
- pointpoint.m - Discrete heterogeneity and discrete shocks at Poisson times
- pointgamma.m - Discrete heterogeneity and gamma shocks at Poisson times
- gammapoint.m - Gamma heterogeneity and discrete shocks at Poisson times
- gammagamma.m- Gamma heterogeneity and gamma shocks at Poisson times
Users can extend the set of specifications by adding different functions <heter><shocks>
.
- numinvlap.m - MHT pdf (of ln T, so t.f_T(t)) and cdf values (calculated by Laplace transform inversion) and their gradients with respect to the parameter vector
- numinvlap2.m - idem, but with input of design parameter
M
- igausscdf.m - inverse Gaussian cdf
- igausspdf.m - inverse Gaussian pdf
- weibullcdf.m - Weibull MPH cdf
- weibullpdf.m - Weibull MPH pdf
- mhtobj.m - minus the log likelihood of the MHT model (calculated by Laplace transform inversion) and its gradient with respect to the parameter vector
- mhtobj2.m - idem, but with input of design parameter
M
- mhtgrad.m - same as
mhtobj.m
, but only returning the gradient - mhtgrad2.m - same as
mhtobj2.m
, but only returning the gradient - lhmigauss.m - likelihood of the MHT model (calculated using explicit expressions for the Gaussian case)
- nllhmigauss.m - minus the log likelihood of the MHT model (calculated using explicit expressions for the Gaussian case) and its gradient with respect to the parameter vector
- nllhmph.m - minus the log likelihood of the Weibull MPH model and its gradient with respect to the parameter vector
- mhtmle.m - ML estimation of the general MHT model (based on Laplace inversion)
- mhtmle2.m - idem, but with input of design parameter
M
- migaussmle.m - ML estimation of the Gaussian special case
- randraw.m - efficient random number generator (by Alex Bar Guy and Alexander Podgaetsky)
- simmht.m - simulates durations from mixed hitting time model
- numgrad.m - calculation of gradient using finite (central) differences
- numjac.m - calculation of Jacobian using finite (central) differences (used to compute Hessian from gradient functions)
- strkdur.asc - Fixed format text file with Kennan's (1985) strike data (source: Cameron and Trivedi’s, 2005, data sets page).
- Abbring, Jaap H., and Tim Salimans (2021), “The likelihood of mixed hitting times”, Journal of Econometrics, 223, 361-375.
- . doi:10.1016/j.jeconom.2019.08.017. arXiv:1905.03463 [econ.EM].
- Cameron, A. Colin, and Pravin K. Trivedi (2005), Microeconometrics: Methods and Applications, Cambridge: Cambridge University Press.
- Kennan, John (1985), "The duration of contract strikes in U.S. manufacturing", Journal of Econometrics, 28, 5–28.
We welcome the use of this software under an MIT license.
© 2020 Jaap H. Abbring and Tim Salimans