Added calculation of cov matrix.

For nelder-mead calculate the cov matrix usinv the covmatrix package