Re: Creating/Solving a cumulative distribution function?
- To: mathgroup at smc.vnet.net
- Subject: [mg41798] Re: Creating/Solving a cumulative distribution function?
- From: bobhanlon at aol.com (Bob Hanlon)
- Date: Fri, 6 Jun 2003 09:50:31 -0400 (EDT)
- References: <bbmu3f$j4$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
g[x_]:=(2/Pi)*(1-Cos[4x]); gcdf[x_]:=Evaluate[Integrate[g[t],{t,0,x}]]; Plot[{g[x*Degree], gcdf[x*Degree]}, {x,0,90}]; {q=Random[],x /. FindRoot[gcdf[x*Degree]==q, {x,30, 60}]} However, I recommend that you work in radians rather than degrees. Bob Hanlon In article <bbmu3f$j4$1 at smc.vnet.net>, "Jonathan Greenberg" <greenberg at ucdavis.edu> wrote: << Subject: Creating/Solving a cumulative distribution function? From: "Jonathan Greenberg" <greenberg at ucdavis.edu> To: mathgroup at smc.vnet.net Date: Thu, 5 Jun 2003 08:13:35 +0000 (UTC) Hi there, I was hoping one of you could help me out with a CDF problem I'm having. I have a PDF: g[x_]:=(2/Pi)*(1-Cos[4x]) where x ranges from 0 Degree to 90 Degree I understand the basic idea of a CDF, that I can integrate from 0 to some arbitary value (y) between (0,90) to get the cumulative probability: gcdf[x_]:=Evaluate[Integrate[g[x],{x,0Degree,x}] I'd like to Solve for x, given: gcdf[x]==Random[Real,0,1] where 0Degree>=x>=90Degree Solve, NSolve and FindRoot don't appear to be working correctly -- can someone give me a hand solving this equation? >><BR><BR>