Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: ML-Evaluator for modelling retirement decisions

From   Tibor Hanappi <>
To   "" <>
Subject   st: ML-Evaluator for modelling retirement decisions
Date   Wed, 4 Jan 2012 09:29:36 +0000

Im modelling retirement decisions based on an option value framework (Gruber and Wise, 2002). Up until now I have constructed a microsimulation model calculating the option value for each individual in each year. To make it short, the option value is a forward-looking variable that summarizes the future options (with regard to retirement) of an individual at a certain point in time.

Based on this approach I estimate a binary probit model with retirement in the current year as dependent variable and option value (OV), social
security wealth (SSW), age and some other variables as covariates.

However, since the option value is denoted in utility terms I have to assume some exogenous parameters of the utility function. There are basically
two parameters: GAMMA, which defines marginal utility of income, and ALPHA, which is a factor defining the utility gain through leisure in retirement (relative to work). Exogenous values taken from the literature would be: GAMMA=0.75 and ALPHA=1.36

As a next step I’m writing a maximum likelihood evaluator so that I can jointly estimate those two parameters together with the binary probit model. Since I wanted to keep it simple I’m using a gf0 evaluator. Also, I had to make sure that the two parameters stay whithin their ranges (0 to 1 for GAMMA and 1 to 2 for ALPHA), so I transform parameters b[1,5] (hp_alpha) and b[1,6] (hp_gamma) through the use of the normal cdf. Though my program passes ml check, it doesn’t converge. In fact, it seems to be unable to go on to the next iteration (#1) though it keeps on repeating every step in the program. Here is a reduced version of the code.

program ML_OPV
args todo b lnfj
tempvar alpha gamma
quietly gen double `alpha'=1+normal(`b'[1,5])
quietly gen double `gamma'=normal(`b'[1,6])
*display "ALPHA: " `alpha'
*display "GAMMA: " `gamma'
quietly {
forvalues j=2002(1)2012 {
      * Calculate Utility from Retirement based on `alpha' and `gamma'
      < CODE OMITTED >

      * Calculate Utility from Labour Income based on `gamma'
      < CODE OMITTED >

tempvar xb
gen double `xb' = `b'[1,1]*SSW + `b'[1,2]*OV + `b'[1,3]*gn_age +`b'[1,4]
replace `lnfj' = ln(normal(`xb')) if $ML_y1 == 1
replace `lnfj' = ln(normal(-1*`xb')) if $ML_y1 == 0

ml model gf0 ML_OPV (theta: GO = SSW OV gn_age) /hp_alpha /hp_gamma
ml init SSW=.000004 OV=-.0008 gn_age=.16 /hp_alpha=-.001 /hp_gamma=.5
ml max, technique(nr) trace showstep

I recognize that it might be quite hard to help me out from the distance, however, it would be greatly appreciated. Especially, I’m wondering whether my approach concerning ALPHA and GAMMA is valid or whether there is any easier way to do it.

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index