plot beta dist
Upcoming SlideShare
Loading in...5
×
 

plot beta dist

on

  • 2,208 views

 

Statistics

Views

Total Views
2,208
Views on SlideShare
2,189
Embed Views
19

Actions

Likes
0
Downloads
5
Comments
0

1 Embed 19

http://www.slideshare.net 19

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

plot beta dist plot beta dist Presentation Transcript

  • 1分で作るベータ分布 showyou hatena,twitter:showyou
  • ベータ分布とは ベルヌーイ/多項分布のパラメータμの 共役事前分布
  • Rでベータ分布表示するには dbeta 使えば OK View slide
  • ベータ分布の表示
    • Rで
      • > x <- seq(0,1,len=500) View slide
      • > a <- 0.1
      • > b <- 0.1
      • > y <- dbeta(x, a, b)
      • > plot(x,y,type=”l”)
  • ベータ分布の表示
    • a,bを変えると分布の形も変わる
  • pythonで表示してみる > import matplotlib > import pylab > import scipy > > x = [ 0.01*i for i in range(100)] > > scipy.pkgload(&quot;special&quot;) > gamma = scipy.special.gamma > def dbeta(x, a, b): return gamma(a+b)/(gamma(a)*gamma(b)) * x **(a-1) * (1-x)**(b-1) > matplotlib.pyplot.plot([ dbeta(xi , 3, 2) for xi in x])
  • pythonでも表示してみる > import matplotlib > import pylab > import scipy > > x = [ 0.01*i for i in range(100)] > > scipy.pkgload(&quot;stats&quot;) > a = [scipy.stats.beta.pdf(xi , 3, 2) for xi in x] > matplotlib.pyplot.plot(a) > matplotlib.pyplot.show() (実はベータ分布関数がある)
  • 実行結果