Announcement

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

  • mle non parametric specification of EUT model

    Dear all,

    i have created the following program inspired by Harrsion G. (MLE with STATA) to estimate non parametric EUT.


    global cdf "normal"

    program ML_eut2

    *Speciy the arguments of this program
    args lnf LNmu_risk u_a1_ u_b2_ u_b3_ u_b4_

    *Declare the temporary variables to be used
    tempvar probB1 probB2 probB3 probB4 probB5 choice
    tempvar yB1risk yB2risk yB3risk yB4risk yB5risk yArisk euArisk euBrisk euDiffArisk euDiffBrisk mu_risk u_a1 u_b2 u_b3 u_b4 u_b1 u_b5


    quietly {

    * initialize horizon and payoffs
    generate int `choice' = $ML_y1
    generate double `probB1' = $ML_y2
    generate double `probB2' = $ML_y3
    generate double `probB3' = $ML_y4
    generate double `probB4' = $ML_y5
    generate double `probB5' = $ML_y6


    * Risk

    generate `mu_risk' = exp(`LNmu_risk')

    generate double `u_a1' = exp(`u_a1_')

    generate double `u_b1' = 0
    generate double `u_b2' = exp(`u_b2_')
    generate double `u_b3' = exp(`u_b3_')
    generate double `u_b4' = exp(`u_b4_')
    generate double `u_b5' = 1

    generate double `yB1risk' = `u_b1'
    generate double `yB2risk' = `u_b2'
    generate double `yB3risk' = `u_b3'
    generate double `yB4risk' = `u_b4'
    generate double `yB5risk' = `u_b5'

    generate double `yArisk' = `u_a1'

    generate double `euBrisk' = (((`probB1'*`yB1risk')+(`probB2'*`yB2risk')+(`prob B3'*`yB3risk') +(`probB4'*`yB4risk') +(`probB5'*`yB5risk'))/`mu_risk')
    generate double `euArisk' = ((`yArisk')/`mu_risk')

    generate double `euDiffBrisk' = (exp(`euBrisk') / (exp(`euArisk') + exp(`euBrisk')))
    generate double `euDiffArisk' = (exp(`euArisk') / (exp(`euArisk') + exp(`euBrisk')))


    replace `lnf' = (ln($cdf(`euDiffBrisk'))) if `$ML_y1'== 0
    replace `lnf' = (ln($cdf(`euDiffArisk'))) if `$ML_y1'== 1

    }

    end

    Despite passing all the test, i get the following message "could not calculate numerical derivatives -- discontinuous region with missing values encountered"

    Where I'm wrong? I have also tried different transformation for the utility parameter to be estiamte like generate double `u_a1' = 1/(1+exp(`u_a1_')), but nothing change.

    Any help?

    Best,

    RR

  • #2
    hi Ruggiero
    Two possible culprits
    1. you havent shown your "ml model lf" perhaps that is incorrectly specified, which may trigger the problem you describe. Are you specifying 5 parameters to be estimated in this step?
    2. Perhaps the model itself cannot be estimated, because it doesn't fit the data. You may want to have less noisy data, and see if the same error persis
    F

    Comment


    • #3
      the ml model is the following ml model lf ML_eut2 (u_a1: choice prize_b_1 prize_b_2 prize_b_3 prize_b_4 prize_b_5 prob_b_1 prob_b_2 prob_b_3 prob_b_4 prob_b_5 prize_a_1 =) (u_b2_ (u_b3_ (u_b4_ (LNmu_risk: ) , cluster(id) technique(nr) maximize

      I' have tried to estimate the ML giving a specification of the utility funcition (i.e., generate double `yB1risk' = (((`prizeB1')^ (1-`r_risk'))/(1-`r_risk')) ) and it works. I don't understand why without specifing any utility it does not converge.

      RR

      Comment


      • #4
        Here there is an error

        instead of
        Code:
        ml model lf ML_eut2 (u_a1: choice prize_b_1 prize_b_2 prize_b_3 prize_b_4 prize_b_5 prob_b_1 prob_b_2 prob_b_3 prob_b_4 prob_b_5 prize_a_1 =) (u_b2_: ) (u_b3_ :)  (u_b4_: ) (LNmu_risk: ) , cluster(id) technique(nr) maximize
        try this
        Code:
        ml model lf ML_eut2 (LNmu_risk: ) (u_a1: choice prize_b_1 prize_b_2 prize_b_3 prize_b_4 prize_b_5 prob_b_1 prob_b_2 prob_b_3 prob_b_4 prob_b_5 prize_a_1 =) (u_b2_: ) (u_b3_ :)  (u_b4_: )  , cluster(id) technique(nr) maximize
        This because your MLE uses this:
        Code:
        args lnf LNmu_risk u_a1_ u_b2_ u_b3_ u_b4_

        Comment

        Working...
        X