Starting from:

$35

Problem Set I Solution

The file contains observations on unemploy-ment durations for 4772 men. Each line contains the variables for one observation. The first variable is the duration of an unemployment spell in days (DUR). The second variable is the censoring indicator, equal to one if the spell is censored and equal to zero otherwise (CENS). The third variable is age in years (AGE). The fourth variable is education in years (ED). The fifth variable is an indicator for ethnicity, equal to one if the person is white and zero otherwise (WHITE). The sixth variable is the local unemployment rate (LOCRAT) in percentage points. The third to the sixth variable are all measured at the start of the unemployment spell.










1. Suppose the hazard is constant:







h(y) = exp(λ).







What is the log likelihood function?




Show that the the value of the log likelihood function at λ = −4 is equal to -40735.2980.



Plot the log likelihood function between λ = −10 and λ = −4.



Calculate the first derivative of the log likelihood function.



What is the maximum likelihood estimate for λ. (Calculate analytically, and give the estimate.)



6. What is the value of the first derivative at λ = −4?


Imbens, Problem Set I, MGTECON640/ECON292 Fall ’18
2
7. Calculate the value of the derivative at −4 numerically as




∂λd
c




∂ L
(−4) =
L(−4 + c) − L(−4)
,
















for c = 10−3 = 0.001 and for c = 10−6 = 0.000001. How does this compare to the analytical derivative? What is the danger of choosing c too large? What is the danger of choosing c too small?




What is the second derivative?



What is the second derivative at λ = −4?



Use the analytic first derivative to calculate a numerical second derivative
∂λd
∂ L
c
∂ L




∂2L




(−4 + c) −
(−4)










(−4) =
∂ λ
∂ λ
,
2
























with c = 0.000001.




Next I want you to find the maximum likelihood estimate using the Newton-Raphson algorithm. Start at λ0 = −4, and update using the rule
λk+1
= λk − ∂λ2 (λk )!




∂2L











1

− ∂ L

· ∂ λ (λk ).






For k = 0, . . . , 20 report in a table: (i) λk , (ii) ∂∂ Lλ (λk ), (iii) ∂∂2λL2 (λk ), and (iv) (λk+1 −

ˆ ˆ




λ)/(λk − λ). (The last measures how fast the algorithm converges. We can calculate this here since we already have the analytical solution.)




Next I want you to compare this to the quadratic fit method. Start with values -10, -6, and -2. Each iteration report the three values used in the quadratic fit (λl , λm, and λh ), the new estimate λn and the relative distance to the maximum likelihood

ˆ
estimate compared to the relative distance one interation back, (λn,k+1 − λ)/(λn,k − λ),




Use fourteen iterations.
Imbens, Problem Set I, MGTECON640/ECON292 Fall ’18
3






Finally, use the golden section algorithm to find the solution. Use starting values −10 and −2. Report for each of twenty iterations the low and high value, λl and λh , and



the ratio of the difference between the average of the high and low value and the mle,




to the difference between the average of the high and low value one iteration back and




the mle, ((λh,k+1 + λl,k+1)/2
ˆ
ˆ
− λ)/((λh,k + λl,k )/2
− λ).

More products