tttrlib
A library for time-tagged time resolved data
Loading...
Searching...
No Matches
Namespaces | Functions
DecayStatistics.h File Reference
#include <cmath>
#include <vector>
#include <numeric>
#include <algorithm>
#include <iostream>
#include <cstring>

Go to the source code of this file.

Namespaces

namespace  statistics
 

Functions

void init_fact ()
 
double loggammaf (double t)
 
double wcm (int C, double m)
 
double wcm_p2s (int C, double mp, double ms)
 
double Wcm_p2s (int *C, double *M, int Nchannels)
 
double twoIstar_p2s (int *C, double *M, int Nchannels)
 
double twoIstar (int *C, double *M, int Nchannels)
 
double Wcm (int *C, double *M, int Nchannels)
 
double statistics::neyman (double *data, double *model, int start, int stop)
 
double statistics::poisson (double *data, double *model, int start, int stop)
 
double statistics::pearson (double *data, double *model, int start, int stop)
 
double statistics::gauss (double *data, double *model, int start, int stop)
 
double statistics::cnp (double *data, double *model, int start, int stop)
 
double statistics::sswr (double *data, double *model, double *data_noise, int start, int stop)
 Sum of squared weighted residuals.
 
double statistics::chi2_counting (std::vector< double > &data, std::vector< double > &model, std::vector< double > &weights, int x_min=-1, int x_max=-1, const char *type="neyman")
 Computes different chi2 measures for counting data.
 

Function Documentation

◆ init_fact()

void init_fact ( )

Initialize an array containing pre-computed logratithms

◆ loggammaf()

double loggammaf ( double t)

Approximation of log(gamma function). See wikipedia

https://en.wikipedia.org/wiki/Gamma_function#The_log-gamma_function

Parameters
tinput of the gamma function
Returns
approximation of the logarithm of the gamma function

◆ twoIstar()

double twoIstar ( int * C,
double * M,
int Nchannels )

Compute overall 2I* for Cp & Cs

This function computes 2I* for Cp and Cs. Cp and Cs are the model signals in the parallel and perpendicular channel. Contrary to twoIstar_p2s the overall 2I* is the sum of 2I* for Cp and Cs.

Parameters
Carray of experimental counts in Jordi format
Marray model function in Jordi format
Nchannelsnumber of micro time channels in parallel and perpendicular (half the number of elements in C and M).
Returns
2I* for Cp & Cs

◆ twoIstar_p2s()

double twoIstar_p2s ( int * C,
double * M,
int Nchannels )

Compute overall 2I* for Cp + 2Cs

This function computes the overall 2I* for the model function Cp + 2Cs that is computed by parallel signal (Cp) and the perpendicular signal (Cs). For the definition of function 2I* see "An Experimental Comparison of the Maximum Likelihood Estimation and Nonlinear Least-Squares Fluorescence Lifetime Analysis of Single Molecules, Michael Maus, Mircea Cotlet, Johan Hofkens, Thomas Gensch, Frans C. De Schryver, J. Schaffer, and C. A. M. Seidel, Anal. Chem. 2001, 73, 9, 2078–2086".

Parameters
Carray of experimental counts in Jordi format
Marray model function in Jordi format
Nchannelsnumber of micro time channels in parallel and perpendicular (half the number of elements in C and M).
Returns
2I* for Cp + 2Cs

◆ Wcm()

double Wcm ( int * C,
double * M,
int Nchannels )

Compute overall -log-likelihood for Cp & Cs

Parameters
Carray of experimental counts in Jordi format
Marray model function in Jordi format
Nchannelsnumber of micro time channels in parallel and perpendicular (half the number of elements in C and M).
Returns
-log-likelihood for Cp & Cs

◆ wcm()

double wcm ( int C,
double m )

log-likelihood w(C|m) for Cp + 2Cs

Parameters
Cnumber of counts in channel
mmodel function
Returns
log-likelihood w(C|m) for Cp + 2Cs

◆ Wcm_p2s()

double Wcm_p2s ( int * C,
double * M,
int Nchannels )

Compute the overall -log-likelihood for Cp + 2Cs for all micro time channels

Parameters
Carray of experimental counts in Jordi format
Marray model function in Jordi format
Nchannelsnumber of micro time channels in parallel and perpendicular (half the number of elements in C and M).
Returns
-log-likelihood for Cp + 2Cs for all micro time channels

◆ wcm_p2s()

double wcm_p2s ( int C,
double mp,
double ms )

Compute the -log-likelihood for Cp + 2Cs of a single micro time channel.

Compute score of model counts in a parallel and perpendicular detection channel and the experimental counts for a micro time channel.

This function computes a score for the experimental counts (C) in a channel where the experimental counts were computed by the sum of the counts in the parallel (P) and the perpendicular (S) channel by the equation C = P + 2 S.

This function considers that the number of counts C = P + 2S is not Poissonian. The score relates to a maximum likelihood function.

Parameters
Cnumber of experimental counts (P + 2 S) in a micro time channel
mpnumber of counts of the model in parallel detection channel
msnumber of counts of the model in the perpendicular detection channel
Returns