Search in sources :

Example 1 with MLEGradientCalculator

use of gdsc.smlm.fitting.nonlinear.gradient.MLEGradientCalculator in project GDSC-SMLM by aherbert.

the class NonLinearFit method computeDeviations.

/**
	 * Compute the parameter deviations using the covariance matrix of the solution
	 *
	 * @param a_dev
	 *            the a dev
	 * @return true, if successful
	 */
private boolean computeDeviations(double[] a_dev) {
    if (isMLE()) {
        // The Hessian matrix refers to the log-likelihood ratio.
        // Compute and invert a matrix related to the Poisson log-likelihood.
        // This assumes this does achieve the maximum likelihood estimate for a 
        // Poisson process.
        MLEGradientCalculator c = (MLEGradientCalculator) calculator;
        double[][] I = c.fisherInformationMatrix(lastY.length, null, func);
        // Use a dedicated solver optimised for inverting the matrix diagonal 
        FisherInformationMatrix m = new FisherInformationMatrix(I);
        setDeviations(a_dev, m.crlb(true));
    } else {
        // Use a dedicated solver optimised for inverting the matrix diagonal. 
        FisherInformationMatrix m = new FisherInformationMatrix(alpha);
        setDeviations(a_dev, m.crlb(true));
    }
    return true;
}
Also used : FisherInformationMatrix(gdsc.smlm.fitting.FisherInformationMatrix) MLEGradientCalculator(gdsc.smlm.fitting.nonlinear.gradient.MLEGradientCalculator)

Aggregations

FisherInformationMatrix (gdsc.smlm.fitting.FisherInformationMatrix)1 MLEGradientCalculator (gdsc.smlm.fitting.nonlinear.gradient.MLEGradientCalculator)1