New in Wolfram
Mathematica
8: Probability and Statistics Solvers and Properties
◄
previous
|
next
►
Core Algorithms
Univariate Continuous Distribution Functions
Compute and visualize univariate continuous distribution functions.
In[1]:=
X
Clear[DistributionPlot]; DistributionPlot[dist_, {xmin_, xmax_}] := Module[{x, pdf, cdf, sf, hf}, {pdf, cdf, sf, hf} = { Plot[PDF[dist, x], {x, xmin, xmax}, PlotRange -> {0, Automatic}, PlotLabel -> "PDF", PlotStyle -> ColorData[1, 1], Filling -> Axis, FillingStyle -> Lighter[ColorData[1, 1], 0.7]], Plot[CDF[dist, x], {x, xmin, xmax}, PlotRange -> {0, 1}, PlotLabel -> "CDF", PlotStyle -> ColorData[1, 2], Filling -> Axis, FillingStyle -> Lighter[ColorData[1, 2], 0.7]], Plot[SurvivalFunction[dist, x], {x, xmin, xmax}, PlotRange -> {0, 1}, PlotLabel -> "SF", PlotStyle -> ColorData[1, 3], Filling -> Axis, FillingStyle -> Lighter[ColorData[1, 3], 0.7]], Plot[HazardFunction[dist, x], {x, xmin, xmax}, PlotRange -> {0, Automatic}, PlotLabel -> "HF", PlotStyle -> ColorData[1, 4], Filling -> Axis, FillingStyle -> Lighter[ColorData[1, 4], 0.7]] }; GraphicsGrid[{{pdf, cdf}, {sf, hf}}, ImageSize -> 500] ]; DistributionPlot[GompertzMakehamDistribution[1, 2], {0, 2}]
Out[1]=