ginv2 | R Documentation |
This function is a wrapper for MASS::ginv
and calculates the generalized inverse of x
.
ginv2(x, as_fractions = TRUE)
x |
The original matrix |
as_fractions |
Whether to format the matrix as fractions (MASS package) |
In addition to MASS::ginv
, this function rounds values, formats the matrix as fractions and copies dimension names from the original matrix.
Generalized inverse of x
ginv
h <- hypr(mu1~0, mu2~mu1)
hmat(h)
ginv2(hmat(h))
cmat(h)
# cmat is effectively the generalized inverse of hmat
stopifnot(all.equal(
`class<-`(ginv2(hmat(h)), "matrix"),
`class<-`(cmat(h), "matrix"), check.attributes = FALSE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.