Displaying 2 results from an estimated 2 matches for "pdisc".
Did you mean:
ldisc
2011 Jan 16
3
rootogram for normal distributions
Using R-2.12.1 and latticeExtra-0.6-14, I would like to understand
why a rootogram displaying samples from the Poisson distribution looks like I
expected it, whereas a rootogram using the normal distribution does not:
library(latticeExtra)
rootogram(~rpois(1000, lambda = 50), dfun = function(x) dpois(x, lambda = 50))
rootogram(~rnorm(1000), dfun = function(x) dnorm(x,mean(x),sd(x)))
I
2010 Feb 17
2
Problems with xyplot
...s
rm(list=ls()) # Clear all variables
library(LearnBayes)
library(lattice)
p = seq(0.05, 0.95, by = 0.1)
prior = c(1, 5.2, 8, 7.2, 4.6, 2.1, 0.7, 0.1, 0, 0)
prior = prior/sum(prior)
windows()
plot(p, prior, type = "h", ylab="Prior Probability")
post = pdisc(p, prior,c(11, 16))
print(round(cbind(p, prior, post),2))
# Lattice Library
PRIOR=data.frame("prior",p,prior)
POST=data.frame("posterior",p,post)
names(PRIOR)=c("Type","P","Probability")
names(POST)=c("Type","P",&q...