use of gdsc.smlm.function.FixedNonLinearFunction in project GDSC-SMLM by aherbert.
the class MaximumLikelihoodFitter method computeObservedLogLikelihood.
@Override
protected double computeObservedLogLikelihood(double[] y, double[] a) {
if (lastY != null) {
final int n = y.length;
LikelihoodWrapper maximumLikelihoodFunction = createLikelihoodWrapper(new FixedNonLinearFunction(y), n, y, a);
final double l = maximumLikelihoodFunction.likelihood(a);
if (l == Double.POSITIVE_INFINITY)
return Double.NEGATIVE_INFINITY;
// Reverse negative log likelihood for maximum likelihood score
value = -l;
}
throw new IllegalStateException();
}
Aggregations