lambda <- runif(10,min=0,max=3)
mean(lambda)
for (i in 1:10){
N <- rpois(i,mean(lambda))
mean(N)
plot(i,mean(N))
}
Hi all, this is a really simple R code block I have here. I am basically trying to create a plot where I can see how the mean of the poisson distribution is changing as I increase its iteration using the rpois function. I would like to post these values (mean(N)) all on the same graph so I can see the change but I am not quite sure how to do that.
I have been googling a lot and I came across qqplot or so but I just started using R few days ago and I have having a lot of trouble.
Any insights would be helpful