Calculating the accumulated sample size distribution by each wave.
calSize(s, c, maxWave, rr, bruteMC, tol = 0.025)a list consisting of the following elements:
vector; a vector of extinction probabilities, i.e., probability of not recruiting any new participants at each wave.
list; probability mass function and complementary cumulative distribution function of attaining a certain sample size (including seeds) by each wave, w=1,...,maxWave. The round of seed collection is counted as wave 0.
scalar; Number of seeds to initiate the sampling process.
scalar; Number of coupons issued to each participant.
scalar; Planned field period scaled by wave, which does not include the initial round of recruiting seeds.
scalar or vector; a (constant) recruitment rate or a vector of length maxWave, listing varying recruitment rates at each wave. The recruitment rate represents the average coupon use rate. For example, if rr is a vector, the wth element is the ratio of the number of successful recruits brought into the study at wave w by their recruiters (participants from wave w-1) to the total number of coupons issued to those recruiters, where w ranges from 1 to maxWave. Seeds are counted as participants at Wave 0.
logical; If TRUE then use a brute force Monte Carlo approach to obtain empirical data and estimate sample size distribution; If FALSE then compute the theoretical results of sample size distribution using an approximation algorithm.
scalar; Accuracy loss limit control, which is set up for the approximation algorithm when bruteMC=FALSE, with default of 0.025. This parameter determines the acceptable level of accuracy loss in the approximate computation of the sample size distribution.
Raychaudhuri, Samik. Introduction to monte carlo simulation, 2008 Winter simulation conference. IEEE, 2008.
x <- calSize(s=10,c=3,maxWave=9,rr=0.3,bruteMC=FALSE,tol=0.025)
Run the code above in your browser using DataLab