1
$\begingroup$

I'm trying to plot the region corresponding to the following code. The f[0,0,5] lines were just me testing the functions. When its plotted, the region only shows the first part of my region plot ($y\geq \frac{1-\beta}{1-\alpha}x$. The second part does not show up and I can not tell if that is due to an error in the code or simply it is too complicated for Mathematica to compute. Does the code look correct? enter image description here

f[alpha_,beta_,s2_]:= NSolve[{s2-p+beta(p-5alpha )==(G1[p-5 alpha])/(g1[p-5alpha]),0<=p<=10},p]
g1[p_]:= PDF[NormalDistribution[5,1],p]
G1[p_]:= CDF[NormalDistribution[5,1],p]
f[alpha_,beta_,s2_]:= Nsolve[{s2-p+beta(p-5alpha )==(G1[p-5 alpha])/(g1[p-5alpha]),0<=p<=10},p]
s2star=(1/2)(10+Sqrt[2Pi])
Manipulate[RegionPlot[{y >=((1-beta)/(1-alpha))x,x<=If[y>=s2star,f[alpha,beta,y]-alpha(f[alpha,beta,y]-beta(f[alpha,beta,y]-5alpha )+(G1[f[alpha,beta,y]-5alpha ])/(g1[f[alpha,beta,y]-5alpha ])),f[alpha,beta,y]-alpha(5-((g1[s2star])/G1[s2star]))]},
        {x, 0, 10}, {y, 0, 10}],{beta,-2,2,0.1},{alpha,-2,2,0.1}]
$\endgroup$
3
  • 1
    $\begingroup$ Post your code rather than a picture of it so that it can be copied and pasted into a notebook. $\endgroup$
    – Bob Hanlon
    Commented Feb 13, 2021 at 21:59
  • 1
    $\begingroup$ Just added the code $\endgroup$
    – Dmlawton
    Commented Feb 13, 2021 at 22:04
  • $\begingroup$ Noticed typo above: NSolve not Nsolve $\endgroup$
    – Dominic
    Commented Feb 14, 2021 at 14:40

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.