Examples of Mean


Examples of de.lmu.ifi.dbs.elki.math.Mean

    // regression using the covariance matrix
    CovarianceMatrix covm = new CovarianceMatrix(2);
    for(DBID id : relation.iterDBIDs()) {
      final double local = relation.get(id).doubleValue(1);
      // Compute mean of neighbors
      Mean mean = new Mean();
      DBIDs neighbors = npred.getNeighborDBIDs(id);
      for(DBID n : neighbors) {
        if(id.equals(n)) {
          continue;
        }
        mean.put(relation.get(n).doubleValue(1));
      }
      final double m;
      if(mean.getCount() > 0) {
        m = mean.getMean();
      }
      else {
        // if object id has no neighbors ==> avg = non-spatial attribute of id
        m = local;
      }
View Full Code Here

Examples of jscicalc.pobject.Mean

    private double statSize(){
  return statMemory.size() - statMemoryNeg.size();
    }

    public Mean statMean(){
  Mean mean = new Mean();
  Complex d = new Complex();
  for( Complex o : statMemory ){
      d = d.add( o );
  }
  for( Complex o : statMemoryNeg ){
      d = d.subtract( o );
  }
  if( statSize() > 0 ){
     mean.setValue( d.divide( new Complex( statSize(), 0 ) ) );
  } else {
      mean.setError( true );
   }
  return mean;
    }
View Full Code Here

Examples of jscicalc.pobject.Mean

   }
  return mean;
    }
   
    public Complex statSumSquares(){
  Mean m = statMean();
  if( m.error() || !(m.value() instanceof Complex) )
      throw new RuntimeException( "Stat Error" );
  Complex e = (Complex)(m.value());
  Complex d = new Complex();
  for( Complex o : statMemory ){
      Complex c = o.subtract( e );
      d = d.add( c.square() );
  }
View Full Code Here

Examples of opennlp.tools.util.eval.Mean

    }

    // Clears the adaptive data which was created for the current document
    mNameFinder.clearAdaptiveData();

    documentConfidence = new Mean();
  }
View Full Code Here

Examples of opennlp.tools.util.eval.Mean

*/
public class MeanTest {

  @Test
  public void testMeanCalculation() {
    Mean a = new Mean();
    a.add(1);
    assertEquals(1, a.count());
    assertEquals(1d, a.mean(), 0.00001d);
   
    a.add(1);
    assertEquals(2, a.count());
    assertEquals(1d, a.mean(), 0.00001d);
    a.toString();
   
    Mean b = new Mean();
    b.add(0.5);
    assertEquals(1, b.count());
    assertEquals(0.5d, b.mean(), 0.00001d);
   
    b.add(2);
    assertEquals(2, b.count());
    assertEquals(1.25d, b.mean(), 0.00001d);
    b.toString();
   
    Mean c = new Mean();
    assertEquals(0, c.count());
    assertEquals(0d, c.mean(), 0.00001d);
    c.toString();
  }
View Full Code Here

Examples of opennlp.tools.util.eval.Mean

    }

    // Clears the adaptive data which was created for the current document
    mNameFinder.clearAdaptiveData();

    documentConfidence = new Mean();
  }
View Full Code Here

Examples of opennlp.tools.util.eval.Mean

     *          the predicted pos tag
     */
    private void add(String tok, String ref, String pred) {
      // token stats
      if (!tokAccuracies.containsKey(tok)) {
        tokAccuracies.put(tok, new Mean());
        tokOcurrencies.put(tok, new Counter());
        tokErrors.put(tok, new Counter());
      }
      tokOcurrencies.get(tok).increment();

View Full Code Here

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

  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

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

        u.clear();
        u.addValue(1);
        u.addValue(2);
        assertEquals(3, u.getMean(), 1E-14);
        u.clear();
        u.setMeanImpl(new Mean()); // OK after clear
    }
View Full Code Here

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


    public void testInteraction() {

        FourthMoment m4 = new FourthMoment();
        Mean m = new Mean(m4);
        Variance v = new Variance(m4);
        Skewness s= new Skewness(m4);
        Kurtosis k = new Kurtosis(m4);

        for (int i = 0; i < testArray.length; i++){
            m4.increment(testArray[i]);
        }

        assertEquals(mean,m.getResult(),tolerance);
        assertEquals(var,v.getResult(),tolerance);
        assertEquals(skew ,s.getResult(),tolerance);
        assertEquals(kurt,k.getResult(),tolerance);

    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.