Package jscicalc.pobject

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


   }
  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

TOP

Related Classes of jscicalc.pobject.Mean

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.