Simple Moving Average: Calculates Ft+1 by using previous results. A quick version of the simpleMovingAverage

@param Yt
@param YtminusN
@param Ft
@param N
@return
334103
public static double simpleMovingAverageQuick(double Yt, double YtminusN, double Ft, int N) {
        double SMA=(Yt-YtminusN)/N+Ft;

        return SMA;
    }
791745
private int getYForX(int newX, int newY) {

        int height = (int)Math.floor((newX - m_firstX) * m_heightToWidth);
        int result = m_firstY + height;
        if (((m_firstY - newY) * (m_firstY - result)) < 0) {
            result = m_firstY - height;
        }
        return result;
    }
693793
@Override
  public long skip(long n) throws IOException {
    return n > 0 ? (long) inner.skip(Math.min(n, remaining)) : 0;
  }
880894
def lranksums(x,y):
    
    n1 = len(x)
    n2 = len(y)
    alldata = x+y
    ranked = rankdata(alldata)
    x = ranked[:n1]
    y = ranked[n1:]
    s = sum(x)
    expected = n1*(n1+n2+1) / 2.0
    z = (s - expected) / math.sqrt(n1*n2*(n1+n2+1)/12.0)
    prob = 2*(1.0 -zprob(abs(z)))
    return z, prob
1131055
public int get24( int x , int y ) {
		int i = startIndex + y*stride+x*3;
		return ((data[i]&0xFF) << 16) | ((data[i+1]&0xFF) << 8) | (data[i+2]&0xFF);
	}
68110
function moving_average(array, n) {
  var nums = [];

  for (i in array) {
    /* If this item in the array is a number */
    if (_.isNumber(array[i])) {
      nums.push(array[i]);
      if (nums.length > n) {
	nums.splice(0,1); /* Remove the first element of the array */
      }
      /* Take the average of the n items in this array */
      var sum = _.reduce(nums, function(memo, num){ return memo + num; }, 0);
      array[i] = sum/nums.length;
    }
  }

  return array;
}
637716
private final void primitiveLeftShift(int n) {
        int[] val = value;
        int n2 = 32 - n;
        for (int i=offset, c=val[i], m=i+intLen-1; i < m; i++) {
            int b = c;
            c = val[i+1];
            val[i] = (b << n) | (c >>> n2);
        }
        val[offset+intLen-1] <<= n;
    }
594567
public float getProgress() throws IOException {
    if (end == start) {
      return 0.0f;
    } else {
      return Math.min(1.0f, (in.getPosition() - start) / (float)(end - start));
    }
  }
336173
int getRowByYWithShift(int y, int shiftEveryStep) {
        checkForInit();
        int sum = 0;
        // header offset
        int tempY = y - mHeaderColumnHeight;
        if (tempY <= sum) {
            return 0;
        }
        for (int count = mRowHeights.length, i = 0; i < count; i++) {
            int nextSum = sum + mRowHeights[i] + shiftEveryStep;

            if (tempY > sum && tempY < nextSum) {
                return i;
            } else if (tempY < nextSum) {
                return i - 1;
            }
            sum = nextSum;
        }
        return mRowHeights.length - 1;
    }
1138665
def _compute_ymean(self, **kwargs):
        """"""
        y = np.asarray(kwargs.get('y', self.y))
        dy = np.asarray(kwargs.get('dy', self.dy))

        if dy.size == 1:
            return np.mean(y)
        else:
            return np.average(y, weights=1 / dy ** 2)
847755
def cnst_AT(self, Y):
        
        """

        return self.cnst_A0T(self.block_sep0(Y)) + \
            np.sum(self.cnst_A1T(self.block_sep1(Y)), axis=-1)
426514
def yn(n, x, context=None):
    
    return _apply_function_in_current_context(
        BigFloat,
        mpfr.mpfr_yn,
        (n, BigFloat._implicit_convert(x)),
        context,
    )
1225302
public PackedDecimal movePointLeft(int n) {
        BigDecimal result = toBigDecimal().movePointLeft(n);
        return PackedDecimal.valueOf(result);
    }
311498
def getTauLeibniz(n):
    
    myTau = tauGenLeibniz()
    result = []
    if n > 0:
        result += [next(myTau) for i in range(n)]
    myTau.close()
    return result
1258590
function() {
		var yOffset = _panOffset.y - self.currItem.initialPosition.y; // difference between initial and current position
		return 1 -  Math.abs( yOffset / (_viewportSize.y / 2)  );
	}
1228764
public static double[] toN(int n) {
        double[] result = new double[n];
        for (int i = 0; i < n; i++) {
            result[i] = i;
        }
        return result;
    }
1292557
@Override protected double[] score0(double[] data, double[] preds, double offset, int ntrees) {
    super.score0(data, preds, offset, ntrees);
    int N = _output._ntrees;
    if (_output.nclasses() == 1) { // regression - compute avg over all trees
      if (N>=1) preds[0] /= N;
    } else { // classification
      if (_output.nclasses() == 2 && binomialOpt()) {
        if (N>=1) {
          preds[1] /= N; //average probability
        }
        preds[2] = 1. - preds[1];
      } else {
        double sum = MathUtils.sum(preds);
        if (sum > 0) MathUtils.div(preds, sum);
      }
    }
    return preds;
  }