public double getMeanY() { return sumY.getSum() / n; }
@Override public Void call() throws Exception { final int id = ai.getAndIncrement(); final RealSum sum = new RealSum(); final Cursor< T > c = img.cursor(); c.jumpFwd( portion.getStartPosition() ); for ( long j = 0; j < portion.getLoopSize(); ++j ) sum.add( c.next().getRealDouble() ); sums[ id ] = sum; return null; } });
/** * Add an element to the sum. All intermediate sums are updated and * the capacity is increased on demand. * * @param a the summand to be added */ final public void add( final double a ) { int i = 0; double s = a; try { while ( flags[ i ] ) { flags[ i ] = false; s += sums[ i ]; sums[ i ] = 0.0; ++i; } flags[ i ] = true; sums[ i ] = s; return; } catch ( final IndexOutOfBoundsException e ) { expand( s ); } } }
/** * Add an element to the sum. All intermediate sums are updated and * the capacity is increased on demand. * * @param a the summand to be added */ final public void add( final double a ) { int i = 0; double s = a; try { while ( flags[ i ] ) { flags[ i ] = false; s += sums[ i ]; sums[ i ] = 0.0; ++i; } flags[ i ] = true; sums[ i ] = s; return; } catch ( final IndexOutOfBoundsException e ) { expand( s ); } } }
public double getMeanY() { return sumY.getSum() / n; }
public double getMeanX() { return sumX.getSum() / n; }
public double getMeanX() { return sumX.getSum() / n; }
public double getPMCC() { final double suma = sumX.getSum(); final double sumaa = sumXX.getSum(); final double sumb = sumY.getSum(); final double sumbb = sumYY.getSum(); final double sumab = sumXY.getSum(); return (n * sumab - suma * sumb) / Math.sqrt(n * sumaa - suma * suma) / Math.sqrt(n * sumbb - sumb * sumb); }
public double getPMCC() { final double suma = sumX.getSum(); final double sumaa = sumXX.getSum(); final double sumb = sumY.getSum(); final double sumbb = sumYY.getSum(); final double sumab = sumXY.getSum(); return (n * sumab - suma * sumb) / Math.sqrt(n * sumaa - suma * suma) / Math.sqrt(n * sumbb - sumb * sumb); }