force.defpos(m, tol = 0.001, debug = FALSE)
TRUE
, it is checked that the output matrix
is positive definite.maxlik.fd.scoring
requires a positive definite matrix
to project the gradient into the optimal direction.
If that matrix happens to be non-positive definite then the matrix
$M$ is transformed as described in Pollock (1999) pp. 341-342:$$M = M + (\mu - \kappa) I$$where $I$ is the identity matrix, $\mu$ is a tolerance value and
$\kappa$ is the smallest eigenvalue of $M$.Other alternatives are discussed in Nocedal and Wright (2006) chapter 3.Pollock, D.S.G. (1999). A Handbook of Time-Series Analysis Signal Processing and Dynamics. Academic Press.