<div dir="auto">Very interesting, Dirk. Thanks!</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 31, 2022 at 12:18 PM Dirk Eddelbuettel <<a href="mailto:edd@debian.org">edd@debian.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><br>
On 31 January 2022 at 09:13, Zé Vinícius wrote:<br>
| Yes, quoting the paper on which ‘solve’ is based on (<br>
| <a href="http://arma.sourceforge.net/armadillo_solver_2020.pdf" rel="noreferrer" target="_blank">http://arma.sourceforge.net/armadillo_solver_2020.pdf</a>):<br>
| <br>
| “The SVD-based solver uses the xGELSD set of functions, which find a<br>
| minimum-norm solution to a linear least squares problem.”<br>
<br>
Yes. A longer story though on how this is not what may matter. I should start<br>
by saying that I never found really decent documentation describing this<br>
'split' in the world view as this problem is, in essence, seen differently by<br>
numerical analysis specialists (as for example the LAPACK authors of the<br>
*GELSD functions) and the statistical users which differs in what they focus<br>
on. Which is why R uses a modified version of LINPACK (as I recall going back<br>
to by Ross Ihaka) when computing lm(). And not the LAPACK routines.<br>
<br>
Doug was always adamant about this when I wrote the different simple fastLm()<br>
approaches (in RcppGSL, RcppArmadillo, ...) which do _not_ properly account<br>
for rank-deficiency (as R's lm() would) -- Doug also wrote the nicest fastLm<br>
example in RcppEigen.<br>
<br>
There is a little bit more in the help pages for the various lmFast()<br>
versions as well as an explicit example (also due to Doug).<br>
<br>
Now, I should add that whenever I tried to construct an example on a more<br>
real-world-alike regression problem, I could not come anywhere close to<br>
actually seeing the rank deficiency. But it is unmistakenly there is the<br>
appropriately created case. So buyer beware.<br>
<br>
Dirk<br>
<br>
-- <br>
<a href="https://dirk.eddelbuettel.com" rel="noreferrer" target="_blank">https://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a><br>
</blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Zé Vinícius<div><a href="https://mirca.github.io" target="_blank">https://mirca.github.io</a></div></div></div>