Download presentation
Presentation is loading. Please wait.
Published byAmie Fleming Modified over 6 years ago
1
Maximum Likelihood Estimation of Utility Functions Using Stata
Glenn W. Harrison† May 2008 Presenter: Hanyu Xia
2
MLE of Utility Functions using Stata
Estimating a CRRA Utility Function Extending the Economic Specification to Include Loss Aversion and Probability Weighting Adding Stochastic Errors Non-Parametric Estimation of the EUT Model Alternative Functional Forms for Utility Testing Non-Nested Models Mixture Models Maximum Simulated Likelihood We start with a standard Constant Relative Risk Aversion (CRRA) utility function and binary choice data over two lotteries, assuming expected utility theory (EUT). This step illustrates the basic economic and statistical logic, and introduces the core Stata syntax. We then consider an extension to consider loss aversion and probability weighting from Prospect Theory (PT)
3
Experiment design-Risk Averse
Harrison and Rustrom [2005] 2 lotteries with “low” and “high” payoff Group 1X10X: provided the opportunity to give up the earnings in return for a chance with payments scaled up by 10 Group 10X: given only the 10X task Test whether the responses in the 10X task are affected by the prior experience of having seen the 1 X
5
Estimating a CRRA Utility Function
Basic Stata Syntax
6
Estimating a standard CRRA Utility Function
program define ML_eut0 Version 9.0 args lnf r * specify the arguments of this program tempvar choice prob0l prob1l prob2l prob3l prob0r prob1r prob2r prob3r endow m0 m1 m2 m3 y0 y1 y2 y3 euL euR euDiff * declare the temporary variables to be used quietly { * please do not display all these steps on the screen, for every ML iteration!
7
Estimating a standard CRRA Utility Function
generate int `choice' = $ML_y1 * initialize the data generate double `prob0l' = $ML_y2 …… generate double `endow' = $ML_y14 replace `m0' = `endow'+`m0’ replace `m3' = `endow'+`m3’ generate double `y0' = `m0'^`r …… * evaluate the utility function generate double `y3' = `m3'^`r’ * construct the argument of the utility function
8
Estimating a standard CRRA Utility Function
generate double `euL' = (`prob0l'*`y0')+(`prob1l'*`y1')+(`prob2l'*`y2')+(`prob3l'*`y3’) * calculate EU of each lottery generate double `euR' = (`prob0r'*`y0')+(`prob1r'*`y1')+(`prob2r'*`y2')+(`prob3r'*`y3') generate double `euDiff' = `euR' - `euL’ * get the index replace `lnf' = ln(normal( `euDiff')) if `choice’==1 …… * evaluate the likelihood replace `lnf' = ln(normal(-`euDiff')) if `choice'==0 replace ll = `lnf’ } end * save the calculated likelihood in an external storage variable (for post-processing, explained later)
9
Output ml model lf ML_eut0 (r: Choices P0left P1left P2left P3left P0right P1right P2right P3right prize0 prize1 prize2 prize3 stake = ), cluster(id) technique(nr) maximize initial: log pseudolikelihood = alternative: log pseudolikelihood = rescale: log pseudolikelihood = Iteration 0: log pseudolikelihood = (not concave) Iteration 1: log pseudolikelihood = Iteration 2: log pseudolikelihood = Iteration 3: log pseudolikelihood = Iteration 4: log pseudolikelihood = The “ml model” part invokes the Stata maximum likelihood model specification routine The “cluster(id)” command at the end tells Stata to treat the residuals from the same person as potentially correlated. with the “, maximize” option at the end to tell Stata to actually proceed with the optimization,
10
Output ml display “_cons” line, which displays the maximum-likelihood estimate and it’s standard error. Thus we have estimated that r^ = This is the maximum likelihood CRRA coefficient in this case. This indicates that these subjects are risk averse.
11
Extending the Economic Specification to Include Loss Aversion and Probability Weighting
Utility Fuction Tversky and Kahneman [1992] Weighting Function Tversky and Kahneman [1992]
12
Estimating a SPT Utility Function
13
Output ml model lf MLkt0 (alpha: Choices P0left P1left P2left P3left P0right P1right P2right P3right prize0 prize1 prize2 prize3 = ) (beta: ) (lambda: ) (gamma: ), cluster(id) technique(nr) maximize
14
Thank you for your attention!
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.