Hi Noah, Could you please show us what you did? I can not reproduce your problem (sessionInfo below):
> m <- matrix(scan(), ncol = 4, byrow = TRUE) 1: 0.99252358 0.93715047 0.7540535 0.4579895 5: 0.01607797 0.09616267 0.2452471 0.3088614 9: 0.09772828 0.58451468 1.4907090 1.8773815 13: -0.01000000 0.00000000 0.0900000 0.1700000 17: Read 16 items > m [,1] [,2] [,3] [,4] [1,] 0.99252358 0.93715047 0.7540535 0.4579895 [2,] 0.01607797 0.09616267 0.2452471 0.3088614 [3,] 0.09772828 0.58451468 1.4907090 1.8773815 [4,] -0.01000000 0.00000000 0.0900000 0.1700000 > solve(m) [,1] [,2] [,3] [,4] [1,] 1.4081192 -7826819 1287643 21.5115344 [2,] -0.3987761 18796863 -3092403 -25.7757002 [3,] -0.1208272 -18836093 3098860 -0.9159397 [4,] 0.1467979 9511648 -1564829 7.6326466 > sessionInfo() R version 2.11.1 Patched (2010-05-31 r52180) x86_64-apple-darwin9.8.0 locale: [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] fortunes_1.4-0 loaded via a namespace (and not attached): [1] tools_2.11.1 HTH, Jorge On Sat, Nov 20, 2010 at 11:55 PM, Noah Silverman <> wrote: > Hi, > > I'm trying to use the solve() function in R to invert a matrix. I get > the following error, "Lapack routine dgesv: system is exactly singular" > > However, My matrix doesn't appear to be singular. > > [,1] [,2] [,3] [,4] > [1,] 0.99252358 0.93715047 0.7540535 0.4579895 > [2,] 0.01607797 0.09616267 0.2452471 0.3088614 > [3,] 0.09772828 0.58451468 1.4907090 1.8773815 > [4,] -0.01000000 0.00000000 0.0900000 0.1700000 > > > Can anyone help me understand what is happening here? > > Thanks! > > -N > > ______________________________________________ > R-help@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. > [[alternative HTML version deleted]] ______________________________________________ R-help@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.