Image:Binomial distribution cdf.svg

From Wikipedia, the free encyclopedia

Binomial_distribution_cdf.svg (SVG file, nominally 434 × 289 pixels, file size: 20 KB)

Wikimedia Commons logo This is a file from the Wikimedia Commons. The description on its description page there is shown below.
Commons is a freely licensed media file repository. You can help.

[edit] Summary

Description

Binomial distribution cumulative distribution function

Source

self-made

Date

2 Mar 2008

Author

Tayste

Permission
(Reusing this image)

see below


[edit] R source code

# R source code for Wikipedia SVG plot of Binomial CDF
# by User:Tayste, March 2008

require("RSvgDevice")

create.binomial.cdf <- function(N, p, colour="black", pch=16) {
 n <- max(length(N),length(p),length(colour),length(pch))
 N <- rep(N,length=n); p <- rep(p,length=n)
 colour <- rep(colour,length=n); pch <- rep(pch,length=n)

 add.one.series <- function(N, p, colour, pch) {
   cdf <- pbinom(0:N, N, p)
   lines(0:N, cdf, type="s", col=colour)
   points(0:N, cdf, col=colour, pch=pch)
 }
 
 par(lwd=1.5, cex=1, mar=c(3.1,2.5,0.5,0.5))
 plot(1, xlim=c(0,max(N)), ylim=c(0,1), type="n", xlab="", ylab="")
 for (i in 1:n)
   add.one.series(N[i],p[i],colour[i],pch[i])
   
 text = paste("p=",rev(p)," and N=",rev(N),sep="")
 legend(max(N), 0, legend=text, xjust=1, yjust=0,
   pch=rev(pch), lwd=rep(par("lwd"),3), col=rev(colour), y.intersp=1.5, bty="n")
}

devSVG("Binomial_distribution_cdf.svg",width=4,height=3)
create.binomial.cdf(c(40,20,20), c(0.5,0.7,0.5), c("red","green","blue"), c(20,15,18))
dev.off()

[edit] Licensing

Public domain I, the copyright holder of this work, hereby release it into the public domain. This applies worldwide.

In case this is not legally possible:
I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.


Afrikaans | Alemannisch | Aragonés | العربية | Asturianu | Български | Català | Česky | Cymraeg | Dansk | Deutsch | Eʋegbe | Ελληνικά | English | Español | Esperanto | Euskara | Estremeñu | فارسی | Français | Galego | 한국어 | हिन्दी | Hrvatski | Ido | Bahasa Indonesia | Íslenska | Italiano | עברית | Kurdî / كوردی | Latina | Lietuvių | Latviešu | Magyar | Македонски | Bahasa Melayu | Nederlands | ‪Norsk (bokmål)‬ | ‪Norsk (nynorsk)‬ | 日本語 | Polski | Português | Ripoarisch | Română | Русский | Shqip | Slovenčina | Slovenščina | Српски / Srpski | Svenska | ไทย | Tagalog | Türkçe | Українська | Tiếng Việt | Walon | ‪中文(简体)‬ | ‪中文(繁體)‬ | zh-yue-hant | +/-

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeDimensionsUserComment
current20:09, 1 March 2008434×289 (20 KB)Tayste ({{Information |Description=Binomial distribution cdf |Source=self-made |Date=2 Mar 2008 |Author= Tayste |Permission= |other_versions= }} )
The following pages on the English Wikipedia link to this file (pages on other projects are not listed):