View source: R/sim_multiple_stages.R
sim_multiple_stages | R Documentation |
This function calculates the resulting expected total number of CFUs in the mixed sample in the multiple mixing plans at each stage of the mixing process.
sim_multiple_stages(mu, sigma, alpha_in, k, l, r, distribution, n_sim)
mu |
the average number of CFUs ( |
sigma |
the standard deviation of the colony-forming units in the mixed sample on the logarithmic scale (default value 0.8) |
alpha_in |
concentration parameter at the initial stage |
k |
number of small portions / primary samples |
l |
number of revolutions / stages |
r |
the rate of the concentration parameter changes at each mixing stage |
distribution |
what suitable distribution type we have employed for simulation such as |
n_sim |
number of simulations |
Let N'
be the number of CFUs in the mixed sample, which is produced by the mixing of k
primary samples and N' = \sum N_i
and let N_i
be the number of CFUs.
For this package development, we have employed the notations 'Type-A' and 'Type-B' to indicate the type of distributions, which are applied in the previous literature as 'fair' and 'beta', respectively; see Nauta (2005).
This package will consider stage-by-stage the mixing process and assumes systematically breaking clusters at every stage of the mixing. Therefore, it can be assumed the concentration parameter also systematically changes with the concentration of the contribution.
The expected total number of CFUs in each revolution / stage.
Nauta, M.J., 2005. Microbiological risk assessment models for partitioning and mixing during food handling. International Journal of Food Microbiology 100, 311-322.
sim_single
mu <- 100
sigma <- 0.8
alpha_in <- 0.01
k <- c(30,75)
l <- 2500
rate <- 0.01
distribution <- c("Poisson lognormal-Type B","Poisson lognormal-Type B")
n_sim <- 2000
colMeans(sim_multiple_stages(mu, sigma, alpha_in, k, l, rate, distribution, n_sim))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.