plotting cdf of a piece-wise continuous distribution
- To: mathgroup at smc.vnet.net
- Subject: [mg122547] plotting cdf of a piece-wise continuous distribution
- From: michael partensky <partensky at gmail.com>
- Date: Mon, 31 Oct 2011 06:53:39 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
Hi!
Please, consider an example:
pdf1[x_] := Piecewise[{{4/Sqrt[\[Pi]] x ^(1/2) Exp[- x]/2, x >= 0}, {0,
x < 0}}];
prob1 = ProbabilityDistribution[pdf1[x], {x, -\[Infinity], \[Infinity]}];
(* 1 *) Plot[Evaluate[PDF[prob1, x]], {x, -1, 5}, Filling -> Axis] (*
returns a nice plot *)
(* 2 *) Plot[Evaluate[CDF[prob1, x]], {x, -1, 6}] (* plot only x <0 *)
(* 3 *) Plot[Evaluate[CDF[prob1, x]], {x, 0, 5}, Filling -> Axis] (* plots
correctly *)
*Question*: Why does not (* 2 *) work?
Thanks
Michael