import numpy as np import numpy as np import pylab as pl import scipy.special as ss def beta(a, b, mew): e1 = ss.gamma(a + b) e2 = ss.gamma(a) e3 = ss.gamma(b) e4 = mew ** (a - 1) e5 = (1 - mew) ** (b - 1) return (e1/(e2*e3)) * e4 * e5 def plot_beta(a, b): Ly = [] Lx = [] mews = np.mgrid[0:1:100j] for mew in mews: Lx.append(mew) Ly.append(beta(a, b, mew)) pl.plot(Lx, Ly, label="a=%f, b=%f" %(a,b)) def main(): plot_beta(0.1, 0.1) plot_beta(1, 1) plot_beta(2, 3) plot_beta(8, 4) pl.xlim(0.0, 1.0) pl.ylim(0.0, 3.0) pl.legend() pl.show() if __name__ == "__main__": main()
2011/08/16
python tips: draw beta distribution with matplotlib
ラベル:
machine learning,
python
Subscribe to:
Post Comments (Atom)
Thanks for sharing this pretty post, it was good and helpful. Share more like this.
ReplyDeleteccna Training in Chennai
Python Training in Chennai
R Programming Training in Chennai
AWS Training in Chennai
DevOps Training in Chennai
Angularjs Training in Chennai
RPA Training in Chennai
Data Science Course in Chennai
I feel satisfied to read your blog, you have been delivering a useful & unique information to our vision.keep blogging.
ReplyDeleteCyber Security Training Course in Chennai | Certification | Cyber Security Online Training Course | Ethical Hacking Training Course in Chennai | Certification | Ethical Hacking Online Training Course | CCNA Training Course in Chennai | Certification | CCNA Online Training Course | RPA Robotic Process Automation Training Course in Chennai | Certification | RPA Training Course Chennai | SEO Training in Chennai | Certification | SEO Online Training Course
Nice blog.
ReplyDeletePython training in Pune