R/random_utils.R

Defines functions GenerateMultivariatePoisson

# Function: GenerateMultivariatePoisson
# Yahav, I. and G. Shmueli (2011) On generating multivariate Poisson data
# in management science applications. Appl. Stochastic Models Bus. Ind. 28: 91-102. 
GenerateMultivariatePoisson <- function(p, samples, R, lambda){
  normal_mu = rep(0, p)
  normal = mvrnorm(samples, normal_mu, R)
  unif = pnorm(normal)
  pois = t(qpois(t(unif), lambda))
  return(pois)
}

Try the metagear package in your browser

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

metagear documentation built on Feb. 15, 2021, 5:09 p.m.