Documentation of 'com.datumbox.framework.core.statistics.sampling.StratifiedSampling' Java class
StratifiedSampling
com.datumbox.framework.core.statistics.sampling

Class StratifiedSampling



  • public class StratifiedSampling
    extends java.lang.Object
    This class provides methods which can be used for performing Stratified Sampling.
    • Constructor Detail

      • StratifiedSampling

        public StratifiedSampling()
    • Method Detail

      • weightedProbabilitySampling

        public static TransposeDataCollection weightedProbabilitySampling(AssociativeArray2D strataFrequencyTable,
                                                                          AssociativeArray nh,
                                                                          boolean withReplacement)
        Samples nh ids from each strata based on their Frequency Table
        Parameters:
        strataFrequencyTable -
        nh -
        withReplacement -
        Returns:
      • mean

        public static double mean(TransposeDataCollection sampleDataCollection,
                                  AssociativeArray populationNh)
        Calculate the mean from the sample
        Parameters:
        sampleDataCollection -
        populationNh -
        Returns:
      • variance

        public static double variance(TransposeDataCollection sampleDataCollection,
                                      AssociativeArray populationNh)
        Calculate the variance from the sample
        Parameters:
        sampleDataCollection -
        populationNh -
        Returns:
      • std

        public static double std(TransposeDataCollection sampleDataCollection,
                                 AssociativeArray populationNh)
        Calculate the standard deviation of the sample
        Parameters:
        sampleDataCollection -
        populationNh -
        Returns:
      • optimumSampleSize

        public static AssociativeArray optimumSampleSize(int n,
                                                         AssociativeArray populationNh,
                                                         AssociativeArray populationStdh)
        Returns the optimum sample size per strata under Neyman Allocation
        Parameters:
        n -
        populationNh -
        populationStdh -
        Returns:

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.