【转帖】Dirichlet Distribution(狄利克雷分布)与Dirichlet Process(狄利克雷过程)原文https://www.datalearner.com/blog/10514


beta分布的R语言实例
  首先,我们可以画一个beta分布的概率密度函数。

 

    set.seed(1)
    x<-seq(0,1,length.out=10000)
    plot(0,0,main='probability density function',xlim=c(0,1),ylim=c(0,2.5),ylab='PDF')
    lines(x,dbeta(x,0.5,0.5),col='red')
    lines(x,dbeta(x,1,2),col='green')
    lines(x,dbeta(x,2,2),col='pink')
    lines(x,dbeta(x,2,5),col='orange')
    lines(x,dbeta(x,1,3),col='blue')
    lines(x,dbeta(x,5,1),col='black')
    legend('top',legend=c('α=0.5,β=0.5','α=1,β=2','α=2,β=2','α=2,β=5','α=1,β=3','α=5,β=1'),col=c('red','green','pink','orange','blue','black'),lwd=1)


我们再来画一个beta分布的累计概率密度函数

    set.seed(1)
    x<-seq(0,1,length.out=10000)
    plot(0,0,main='cumulative distribution function',xlim=c(0,1),ylim=c(0,1),ylab='PDF')
    lines(x,pbeta(x,0.5,0.5),col='red')
    lines(x,pbeta(x,1,2),col='green')
    lines(x,pbeta(x,2,2),col='pink')
    lines(x,pbeta(x,2,5),col='orange')
    lines(x,pbeta(x,1,3),col='blue')
    lines(x,pbeta(x,5,1),col='black')
    legend('topleft',legend=c('α=0.5,β=0.5','α=1,β=2','α=2,β=2','α=2,β=5','α=1,β=3','α=5,β=1'),col=c('red','green','pink','orange','blue','black'),lwd=1)

来源1:Dirichlet Process : Tutorial and Practical Course,Yee Whye Teh
来源2:Dirichlet Processes:A gentle tutorial, Khalid El-Arini
来源3:https://en.wikipedia.org/wiki/Dirichlet_distribution
来源4:https://en.wikipedia.org/wiki/Beta_distribution
来源5:LDA 数学八卦,靳志辉
来源6:Dirichelt Process:徐亦达的优酷视频:http://i.youku.com/i/UMzIzNDgxNTg5Ng==

 

 

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值