R/inv.R

inv <-
function (a)
{
  if(!any(is.na(a)))
    #Find the upper triangular matrix of X and estimate the inverse
    #of X from this matrix
    chol2inv(chol(a))
  else
    #If NA values in matrix, return NA matrix
    matrix(NA, nrow = dim(a)[1], ncol = dim(a)[2])
}

Try the lmf package in your browser

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

lmf documentation built on June 24, 2022, 5:06 p.m.