Skip to content

Commit 5a65ecb

Browse files
committed
Update fastLm.Rd reflecting earlier solve() changes
1 parent 66dcdb5 commit 5a65ecb

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2025-06-21 Dirk Eddelbuettel <edd@debian.org>
2+
3+
* man/fastLm.Rd: Update discussion of rank-deficient systems to note
4+
that newer Armadillo versions warn and fall back to approx solution
5+
16
2025-05-21 Dirk Eddelbuettel <edd@debian.org>
27

38
* DESCRIPTION (Version, Date): RcppArmadillo 14.4.3-1

man/fastLm.Rd

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,14 @@ fastLm(X, \dots)
3838
\code{\link{lm}} and friends versus this approach based on
3939
\code{Armadillo}. The reason that \code{Armadillo} can do something
4040
like \code{\link{lm.fit}} faster than the functions in the stats
41-
package is because \code{Armadillo} uses the Lapack version of the QR
42-
decomposition while the stats package uses a \emph{modified} Linpack
43-
version. Hence \code{Armadillo} uses level-3 BLAS code whereas the
44-
stats package uses level-1 BLAS. However, \code{Armadillo} will
41+
package is because \code{Armadillo} can use different solvers, including
42+
fast / approximative ones. Older versions of Armadillo could therefore
4543
either fail or, worse, produce completely incorrect answers
4644
on rank-deficient model matrices whereas the functions from the stats
4745
package will handle them properly due to the modified Linpack code.
46+
Newer Armadillo version pivot (with warning) to an approximate solutions.
47+
This behavior can be control with options to the \code{solve} function,
48+
see the Armadillo documentation.
4849

4950
An example of the type of situation requiring extra care in checking
5051
for rank deficiency is a two-way layout with missing cells (see the
@@ -60,7 +61,7 @@ fastLm(X, \dots)
6061

6162
\code{fastLm} returns a richer object which also includes the
6263
residuals, fitted values and call argument similar to the \code{\link{lm}} or
63-
\code{\link[MASS]{rlm}} functions..
64+
\code{\link[MASS]{rlm}} functions.
6465
}
6566
\seealso{\code{\link{lm}}, \code{\link{lm.fit}}}
6667
\references{Armadillo project: \url{https://arma.sourceforge.net/}}
@@ -93,7 +94,7 @@ fastLm(X, \dots)
9394
set.seed(1)
9495
dd$y <- mm \%*\% seq_len(ncol(mm)) + rnorm(nrow(mm), sd = 0.1)
9596
summary(lm(y ~ f1 * f2, dd)) # detects rank deficiency
96-
summary(fastLm(y ~ f1 * f2, dd)) # some huge coefficients
97+
summary(fastLm(y ~ f1 * f2, dd)) # fits all coefficients via approx solution
9798

9899
\dontshow{armadillo_reset_cores()}
99100
}

0 commit comments

Comments
 (0)