2016-03-04 75 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