Created
September 21, 2016 13:20
-
-
Save masayukeeeee/65465013b1fdab935be94045ddba473c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hist(data, breaks=seq(-0.5, 9.5, 1)) | |
par(new=T) | |
plot(y, myPois(y, lambda=2),type="b", ylim=c(0,0.3), axes=FALSE, xlab="", ylab="", col=2, pch=1) | |
par(new=T) | |
plot(y, myPois(y, lambda=mean(data)),type="b", ylim=c(0,0.3), axes=FALSE, xlab="", ylab="", col=3, pch=2) | |
par(new=T) | |
plot(y, myPois(y, lambda=4),type="b", ylim=c(0,0.3), axes=FALSE, xlab="", ylab="", col=4, pch=3) | |
par(new=T) | |
plot(y, myPois(y, lambda=5),type="b", ylim=c(0,0.3), axes=FALSE, xlab="", ylab="", col=5, pch=4) | |
legend("topright", | |
legend=c("lambda=2", "lambda=3.56", "lambda=4", "lambda=5"), | |
col=c(2,3,4,5), | |
pch=c(1,2,3,4),) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment