Search in sources :

Example 1 with FixedNonLinearFunction

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();
}
Also used : FixedNonLinearFunction(gdsc.smlm.function.FixedNonLinearFunction) PoissonGammaGaussianLikelihoodWrapper(gdsc.smlm.function.PoissonGammaGaussianLikelihoodWrapper) PoissonGaussianLikelihoodWrapper(gdsc.smlm.function.PoissonGaussianLikelihoodWrapper) PoissonLikelihoodWrapper(gdsc.smlm.function.PoissonLikelihoodWrapper) LikelihoodWrapper(gdsc.smlm.function.LikelihoodWrapper)

Aggregations

FixedNonLinearFunction (gdsc.smlm.function.FixedNonLinearFunction)1 LikelihoodWrapper (gdsc.smlm.function.LikelihoodWrapper)1 PoissonGammaGaussianLikelihoodWrapper (gdsc.smlm.function.PoissonGammaGaussianLikelihoodWrapper)1 PoissonGaussianLikelihoodWrapper (gdsc.smlm.function.PoissonGaussianLikelihoodWrapper)1 PoissonLikelihoodWrapper (gdsc.smlm.function.PoissonLikelihoodWrapper)1