New in Wolfram
Mathematica
8: Nonparametric, Derived, and Formula Distributions
◄
previous
|
next
►
Core Algorithms
Apply Censoring to a Distribution
The PDF and CDF of
CensoredDistribution
have discontinuities at the endpoints of the censoring interval, giving the distribution a mixed continuous-discrete character.
In[1]:=
X
LeftCensored\[ScriptCapitalD] = CensoredDistribution[{5, \[Infinity]}, PoissonDistribution[7]]; RightCensored\[ScriptCapitalD] = CensoredDistribution[{-\[Infinity], 9}, PoissonDistribution[7]]; DoubleCensored\[ScriptCapitalD] = CensoredDistribution[{5, 9}, PoissonDistribution[7]]; g1 = Table[DiscretePlot[ Evaluate@{PDF[m, x], PDF[PoissonDistribution[7], x]}, {x, 0, 13}, ExtentSize -> 0.5], {m, {LeftCensored\[ScriptCapitalD], RightCensored\[ScriptCapitalD], DoubleCensored\[ScriptCapitalD]}}];
In[2]:=
X
LeftCensored\[ScriptCapitalD] = CensoredDistribution[{-1, \[Infinity]}, NormalDistribution[]]; RightCensored\[ScriptCapitalD] = CensoredDistribution[{-\[Infinity], 1}, NormalDistribution[]]; DoubleCensored\[ScriptCapitalD] = CensoredDistribution[{-1, 1}, NormalDistribution[]]; g2 = Table[Plot[{CDF[m, x], CDF[NormalDistribution[], x]}, {x, -3, 3}, Filling -> Axis, Exclusions -> None], {m, {LeftCensored\[ScriptCapitalD], RightCensored\[ScriptCapitalD], DoubleCensored\[ScriptCapitalD]}}];
In[3]:=
X
Framed[GraphicsGrid[{g1, g2}, ImageSize -> {550, 330}, Spacings -> {Automatic, 170}], RoundingRadius -> 10, FrameStyle -> GrayLevel@0.3, FrameMargins -> 10, Background -> Lighter[LightYellow, 0.7]]
Out[3]=