2016-03-04 79 views
2

在@Risk和Crystal Ball中,允許我們使用百分位數據定義概率分佈。例如,我們可以通過輸入3個數據點來定義一個對數正態分佈,例如, P10,P50和P90估計。然後該軟件將與分發的PDF一起出來。這實際上是如何完成的?在Matlab,Excel或Mathematica中的例子會很好。使用百分點定義分佈

在文檔中,沒有清楚地說明軟件是如何做到的。

+1

感激,如果有人可以用Matlab時提供的工作流。我們可以按照下面的Mathematica解決方案進行計算嗎? – iFikr

回答

1

從以均值= 1和標準差= 0.5的正態分佈導出的對數正態分佈開始,計算第10,第50和第90百分位數。

μ = 1; 
σ = 0.5; 

p[n_] := Quantile[LogNormalDistribution[μ, σ], n] 

p10 = p[0.1] 

1.43222

p50 = p[0.5] 

2.71828

p90 = p[0.9] 

5.15917

Show[ 
    Plot[PDF[LogNormalDistribution[μ, σ], x], {x, 0, 12}], 
    Plot[PDF[LogNormalDistribution[μ, σ], x], {x, 0, #}, 
    PlotStyle -> None, Filling -> Axis] & /@ {p10, p50, p90}, 
    Epilog -> MapThread[Inset[#1, {#2, 0.025}] &, 
    {{"p10", "p50", "p90"}, {p10, p50, p90}}]] 

enter image description here

現在逆運算只從百分μσ作爲OP的問題需要。

Clear[μ, σ] 

sol = [email protected]@Solve[{ 
    Quantile[LogNormalDistribution[μ, σ], 0.1] == p10, 
    Quantile[LogNormalDistribution[μ, σ], 0.5] == p50, 
    Quantile[LogNormalDistribution[μ, σ], 0.9] == p90}, {μ, σ}] 

{μ - > 1.,σ - > 0.5}

登錄正常均值和方差:

Mean[LogNormalDistribution[μ, σ]] /. sol 

3.08022

Variance[LogNormalDistribution[μ, σ]] /. sol 

2.69476

檢查符號計算和定義,瞭解計算。

enter image description here

+0

非常感謝,使用Mathematica很容易實現 – iFikr