number specifying the tolerance to use, see Details
below.
Value
a matrix of the same dimensions and the same diagonal
(i.e. diag) as m but with the property to
be positive definite.
Details
We form the eigen decomposition
$$m = V \Lambda V'$$ where $\Lambda$ is the
diagonal matrix of eigenvalues, $\Lambda_{j,j} = \lambda_j$, with decreasing eigenvalues $\lambda_1 \ge
\lambda_2 \ge \ldots \ge \lambda_n$.
When the smallest eigenvalue $\lambda_n$ are less than
Eps <- eps.ev * abs(lambda[1]), i.e., negative or almost
zero, some or all eigenvalues are replaced by positive
(>= Eps) values,
$\tilde\Lambda_{j,j} = \tilde\lambda_j$.
Then, $\tilde m = V \tilde\Lambda V'$ is computed
and rescaled in order to keep the original diagonal (where that is
>= Eps).