DeterminantEq

class dcprogs.likelihood.DeterminantEq(*args)[source]

Compute determinant W needed to approximate missed event G

This object can be instantiated from a square matrix, the number of open states, and the resolution, or maximum length of missed events \(\tau\):

>>> DeterminantEq(matrix, nopen, tau)

or, it can be instantiated from a QMatrix instance and \(\tau\)

>>> DeterminantEq(qmatrix, tau)
Parameters:
  • matrix – Transition rate matrix, where the upper left corner contain open-open transitions
  • nopen (integer) – Number of open states in the transition matrix.
  • qmatrixQMatrix instance
  • tau (number) – Max length of missed events.
H(self, s) → DCProgs::t_rmatrix[source]

H(self, s, tau) -> DCProgs::t_rmatrix Computes the matrix H

H is defined as \(\mathcal{Q}_{AA} + \mathcal{Q}_{AF}\ \int_0^\tau e^{-st}e^{\mathcal{Q}_{FF}t}\partial\,t\ \mathcal{Q}_{FA}\).

Parameters:
  • s (number) – The laplace scale. It can be a scalar or a numpy array of any shape. In the latter case, the return is a array of the same shape where each element is a matrix corresponding to the element in the input array.
  • tau (number) – Optional. If present, it is the max length of missed events.
Returns:

a numpy array.

__call__(*args)[source]

Computes determinant W

Parameters:
s: scalar, tuple, list, array
The laplace scale.
tau: optional number
If present, it is the max length of missed events.

Returns: If a scalar, returns a scalar. Otherwise returns a numpy array.

s_derivative(self, s) → DCProgs::t_rmatrix[source]

s_derivative(self, s, tau) -> DCProgs::t_rmatrix Computes the derivative of H versus s

H is defined as \(\mathcal{Q}_{AA} + \mathcal{Q}_{AF}\ \int_0^\tau e^{-st}e^{\mathcal{Q}_{FF}t}\partial\,t\ \mathcal{Q}_{FA}\).

Parameters:
  • s (number) – The laplace scale. It can be a scalar or a numpy array of any shape. In the latter case, the return is a array of the same shape where each element is a matrix corresponding to the element in the input array.
  • tau (number) – Optional. If present, it is the max length of missed events.
Returns:

a numpy array.

tau

Max length of mixed events.