How to plot the Binomial Distribution
Hey there, is there a macro for
?
add a comment
Hey there, is there a macro for
?
The formula can be written in SageMath using binomial
, but you may also use binom from the scipy library:
sage: import scipy.stats
sage: binom_dist = scipy.stats.binom(20,.20)
sage: bar_chart([binom_dist.pmf(k) for k in range(20)])
See the Sage quick start for statistics page. As explained in the doc of
sage: scipy.stats.binom?
pmf
stands for Probability mass function
.
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2020-04-05 19:47:23 +0200
Seen: 1,245 times
Last updated: Apr 06 '20