Alla Bulashevska
2009-Nov-18 14:10 UTC
[R] Error "system is computationally singular" by using function dmvnorm
Dear R users, i try to use function dmvnorm(x, mean, sigma, log=FALSE) from R package mvtnorm to calculate the probability of x under the multivariate normal distribution with mean equal to mean and covariance matrix sigma. I become the following Error in solve.default(cov, ...) : system is computationally singular: reciprocal condition number = 1.81093e-19 What could be the reason of it? Thank you in Advance, Alla.
Ravi Varadhan
2009-Nov-18 14:50 UTC
[R] Error "system is computationally singular" by using function dmvnorm
It means that your covariance matrix "sigma" is numerically singular. Ravi. ---------------------------------------------------------------------------- ------- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology Johns Hopkins University Ph: (410) 502-2619 Fax: (410) 614-9625 Email: rvaradhan at jhmi.edu Webpage: http://www.jhsph.edu/agingandhealth/People/Faculty_personal_pages/Varadhan.h tml ---------------------------------------------------------------------------- -------- -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Alla Bulashevska Sent: Wednesday, November 18, 2009 9:11 AM To: r-help at r-project.org Subject: [R] Error "system is computationally singular" by using function dmvnorm Dear R users, i try to use function dmvnorm(x, mean, sigma, log=FALSE) from R package mvtnorm to calculate the probability of x under the multivariate normal distribution with mean equal to mean and covariance matrix sigma. I become the following Error in solve.default(cov, ...) : system is computationally singular: reciprocal condition number = 1.81093e-19 What could be the reason of it? Thank you in Advance, Alla. ______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Uwe Ligges
2009-Nov-19 17:44 UTC
[R] Error "system is computationally singular" by using function dmvnorm
Alla Bulashevska wrote:> Dear R users, > i try to use function dmvnorm(x, mean, sigma, log=FALSE) > from R package mvtnorm to calculate the probability of x > under the multivariate normal distribution with mean equal > to mean and covariance matrix sigma. > I become the following > Error in solve.default(cov, ...) : > system is computationally singular: reciprocal condition > number = 1.81093e-19Probably your sigma is almost singular and can't be inverted in the calculation of the Mahalanobis distance. Uwe Ligges> > What could be the reason of it? > Thank you in Advance, > Alla. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.