Message Boards Message Boards

0
|
4720 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Help with Solve

Posted 10 years ago

I have to calculate a threshold value for a probability, lambda*. My code for the simplified version is working but it breaks down for the more complex version.

Here are defined probabilities and the working calculation for one alternative

    r = \[Epsilon]*\[Lambda] + (1 - \[Eta])*(1 - \[Lambda]);
    s = \[Eta]*(1 - \[Lambda]) + (1 - \[Epsilon])*\[Lambda];
    \[Lambda][r] = (\[Epsilon]*\[Lambda])/(\[Epsilon]*\[Lambda] + (1 - \[Eta])*(1 -\[Lambda]));
    \[Lambda][s] = (\[Eta]*(1 - \[Lambda]))/(\[Eta]*(1 - \[Lambda]) + (1 -    \[Epsilon])*\[Lambda]);
    Simplify[r*(y - m - c + \[Alpha]*\[Lambda][r]) +     s*(y - m + \[Alpha]*(1 - \[Lambda][s])) == 
    y + \[Alpha]*(1 - \[Lambda])];
    Solve[r*(y - m - c + \[Alpha]*\[Lambda][r]) +    s*(y - m + Subscript[\[Alpha], i]*(1 - \[Lambda][s])) == 
    y + \[Alpha]*(1 - \[Lambda]), {\[Lambda]}]

It does not work for two alternatives (1,2):

 \[Mu] = 1 - c1 - c2;
    \[Xi] = c1 - y;
    \[Beta] = 1 - c1;
    \[Gamma] = c1 - y;
    (*Further probabilities *)
    r1 = \[Epsilon]1*\[Lambda]1 + (1 - \[Eta]1)*(1 - \[Lambda]1);
    r2 = \[Epsilon]2*\[Lambda]2 + (1 - \[Eta]2)*(1 - \[Lambda]2);
    n1 = \[Eta]1*(1 - \[Lambda]1) + (1 - \[Epsilon]1)*\[Lambda]1;
    n2 = \[Eta]2*(1 - \[Lambda]2) + (1 - \[Epsilon]2)*\[Lambda]2;
    \[Lambda][r1] = (\[Epsilon]1*\[Lambda]1)/(\[Epsilon]1*\[Lambda]1 + (1 - \
    \[Eta]1)*(1 - \[Lambda]1));
    \[Lambda][r2] = (\[Epsilon]2*\[Lambda]2)/(\[Epsilon]2*\[Lambda]2 + (1 - \
    \[Eta]2)*(1 - \[Lambda]2));
    \[Lambda][s1] = (\[Eta]1*(1 - \[Lambda]1))/(\[Eta]1*(1 - \[Lambda]1) + (1 - \
    \[Epsilon]1)*\[Lambda]1);
    \[Lambda][s2] = (\[Eta]2*(1 - \[Lambda]2))/(\[Eta]2*(1 - \[Lambda]2) + (1 - \
    \[Epsilon]2)*\[Lambda]2);
    (* Expected Payoff *)
    EMS1 = \[Mu]*\[Xi]*(\[Lambda]2*\[Alpha]2 + (1 - \[Lambda]1) \[Alpha]1 \
    - c2 + y) + \[Mu]*(1 - \[Xi])*(\[Lambda]1*\[Alpha]1 + \[Lambda]2*\
    \[Alpha]2) + (1 - \[Mu])*\[Xi]*(\[Lambda]1*\[Alpha]1 + (1 - \
    \[Lambda]2)*\[Alpha]2) + (1 - \[Mu])*(1 - \
    \[Xi])*(\[Lambda]1*\[Alpha]1 + \[Lambda]2*\[Alpha]2 + 2*c1 + c2 - y);
    (* Solving *)
    Simplify[r1*r2*EMS1 + r1*n2*(\[Alpha]1*\[Lambda][r1] - c1 +  \[Alpha]2*(1 -       \[Lambda]2[n2])) + n1*r2*(\[Alpha]2*\[Lambda][r2] - c2 +  \[Alpha]1*(1 - \[Lambda]1[n1])) + n1*n2*( \[Alpha]1*(1 - \[Lambda]1[n1]) + \[Alpha]2*(1 - \[Lambda]2[
       n2])) -  s1 - s2 ==  r1*(y^p - s1 - c1 + \[Alpha]1*\[Lambda][r1]) + n1*(y - s1 + \[Alpha]1*(1 - \[Lambda][
       n1])) + \[Alpha]2*(1 - \[Lambda]2)]
    Solve[  r1*r2*EMS1 + r1*n2*(\[Alpha]1*\[Lambda][r1] - c1 +  \[Alpha]2*(1 - \[Lambda]2[n2])) +  n1*r2*(\[Alpha]2*\[Lambda][r2] - c2 +  \[Alpha]1*(1 - \[Lambda]1[n1])) + n1*n2*( \[Alpha]1*(1 - \[Lambda]1[n1]) + \[Alpha]2*(1 - \[Lambda]2[n2])) -  s1 - s2 ==  r1*(y^p - s1 - c1 + \[Alpha]1*\[Lambda][r1]) +  n1*(y - s1 + \[Alpha]1*(1 - \[Lambda][
       n1])) + \[Alpha]2*(1 - \[Lambda]2), {\[Lambda]2}]
POSTED BY: Thomas Groll
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract