Package org.apache.commons.math.stat.descriptive.moment

Examples of org.apache.commons.math.stat.descriptive.moment.StandardDeviation


      }
     
    });
    vra.searchSolutions();
   
    StandardDeviation dev = new StandardDeviation();
    double standardDeviation = dev.evaluate(results);
    double initialThreshold = standardDeviation / 2;
   
    schrimpfAcceptance.setInitialThreshold(initialThreshold);
   
    logger.info("warmup done");
View Full Code Here


      }
     
    });
    vra.searchSolutions();
   
    StandardDeviation dev = new StandardDeviation();
    double standardDeviation = dev.evaluate(results);
    initialThreshold = standardDeviation / 2;
   
    logger.info("warmup done");
    logger.info("total time: " + ((System.currentTimeMillis()-now)/1000.0) + "s");
    logger.info("initial threshold: " + initialThreshold);
View Full Code Here

      }
      else solutionValues[currentIteration] = Integer.MAX_VALUE;
    }
    if(currentIteration == (noIterations - 1)){
      double mean = StatUtils.mean(solutionValues);
      double stdDev = new StandardDeviation(true).evaluate(solutionValues, mean);
      double variationCoefficient = stdDev / mean;
      if(variationCoefficient < variationCoefficientThreshold){
        return true;
      }
    }
View Full Code Here

  public Stat() {
    min = new Min();
    max = new Max();
    sum = new Sum();
    mean = new Mean();
    sd = new StandardDeviation();

    stats = new StorelessUnivariateStatistic[] {min, max, sum, mean, sd};
  }
View Full Code Here

    //System.out.println(vt.getColumnDimension() + "\t" + vt.getRowDimension());
    //System.out.println(wordNo);
    //System.out.println(featureList.size());
   
    UnivariateStatistic mean = new Mean();
    UnivariateStatistic stdev = new StandardDeviation();
    List<Double> cmeans = new ArrayList<Double>();
    List<Double> cstdevs = new ArrayList<Double>();
    List<Double> ncmeans = new ArrayList<Double>();
    List<Double> ncstdevs = new ArrayList<Double>();
    int ccount = 0;
    int nccount = 0;
    for(int i=0;i<values;i++) {
      Map<String,Double> results = new HashMap<String,Double>();
      for(int j=0;j<wordNo;j++) {
        results.put(terms.get(j), ut.get(i,j));
      }
      List<String> resultsList = StringTools.getSortedList(results);
      for(String s : resultsList.subList(0, 20)) {
        System.out.println(s + "\t" + results.get(s));
      }
      System.out.println("...");
      for(String s : resultsList.subList(resultsList.size()-20, resultsList.size())) {
        System.out.println(s + "\t" + results.get(s));
      }
      List<Double> chemScores = new ArrayList<Double>();
      List<Double> nonChemScores = new ArrayList<Double>();
      List<Double> allScores = new ArrayList<Double>();
      for(int j=500;j<1000;j++) {
        boolean isChem = chemSet.contains(terms.get(j));
        //System.out.println(isChem);
        List<Double> list = isChem ? chemScores : nonChemScores;
        list.add(ut.get(i,j));
        allScores.add(ut.get(i,j));
      }
      System.out.println(chemScores.size() + "\t" + nonChemScores.size());
      double [] cs = new double[chemScores.size()];
      for(int j=0;j<chemScores.size();j++) cs[j] = chemScores.get(j);
      double [] ncs = new double[nonChemScores.size()];
      for(int j=0;j<nonChemScores.size();j++) ncs[j] = nonChemScores.get(j);
      double [] as = new double[allScores.size()];
      for(int j=0;j<allScores.size();j++) as[j] = allScores.get(j);
      System.out.println(mean.evaluate(cs) + "\t" + stdev.evaluate(cs));
      System.out.println(mean.evaluate(ncs) + "\t" + stdev.evaluate(ncs));
      cmeans.add(mean.evaluate(cs));
      cstdevs.add(stdev.evaluate(cs));
      ncmeans.add(mean.evaluate(ncs));
      ncstdevs.add(stdev.evaluate(ncs));
      System.out.println();
      ccount = cs.length;
      nccount = ncs.length;
    }
    double cp = ccount / (0.0 + ccount + nccount);
View Full Code Here

        statisticsWriter.append("#queryRate \tnode \tstartTime \tendTime \telapseTime \tquery \n");
        resultWriter
                .append("#requestedQueryRate \tachievedQueryRate \tfiredQueries \tqueryErrors \tavarageQueryDuration \tstandardDeviation  \n");
      }
      try {
        StorelessUnivariateStatistic timeStandardDeviation = new StandardDeviation();
        StorelessUnivariateStatistic timeMean = new Mean();
        int errors = 0;

        for (LoadTestQueryResult result : queryResults) {
          long elapsedTime = result.getEndTime() > 0 ? result.getEndTime() - result.getStartTime() : -1;
          statisticsWriter.write(queryRate + "\t" + result.getNodeId() + "\t" + result.getStartTime() + "\t"
                  + result.getEndTime() + "\t" + elapsedTime + "\t" + result.getQuery() + "\n");
          if (elapsedTime != -1) {
            timeStandardDeviation.increment(elapsedTime);
            timeMean.increment(elapsedTime);
          } else {
            ++errors;
          }
        }
        resultWriter.write(queryRate + "\t" + ((double) queryResults.size() / (_runTime / 1000)) + "\t"
                + queryResults.size() + "\t" + errors + "\t" + (int) timeMean.getResult() + "\t"
                + (int) timeStandardDeviation.getResult() + "\n");
      } catch (IOException e) {
        throw new IllegalStateException("Failed to write statistics data.", e);
      }
      try {
        LOG.info("results written to " + resultsFile.getAbsolutePath());
View Full Code Here

      double[] values = new double[partitionRecordCounts.size()];
      int i = 0;
      for (Integer rc : partitionRecordCounts) {
        values[i++] = rc.doubleValue();
      }
      StandardDeviation stdDev = new StandardDeviation();
      Mean mean = new Mean();
      double std = stdDev.evaluate(values);
      double m = mean.evaluate(values);
      System.out.println("mean: " + m + " std dev: " + std);
      //Assert.assertTrue(std < 0.1 * m);
      assertEquals(31000, count);
    }
View Full Code Here

    return arrayValues;
  }
 
  public static Double stdDev(double[] values)
  {
    StandardDeviation stdevCalculator = new StandardDeviation();
    return stdevCalculator.evaluate(values);
  }
View Full Code Here

        double[] values = new double[length];
        for (int i = 0; i < length; i++) {
            values[i] = start + i;
        }

        StandardDeviation stdDev = new StandardDeviation();
        return stdDev.evaluate(values);
    }
View Full Code Here

        double[] values = new double[length];
        for (int i = 0; i < length; i++) {
            values[i] = start + i;
        }

        StandardDeviation stdDev = new StandardDeviation(false);
        return stdDev.evaluate(values);
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.math.stat.descriptive.moment.StandardDeviation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.