Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem in MLE estimation

    Hello everyone, I am estimating experimental data using MLE method. The data description is the following way as described below the experimental part as well as some other variables. This sample consists of 134 individuals. I am trying to estimate the risk aversion parameters but it is showing "could not calculate numerical derivatives -- discontinuous region with missing values encountered". I am also putting here the coding for the programs that I am using it. there are two different methods to be estimated but I am unable to do it. please let me know the actual problem of this estimation
    Choices Pl1 Pl2 Pr1 Pr2 Prize1 Prize2 Prize3 Prize4
    No. id choices prob1l prob2l prob1r prob2r prize0 prize1 prize2 prize3 age gender nof edu foA chld eduexp Fincm YoA part nor O_land R1_land R2_land Aincm livest debt1 debt2
    1 A 1 0.1 0.9 0.1 0.9 180 140 350 10 48 1 10 1 2 3 0.12 1.5 15 1 5 0.25 1.5 0 0.5 10 0.12 0.1
    A 1 0.2 0.8 0.2 0.8 180 140 350 10 48 1 10 1 2 3 0.12 1.5 15 1 5 0.25 1.5 0 0.5 10 0.12 0.1
    A 1 0.3 0.7 0.3 0.7 180 140 350 10 48 1 10 1 2 3 0.12 1.5 15 1 5 0.25 1.5 0 0.5 10 0.12 0.1
    A 1 0.4 0.6 0.4 0.6 180 140 350 10 48 1 10 1 2 3 0.12 1.5 15 1 5 0.25 1.5 0 0.5 10 0.12 0.1
    A 1 0.5 0.5 0.5 0.5 180 140 350 10 48 1 10 1 2 3 0.12 1.5 15 1 5 0.25 1.5 0 0.5 10 0.12 0.1
    A 0 0.6 0.4 0.6 0.4 180 140 350 10 48 1 10 1 2 3 0.12 1.5 15 1 5 0.25 1.5 0 0.5 10 0.12 0.1
    A 0 0.7 0.3 0.7 0.3 180 140 350 10 48 1 10 1 2 3 0.12 1.5 15 1 5 0.25 1.5 0 0.5 10 0.12 0.1
    A 0 0.8 0.2 0.8 0.2 180 140 350 10 48 1 10 1 2 3 0.12 1.5 15 1 5 0.25 1.5 0 0.5 10 0.12 0.1
    A 0 0.9 0.1 0.9 0.1 180 140 350 10 48 1 10 1 2 3 0.12 1.5 15 1 5 0.25 1.5 0 0.5 10 0.12 0.1
    A 0 1 0 1 0 180 140 350 10 48 1 10 1 2 3 0.12 1.5 15 1 5 0.25 1.5 0 0.5 10 0.12 0.1
    *define expected utility model on Holt Laury method

    *define program name
    program define HL_eu0

    *specify the argument of the program
    args lnf r

    *declare the temporary variables to be use in the model
    tempvar choices prob1l prob2l prob1r prob2r y1 y2 y3 y4 euL euR euDiff

    quietly{
    *initializing the ML data*/
    generate int `choices' = $ML_y1

    generate double `prob1l' = $ML_y2
    generate double `prob2l' = $ML_y3
    generate double `prob1r' = $ML_y4
    generate double `prob2r' = $ML_y5

    *define utility function*/
    gen double `y1' =(($ML_y6)^(1-`r'))/(1-`r')
    gen double `y2' =(($ML_y7)^(1-`r'))/(1-`r')
    gen double `y3' =(($ML_y8)^(1-`r'))/(1-`r')
    gen double `y4' =(($ML_y9)^(1-`r'))/(1-`r')

    * calculate EU of each lottery
    gen double `euL' = (`prob1l'*`y1')+(`prob2l'*`y2')
    gen double `euR' = (`prob1r'*`y3')+(`prob2r'*`y4')

    *get the Fechner index
    generate double `euDiff' = `euR' - `euL'

    *likelihood function*/
    replace `lnf' = ln(normal( `euDiff')) if $ML_y1==1
    replace `lnf' = ln(normal(-`euDiff')) if $ML_y1==0
    }
    end


    *define procpect theory considering Holt Laury experimental model

    *define program name
    program define HL_cpt0

    *specify the argument of the program
    args lnf alpha gamma

    *declare the temporary variables to be use in the model
    tempvar choices prob1l prob2l prob1r prob2r y1 y2 y3 y4 euL euR euDiff

    quietly {
    *define probability weighting*/
    gen double `tmp' = (($ML_y2^`gamma')+((1-$ML_y2)^`gamma'))
    replace `tmp' = `tmp'^(1/`gamma')
    generate double `prob1l' = ($ML_y2^`gamma')/`tmp'
    generate double `prob2l' = (1-$ML_y2^`gamma')/`tmp'

    replace `tmp' = (($ML_y3^`gamma')+((1-$ML_y3)^`gamma'))
    replace `tmp' = `tmp'^(1/`gamma')
    generate double `prob1r' = ($ML_y3^`gamma')/`tmp'
    generate double `prob2r' = ((1-$ML_y3)^(`gamma'))/`tmp'

    *define utility function*/
    generate double `y1' = ( $ML_y4)^(1-`alpha')/(1-`alpha') if $ML_y4>=0
    generate double `y2' = ( $ML_y5)^(1-`alpha')/(1-`alpha') if $ML_y5>=0
    generate double `y3' = ( $ML_y6)^(1-`alpha')/(1-`alpha') if $ML_y6>=0
    generate double `y4' = ( $ML_y5)^(1-`alpha')/(1-`alpha') if $ML_y5>=0

    *generate Expected Utility*/
    gen double `euL'=(`prob1l'*`y1')+(`prob2l'*`y2') if `y1'>=`y2'>=0
    gen double `euR'=(`prob1r'*`y3')+(1-`prob2r'*`y4') if `y3'=<0=<`y4'

    *get the Fechner index
    generate double `euDiff' = `euR' - `euL'

    *likelihood function*/
    replace `lnf' = ln(normal( `euDiff')) if $ML_y1==1
    replace `lnf' = ln(normal(-`euDiff')) if $ML_y1==0
    }
    end

    ml model lf HL_cpt0 (alpha: choices prob1l prob2l prob1r prob2r prize0 prize1 prize2 prize3= )(gamma: ), cluster(id) technique(nr) maximize
    ml display


    ml model lf HL_eu0 (r: choices prob1l prob2l prob1r prob2r prize0 prize1 prize2 prize3 =), vce (robust) technique(nr) maximize

Working...
X