commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <>
Subject Re: [math] Unit Tests for Multivariate Distribution Sampling
Date Wed, 25 Jul 2012 16:18:19 GMT
On Wed, Jul 25, 2012 at 09:00:44AM -0500, Becksfort, Jared wrote:
> I have another question, this time about the API.  The covariance matrix of a multivariate
normal distribution is called sigma in a number of R libraries, but I am not sure it is called
that everywhere.  I named the parameters and get methods for the covariance matrix things
like "getSigma" but mentioned covariance matrix in the comments.  Do the developers here have
a preference between getSigma and getCovarianceMatrix?  I can change the parameters accordingly.

Referring to
you are right that the matrix is represented by the capital "Sigma" Greek

However, in other places in the CM's code, similar data are retrieved with
a method called "getCovariances()".[1]
IMO, it's clearer that the method name refers to the concept (covariance)
rather than the notation (Greek letter).

Hence, I propose to just change the method name:
  getSigma -> getCovariances
(and the name of the instance variable, to reduce possible confusion when
reading the code).

And instead of providing
  double[] getVariances()
(elements on the diagonal of the matrix),
I'd provided, as a convenience,
  double[] getStandardDeviation()
(square-root of the elements on the diagonal).


[1] org.apache.commons.math3.optimization.general.AbstractLeastSquaresOptimizer

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message