expt.simu {clttools} | R Documentation |
Mean and probability of general simulated experiments
expt.simu(x, n, times, prob = NULL)
x |
vector, possible outcomes in one trial of experiment |
n |
number of trials in one simulation |
times |
number of simulations |
prob |
probability assigned to each possible outcome |
The default probabilty equals to 1/n. All the assigned probabilites must between 0 and 1.
Mean value and corresponding probabilities for all simulated outcomes.
expt.simu(x = c(1:3), n = 4, times = 1000) expt.simu(c(1:3), 4, 1000, prob = c(0.3, 0.1, 0.6))