rmixexp | R Documentation |
rmixexp
uses a special definition for the probabilities
p_i
to generate random samples from a mixed Poisson distribution
with known parameters for each process. In the two-process case,
p
represents the proportion of "fast" to "slow" events in the
mixture. In the three-process case, p_0
represents the
proportion of "fast" to "slow" events, and p_1
represents the
proportion of "slow" to "slow" *and* "very slow" events.
rmixexp(n, p, lambdas)
n |
integer output sample size. |
p |
numeric probabilities for processes generating the output mixture sample. |
lambdas |
numeric |
vector of samples.
## Draw samples from a mixture where the first process occurs with ## p < 0.7, and the second process occurs with the remaining ## probability. p <- 0.7 lda <- c(0.05, 0.005) (rndprocs2 <- rmixexp(1000, p, lda)) ## 3-process p_f <- 0.6 # fast to slow p_svs <- 0.7 # prop of slow to (slow + very slow) procs p_true <- c(p_f, p_svs) lda_true <- c(0.05, 0.01, 8e-4) (rndprocs3 <- rmixexp(1000, p_true, lda_true))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.