Skip to content

Efficient matrix computations

4 messages · Shimrit Abraham, Dimitris Rizopoulos

#
it would be a bit more helpful if we knew more info regarding these 
matrices, for instance is P diagonal, etc. In any case, you could have a 
look at

crossprod()
# and
tcorssprod()

and, for the determinant maybe

prod(eigen(mat, symmetric = TRUE, only.values = FALSE)$values)
# or
prod(diag(chol(mat)))^2

are a bit faster than det(), but I haven't tested it.

I hope it helps.

Best,
Dimitris
Shimrit Abraham wrote:

  
    
#
sorry, in my previous e-mail it should be

tcrossprod()
# and
prod(eigen(mat, symmetric = TRUE, only.values = TRUE)$values)


Best,
Dimitris
Shimrit Abraham wrote: