[Rcpp-devel] Detecting Singular Matrices in RcppArmadillo

Dirk Eddelbuettel edd at debian.org
Mon Jan 31 17:51:09 CET 2022


On 31 January 2022 at 11:25, Alex Ilich wrote:
| Thank you Zé and Dirk! That helped clarify exactly what solve is doing
| which I was having trouble tracking down in just the standard docs page.

The `solve()` function in Armadillo does exactly what it sets out to do.

Yet what Prof Bates has been hammering home for years is that how we use it
(and related functions) to fit linear models may have issues. See his code
here for alternatives:
  https://github.com/RcppCore/RcppEigen/blob/master/src/fastLm.h
  https://github.com/RcppCore/RcppEigen/blob/master/src/fastLm.cpp

Now, as I said, in practice you may get by if you're reasonably
careful. Double precision is hard to trick. But hey, it may happend, and we
all warned you :)

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org


More information about the Rcpp-devel mailing list