偏态分布的高密度区间

时间:2016-11-13 17:30:29

标签: r plot bayesian

我想知道如何找到" 2种类型的90%可信限制"对于我的偏差分布(参见产生我偏斜分布的代码"下面")?

特别需要:

1-形成可靠限制的两点的高度为 UNEQUAL ,但 AREA 在其尾部 EQUAL (< strong>类型1 ,通常为90%CI)

2-形成可靠限制的两点的高度 EQUAL ,但 AREA 在其尾部 UNEQUAL (< strong>类型2 ,不寻常的90%CI)

以下是我的发行版的R代码:

N <- seq(from=100,to=2000,by=1)
P <- choose(N-100,50)/choose(N,60)

## Normalize Ps to make the total area under the curve become 1:
sum(P)
P <- P/sum(P)
plot(N,P,type="l")

1 个答案:

答案 0 :(得分:0)

  quantile(P, c(0.10, 0.90)) 

 library(coda)
    HPDinterval(mcmc(P), 0.90)