Log10Likelihood

The purpose of this class is to provide an interface for maximizing the likelihood. It computes, for a given set of observed open and shut intervals, the likelihood \(\frac{\ln(L(Q))}{ln 10}\), where \(L(Q)\) is declared in the likelihood equation.

class dcprogs.likelihood.Log10Likelihood(bursts, nopen, tau, tcritical=None, nmax=3, xtol=1e-10, rtol=1e-10, itermax=100, lower_bound=None, upper_bound=None)[source]

Creates a functor for optimizing the likelihood.

This functor can as input a \(\mathcal{Q}\)-matrix and returns the resulting likelihood. The root finding process is performed by find_roots(). Most of the arguments to initialize this functor are parameters for that process.

nopen

Number of open states. Should be strictly positive.

tau

Maximum length of missed events. Should be positive.

tcritical

\(t_{\mathrm{crit}}\) for CHS vectors. If negative, None, or NaN, then the initial and final states are the equilibrium occupancies.

nmax

The exact missed-events likelihood will be computed for \(t < n_{\mathrm{max}} au\).

xtol

Tolerance criteria when computing roots via likelihood.brentq().

rtol

Tolerance criteria when computing roots via likelihood.brentq().

itermax

Maximum number of iterations when computing roots via likelihood.brentq().

lower_bound

Lower bound bracketing all roots. If None or NaN, then the lower bound will be computed during calls by find_lower_bound_for_root()

upper_bound

Upper bound bracketing all roots. If None or NaN, then the upper bound will be computed during calls by find_upper_bound_for_root()

__call__(self, _Q) → DCProgs::t_real[source]

Computes the \(log_{10}\)-likelihood for the input Q-matrix

Parameters:matrix – Can be either a square numpy array or a QMatrix object. In the first case, the number of open states is set to attribute nopen.
insert()[source]

Inserts a burst at given index.

vector(self, _Q) → DCProgs::t_rvector[source]

Computes the \(log_{10}\)-likelihood for each individual burst

The sum over the return of this function is the return of __call__(). This is merely a convenience function if one wants the likelihood associate with each burst

Parameters:matrix – Can be either a square numpy array or a QMatrix object. In the first case, the number of open states is set to attribute nopen.
Returns:A numpy array where each component contains the \(log_{10}\) likelihood of a single burst.