Class StorelessBivariateCovariance

    • Field Detail

      • meanX

        private double meanX
        the mean of variable x
      • meanY

        private double meanY
        the mean of variable y
      • n

        private double n
        number of observations
      • covarianceNumerator

        private double covarianceNumerator
        the running covariance estimate
      • biasCorrected

        private boolean biasCorrected
        flag for bias correction
    • Constructor Detail

      • StorelessBivariateCovariance

        StorelessBivariateCovariance​(boolean biasCorrection)
        Create an empty StorelessBivariateCovariance instance.
        Parameters:
        biasCorrection - if true the covariance estimate is corrected for bias, i.e. n-1 in the denominator, otherwise there is no bias correction, i.e. n in the denominator.
    • Method Detail

      • increment

        public void increment​(double x,
                              double y)
        Update the covariance estimation with a pair of variables (x, y).
        Parameters:
        x - the x value
        y - the y value
      • append

        public void append​(StorelessBivariateCovariance cov)
        Appends another bivariate covariance calculation to this. After this operation, statistics returned should be close to what would have been obtained by by performing all of the increment(double, double) operations in cov directly on this.
        Parameters:
        cov - StorelessBivariateCovariance instance to append.
      • getN

        public double getN()
        Returns the number of observations.
        Returns:
        number of observations