New in Wolfram
Mathematica
8: Probability and Statistics Solvers and Properties
◄
previous
|
next
►
Core Algorithms
Bivariate Continuous Distribution Functions
Compute and visualize multivariate continuous distribution functions.
In[1]:=
X
Clear[DistributionPlot3D]; DistributionPlot3D[dist_, {xmin_, xmax_}, {ymin_, ymax_}] := Module[{x, y, pdf, cdf, sf, hf}, {pdf, cdf, sf, hf} = {Plot3D[PDF[dist, {x, y}], {x, xmin, xmax}, {y, ymin, ymax}, PlotRange -> {0, Automatic}, PlotLabel -> "PDF", PlotStyle -> Lighter[ColorData[1, 1], .4], Filling -> Axis, FillingStyle -> Lighter[ColorData[1, 1], 0.4], MeshStyle -> GrayLevel[.8], MeshFunctions -> {#3 &}, Lighting -> "Neutral"], Plot3D[CDF[dist, {x, y}], {x, xmin, xmax}, {y, ymin, ymax}, PlotRange -> {0, 1}, PlotLabel -> "CDF", PlotStyle -> Lighter[ColorData[1, 2], 0.4], Filling -> Axis, FillingStyle -> Lighter[ColorData[1, 2], 0.4], MeshStyle -> GrayLevel[.8], MeshFunctions -> {#3 &}, Lighting -> "Neutral"], Plot3D[ SurvivalFunction[dist, {x, y}], {x, xmin, xmax}, {y, ymin, ymax}, PlotRange -> {0, 1}, PlotLabel -> "SF", PlotStyle -> Lighter[ColorData[1, 3], .2], Filling -> Axis, FillingStyle -> Lighter[ColorData[1, 3], .2], MeshStyle -> GrayLevel[1], MeshFunctions -> {#3 &}, Lighting -> "Neutral"], Plot3D[ HazardFunction[dist, {x, y}], {x, xmin, xmax}, {y, ymin, ymax}, PlotRange -> {0, Automatic}, PlotLabel -> "HF", PlotStyle -> Lighter[ColorData[1, 4], 0.4], Filling -> Axis, FillingStyle -> Lighter[ColorData[1, 4], 0.4], MeshStyle -> GrayLevel[1], MeshFunctions -> {#3 &}, Lighting -> "Neutral"]}; GraphicsGrid[{{pdf, cdf}, {sf, hf}}, ImageSize -> 500] ]; DistributionPlot3D[BinormalDistribution[1/2], {-3, 3}, {-3, 3}]
Out[1]=