}
final SVDecompositionCommons svd = (SVDecompositionCommons) DecompositionFactory.SV_COMMONS;
//add the second derivative information to the Hessian matrix to check we are not at a local maximum or saddle point
final VectorFieldSecondOrderDifferentiator diff = new VectorFieldSecondOrderDifferentiator();
final Function1D<DoubleMatrix1D, DoubleMatrix2D[]> secDivFunc = diff.differentiate(func, constraints);
final DoubleMatrix2D[] secDiv = secDivFunc.evaluate(trialTheta);
final double[][] temp = new double[nParms][nParms];
for (int i = 0; i < nObs; i++) {
for (int j = 0; j < nParms; j++) {
for (int k = 0; k < nParms; k++) {