org.apache.commons.math.stat.correlation
Class StorelessCovariance

java.lang.Object
  extended by org.apache.commons.math.stat.correlation.Covariance
      extended by org.apache.commons.math.stat.correlation.StorelessCovariance

public class StorelessCovariance
extends Covariance

Covariance implementation that does not require input data to be stored in memory.

Since:
3.0
Version:
$Id: StorelessCovariance.java 1178235 2011-10-02 19:43:17Z luc $

Constructor Summary
StorelessCovariance(int rowDimension, int colDimension)
           
StorelessCovariance(int rowDimension, int colDimension, boolean biasCorrected)
           
 
Method Summary
 StorelessBivariateCovariance getCovariance(int xIndex, int yIndex)
           
 RealMatrix getCovarianceMatrix()
          Returns the covariance matrix
 double[][] getData()
           
 int getN()
          This Covariance method is not supported by StorelessCovariance, since the number of bivariate observations does not have to be the same for different pairs of covariates - i.e., N as defined in Covariance.getN() is undefined.
 void incrementCovariance(int xIndex, int yIndex, double x, double y)
           
 void incrementRow(double[] rowData)
           
 void setCovariance(int xIndex, int yIndex, StorelessBivariateCovariance cov)
           
 
Methods inherited from class org.apache.commons.math.stat.correlation.Covariance
computeCovarianceMatrix, computeCovarianceMatrix, computeCovarianceMatrix, computeCovarianceMatrix, covariance, covariance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StorelessCovariance

public StorelessCovariance(int rowDimension,
                           int colDimension)

StorelessCovariance

public StorelessCovariance(int rowDimension,
                           int colDimension,
                           boolean biasCorrected)
Method Detail

getCovariance

public StorelessBivariateCovariance getCovariance(int xIndex,
                                                  int yIndex)

setCovariance

public void setCovariance(int xIndex,
                          int yIndex,
                          StorelessBivariateCovariance cov)

incrementCovariance

public void incrementCovariance(int xIndex,
                                int yIndex,
                                double x,
                                double y)

incrementRow

public void incrementRow(double[] rowData)
                  throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

getCovarianceMatrix

public RealMatrix getCovarianceMatrix()
                               throws java.lang.IllegalArgumentException
Description copied from class: Covariance
Returns the covariance matrix

Overrides:
getCovarianceMatrix in class Covariance
Returns:
covariance matrix
Throws:
java.lang.IllegalArgumentException

getData

public double[][] getData()
                   throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

getN

public int getN()
         throws MathUnsupportedOperationException
This Covariance method is not supported by StorelessCovariance, since the number of bivariate observations does not have to be the same for different pairs of covariates - i.e., N as defined in Covariance.getN() is undefined.

Overrides:
getN in class Covariance
Returns:
nothing as this implementation always throws a MathUnsupportedOperationException
Throws:
MathUnsupportedOperationException - in all cases


Copyright © 2003-2011 The Apache Software Foundation. All Rights Reserved.