Calculates Standard Deviation for Xbar for infinite population size

@param std
@param sampleN
@return
345459
public static double xbarStd(double std, int sampleN) {
        return Math.sqrt(xbarVariance(std*std, sampleN, Integer.MAX_VALUE));
    }
1362961
def sample(self, n):
        
        rg = self._ctx._jvm.org.apache.commons.math3.random.JDKRandomGenerator()
        return _java2py(self._ctx, self._jmodel.sample(n, rg))
1225231
public double stdev() {
        double m = mean();

        double total = 0;

        final int N = getNumElements();
        if( N <= 1 )
            throw new IllegalArgumentException("There must be more than one element to compute stdev");


        for( int i = 0; i < N; i++ ) {
            double x = get(i);

            total += (x - m)*(x - m);
        }

        total /= (N-1);

        return Math.sqrt(total);
    }
1227640
private boolean rule8(Double sample) {
        if (!hasMean()) {
            return false;
        }

        if (Math.abs(sample - mean.getResult()) > oneDeviation) {
            ++rule8Count;
        } else {
            rule8Count = 0;
        }

        return rule8Count >= 8;
    }
600483
private boolean rule7(double sample) {
        if (!hasMean()) {
            return false;
        }

        if (sample == mean.getResult()) {
            rule7Count = 0;
            return false;
        }

        if (Math.abs(sample - mean.getResult()) <= oneDeviation) {
            ++rule7Count;
        } else {
            rule7Count = 0;
        }

        return rule7Count >= 15;
    }
1059434
public void stmSelection() {

    int[] idx = new int[populationSize];
    double[] nicheCount = new double[populationSize];

    int[][] solPref = new int[jointPopulation.size()][];
    double[][] solMatrix = new double[jointPopulation.size()][];
    double[][] distMatrix = new double[jointPopulation.size()][];
    double[][] fitnessMatrix = new double[jointPopulation.size()][];

    for (int i = 0; i < jointPopulation.size(); i++) {
      solPref[i] = new int[populationSize];
      solMatrix[i] = new double[populationSize];
      distMatrix[i] = new double[populationSize];
      fitnessMatrix[i] = new double[populationSize];
    }
    int[][] subpPref = new int[populationSize][];
    double[][] subpMatrix = new double[populationSize][];
    for (int i = 0; i < populationSize; i++) {
      subpPref[i] = new int[jointPopulation.size()];
      subpMatrix[i] = new double[jointPopulation.size()];
    }

    // Calculate the preference values of solution matrix
    for (int i = 0; i < jointPopulation.size(); i++) {
      int minIndex = 0;
      for (int j = 0; j < populationSize; j++) {
        fitnessMatrix[i][j] = fitnessFunction(jointPopulation.get(i), lambda[j]);
        distMatrix[i][j] = calculateDistance2(jointPopulation.get(i), lambda[j]);
        if (distMatrix[i][j] < distMatrix[i][minIndex]) {
          minIndex = j;
        }
      }
      nicheCount[minIndex] = nicheCount[minIndex] + 1;
    }

    // calculate the preference values of subproblem matrix and solution matrix
    for (int i = 0; i < jointPopulation.size(); i++) {
      for (int j = 0; j < populationSize; j++) {
        subpMatrix[j][i] = fitnessFunction(jointPopulation.get(i), lambda[j]);
        solMatrix[i][j] = distMatrix[i][j] + nicheCount[j];
      }
    }

    // sort the preference value matrix to get the preference rank matrix
    for (int i = 0; i < populationSize; i++) {
      for (int j = 0; j < jointPopulation.size(); j++) {
        subpPref[i][j] = j;
      }
      MOEADUtils.quickSort(subpMatrix[i], subpPref[i], 0, jointPopulation.size() - 1);
    }
    for (int i = 0; i < jointPopulation.size(); i++) {
      for (int j = 0; j < populationSize; j++) {
        solPref[i][j] = j;
      }
      MOEADUtils.quickSort(solMatrix[i], solPref[i], 0, populationSize - 1);
    }

    idx = stableMatching(subpPref, solPref, populationSize, jointPopulation.size());

    population.clear();
    for (int i = 0; i < populationSize; i++) {
      population.add(i, jointPopulation.get(idx[i]));
    }
  }
1134830
private int sample(Queue<OutboundFrame> q) {
        packets.addAll(q);

        if (packets.size() < threshold) {
            return -1;
        }

        int sampleCount = min(samples, packets.size());
        int actualSampleCount = 0;
        for (int k = 0; k < sampleCount; k++) {
            OutboundFrame packet = packets.get(random.nextInt(packets.size()));
            String key = toKey(packet);

            if (key != null) {
                actualSampleCount++;
                occurrenceMap.add(key, 1);
            }
        }

        return actualSampleCount;
    }
1000026
public double[] sample(int numSamples, Random rand)
    {
        double[] samples = new double[numSamples];
        for(int i = 0; i < samples.length; i++)
            samples[i] = invCdf(rand.nextDouble());
        
        return samples;
    }
904182
public static double mean(TransposeDataCollection sampleDataCollection, AssociativeArray populationNh) {
        double populationN = Descriptives.sum(populationNh.toFlatDataCollection());
        
        if(populationN<=0) {
            throw new IllegalArgumentException("The populationN parameter must be positive.");
        }
        
        double mean = 0.0;
        
        for(Map.Entry<Object, FlatDataCollection> entry : sampleDataCollection.entrySet()) {
            Object strata = entry.getKey();
            Integer strataPopulation = ((Number)populationNh.get(strata)).intValue();
        
            if(strataPopulation==null) {
                throw new IllegalArgumentException("Invalid strata population size.");
            }
            
            mean += strataPopulation*SimpleRandomSampling.mean(entry.getValue())/populationN;
        }
        
        return mean;
    }
1011635
@Override
    public double[] sample(long sampleSize) {
        if (sampleSize <= 0) {
            throw new NotStrictlyPositiveException(LocalizedFormats.NUMBER_OF_SAMPLES, sampleSize);
        }
        // FIXME: int cast
        double[] out = new double[(int) sampleSize];
        for (int i = 0; i < sampleSize; i++) {
            out[i] = sample();
        }
        return out;
    }
435746
public static double quantile(double x, double mu, double sigma) {
    return FastMath.exp(mu + sigma * NormalDistribution.standardNormalQuantile(x));
  }
468539
def _get_stddevs(self, coeffs, stddev_types):
        
        for stddev_type in stddev_types:
            assert stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES

        return np.sqrt(coeffs['sigma_bedrock']**2 + coeffs['sigma_site']**2)
1251758
function sample_variance(x) {
        // The variance of no numbers is null
        if (x.length <= 1) return null;

        var sum_squared_deviations_value = sum_nth_power_deviations(x, 2);

        // Find the mean value of that list
        return sum_squared_deviations_value / (x.length - 1);
    }
414902
public static double pbarStd(double pbar, int sampleN) {
        return Math.sqrt(pbarVariance(pbar, sampleN, Integer.MAX_VALUE));
    }
1194566
def _get_stddevs(self, C, stddev_types, num_sites):
        
        assert all(stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
                   for stddev_type in stddev_types)

        # Using a frequency independent value of sigma as recommended
        # in the caption of Table 2 of Atkinson (2010)
        stddevs = [0.26/np.log10(np.e) + np.zeros(num_sites)]

        return stddevs
762433
def stdev(x):
    
    """
    from math import sqrt
    n = len(x)
    mean = sum(x) / float(n)
    std = sqrt(sum((a - mean)**2 for a in x) / float(n - 1))
    return std
926689
private int findSampleRate(int sampleIndex, int version)
	{
		int ind = -1;

		switch (version)
		{
			case MPEG_V_1:
				ind = 0;
				break;
			case MPEG_V_2:
				ind = 1;
				break;
			case MPEG_V_25:
				ind = 2;
		}

		if ((ind != -1) && (sampleIndex >= 0) && (sampleIndex <= 3))
		{
			return sampleTable[sampleIndex][ind];
		}
		return -1;
	}