Update functions.R

ploglik absolute value for quadratic form of Lmatrix, since Lmatrix might not be positive-definite