Internal function to execute the subsampling component of
the stochastic stagewise approach. If a user provides a stochastic
value between 0 and 1, it is assumed that some proportion of subsampling
is desired. The samplingDistCalculation
function calculates the
distribution of the clusters and the subsample
function uses that
distribution to draw the actual subsample.
subsample(sampleDist, sampleSize, withReplacement, clusterIDs, clusterID)
A vector whose length is equal to the number of clusters that indicates the probability of sampling each cluster
A scalar value indicating how larger of a subsample is being drawn
A logical value indicating whether the subsampling is beign done with or without replacement
A vector of all of the UNIQUE cluster IDs
A vector of length equal to the number of observations indicating which cluster each observation is in
A list with two variables: subSampleIndicator
, which
indicates which observations are in the current subsample, and
clusterIDCurr
, which indicates the clusterID for the subsample.