R/test3.R

Defines functions test3 test4

Documented in test3 test4

test3=function(Nsim=10^4,lambda=100){
  spread=3*sqrt(lambda)
  t=round(seq(max(0,lambda-spread),lambda+spread,1))
  prob=ppois(t,lambda)
  X=rep(0,Nsim)
  for (i in 1:Nsim){
     u=runif(1)
     X[i]=t[1]+sum(prob<u)-1 }
  }

test4=function(Nsim=10^4,lambda=100){
 rpois(Nsim,lambda)}

Try the mcsm package in your browser

Any scripts or data that you put into this service are public.

mcsm documentation built on May 2, 2019, 10:16 a.m.