You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Xiangrui Meng (JIRA)" <ji...@apache.org> on 2015/10/08 01:00:29 UTC

[jira] [Updated] (SPARK-10875) RowMatrix.computeCovariance() result is not exactly symmetric

     [ https://issues.apache.org/jira/browse/SPARK-10875?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xiangrui Meng updated SPARK-10875:
----------------------------------
            Shepherd: Xiangrui Meng
    Target Version/s: 1.6.0

> RowMatrix.computeCovariance() result is not exactly symmetric
> -------------------------------------------------------------
>
>                 Key: SPARK-10875
>                 URL: https://issues.apache.org/jira/browse/SPARK-10875
>             Project: Spark
>          Issue Type: Bug
>          Components: MLlib
>    Affects Versions: 1.5.0
>            Reporter: Nick Pritchard
>            Assignee: Nick Pritchard
>            Priority: Minor
>
> For some matrices, I have seen that the computed covariance matrix is not exactly symmetric, most likely due to some numerical rounding errors. This is problematic when trying to construct an instance of {{MultivariateGaussian}}, because it requires an exactly symmetric covariance matrix. See reproducible example below.
> I would suggest modifying the implementation so that {{G(i, j)}} and {{G(j, i)}} are set at the same time, with the same value.
> {code}
> val rdd = RandomRDDs.normalVectorRDD(sc, 100, 10, 0, 0)
> val matrix = new RowMatrix(rdd)
> val mean = matrix.computeColumnSummaryStatistics().mean
> val cov = matrix.computeCovariance()
> val dist = new MultivariateGaussian(mean, cov) //throws breeze.linalg.MatrixNotSymmetricException
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org