private void EvaluateCovariance(IObjectiveModel objective) { objective.EvaluateAt(objective.Point); // Hessian may be not yet updated. var Hessian = objective.Hessian; if (Hessian == null || objective.DegreeOfFreedom < 1) { Covariance = null; Correlation = null; StandardErrors = null; return; } Covariance = Hessian.PseudoInverse() * objective.Value / objective.DegreeOfFreedom; if (Covariance != null) { StandardErrors = Covariance.Diagonal().PointwiseSqrt(); var correlation = Covariance.Clone(); var d = correlation.Diagonal().PointwiseSqrt(); var dd = d.OuterProduct(d); Correlation = correlation.PointwiseDivide(dd); } else { StandardErrors = null; Correlation = null; } }
protected double EvaluateFunction(IObjectiveModel objective, Vector <double> Pint) { var Pext = ProjectToExternalParameters(Pint); objective.EvaluateAt(Pext); return(objective.Value); }