makeRdsSample {chords} | R Documentation |
Generates a sample from the sampling process assumed in the reference.
Well, actually, only the sufficient statistics required by Estimate.b.k
are returned.
makeRdsSample(N.k, b.k, sample.length)
N.k |
An integer vector with the population frequency of each degree. |
b.k |
A numeric vector of the sampling rates of each degree. |
sample.length |
The length of the sample. Specified as the number of recruitees before termination. |
An object of class rds-object
suitable for applying Estimate.b.k
.
The simulator does not prodice a whole RDS sample, but rather the sufficient statistics required for applying Estimate.b.k
.
[1] Berchenko, Y., Rosenblatt J.D., and S.D.W. Frost. "Modeling and Analyzing Respondent Driven Sampling as a Counting Process." arXiv:1304.3505
# Generate data: true.Nks <- rep(0,100); true.Nks[c(2,100)] <- 1000 theta <- 1e-1 true.log.bks <- rep(-Inf, 100);true.log.bks[c(2,100)] <- theta*log(c(2,100)) sample.length <- 1000L rds.simulated.object <- makeRdsSample( N.k =true.Nks , b.k = exp(true.log.bks), sample.length = sample.length) # Estimate: Estimate.b.k(rds.object = rds.simulated.object ) chords:::compareNkEstimate(rds.simulated.object$estimates$Nk.estimates, true.Nks)