R/ginv.R

`ginv` <-
function (m) 
{
    temp <- eigen(m, symmetric = TRUE)
    va <- temp$values
    ve <- temp$vectors
    va <- ifelse((abs(va) < 1e-09), 0, 1/va)
    va2 <- 0 * m
    diag(va2) <- va
    ve %*% va2 %*% t(ve)
}

Try the ecespa package in your browser

Any scripts or data that you put into this service are public.

ecespa documentation built on Jan. 6, 2023, 1:21 a.m.