powered by
See the help for `qnbinom()` for further info about prob versus mu parameter specification. Thanks for the suggested code, David Hugh-Jones!
norm2nbinom( x, size, prob, mu, lower.tail = TRUE, log.p = FALSE, x_mu = mean(x), x_sd = stats::sd(x) )
a vector with a negative binomial distribution
the normally distributed vector
target for number of successful trials, or dispersion parameter (the shape parameter of the gamma mixing distribution). (size > 0)
the probability of success on each trial (0 to 1)
alternative parametrization via mean (only specify one of prob or mu)
logical; if TRUE (default), probabilities are P[$X <= x$], otherwise, P[$X > x$]
logical; if TRUE, probabilities p are given as log(p)
the mean of x (calculated from x if not given)
the SD of x (calculated from x if not given)
x <- rnorm(10000) y <- norm2nbinom(x, 1, prob = 0.5) z <- norm2nbinom(x, 1, mu = 1) g <- ggplot2::ggplot() + ggplot2::geom_point(ggplot2::aes(x, y)) ggExtra::ggMarginal(g, type = "histogram")
Run the code above in your browser using DataLab