Wolfram
Mathematica
8의 신기능: 새롭게 향상된 과학 및 정보 시각화 기능
◄
이전
|
다음
►
그래픽 및 시각화
단변량 이산 분포 함수의 시각화
DiscretePlot
을 사용하면 확률 질량 함수, 위험 함수, 누적 분포 함수, 생존 함수, 역 누적 분포 함수, 역 생존 함수 등의 일반적인 분포 함수를 가시화할 수 있습니다. 관례상 확률 질량 함수와 위험 함수는 이산 함수이며, 그 외의 함수는 구분 상수 함수입니다. 이산 성질과 연속적인 동작을 나타내기 위해
ExtentSize
및
ExtentMarkers
를 사용합니다.
In[1]:=
X
d = PoissonDistribution[5];
In[2]:=
X
pdf = DiscretePlot[PDF[d, k], {k, 0, 10}, ExtentSize -> 0.5, PlotLabel -> "PDF", PlotStyle -> ColorData[1, 1]];
In[3]:=
X
hf = DiscretePlot[HazardFunction[d, k], {k, 0, 10}, ExtentSize -> 0.5, PlotLabel -> "HF", PlotStyle -> ColorData[1, 2]];
In[4]:=
X
cdf = DiscretePlot[CDF[d, k], {k, 0, 10}, ExtentSize -> Right, ExtentMarkers -> {"Filled", "Empty"}, PlotLabel -> "CDF", PlotStyle -> ColorData[1, 3]];
In[5]:=
X
sf = DiscretePlot[SurvivalFunction[d, k], {k, 0, 10}, ExtentSize -> Right, ExtentMarkers -> {"Filled", "Empty"}, PlotLabel -> "SF", PlotStyle -> ColorData[1, 4]];
In[6]:=
X
icdf = DiscretePlot[InverseCDF[d, p], {p, CDF[d, Range[0, 10]]}, ExtentSize -> Right, ExtentMarkers -> {"Empty", "Filled"}, PlotLabel -> "Inverse CDF", PlotStyle -> ColorData[1, 5]];
In[7]:=
X
isf = DiscretePlot[ InverseSurvivalFunction[d, p], {p, CDF[d, Range[0, 10]]}, ExtentSize -> Right, ExtentMarkers -> {"Empty", "Filled"}, PlotLabel -> "Inverse SF", PlotStyle -> ColorData[1, 6]];
In[8]:=
X
Grid[{{pdf, hf}, {cdf, sf}, {icdf, isf}}]
Out[8]=