Equilibrium vectors¶
The start and end equilibrium vectors can be computed in two ways depending on the burst/cluster nature. They can be the equilibrium vectors determined from the equation:
subject to the constraints,
Where \({}^e\mathcal{G}_{AF}\) and \({}^e\mathcal{G}_{FA}\) are the laplacians of the missed-events transition densities \({}^e\mathcal{G}(t)\) (or equivalently, the ideal transition densities) for \(s=0\), and \([a]_i\) indicates the \(i^{th}\) component of vector \(a\).
On the other hand equilibrium vectors can be computed as CHS vectors, e.g. equation 5.11 and 5.8 from [CHS96].
The vectors are accessed differently in C++ and in Python.
- Python:
The equilibrium vectors are accessed as properties of
IdealGandMissedEventsGinstances. The CHS vectors are functions of these same classes that take as arguments the critical time.from HJCFIT.likelihood import QMatrix, IdealG, MissedEventsG # Define parameters. qmatrix = QMatrix([ [-3050, 50, 3000, 0, 0], [2./3., -1502./3., 0, 500, 0], [ 15, 0, -2065, 50, 2000], [ 0, 15000, 4000, -19000, 0], [ 0, 0, 10, 0, -10] ], 2) tau = 1e-4 eG = MissedEventsG(qmatrix, tau) idealG = IdealG(qmatrix) tcritical = 5e-3 print("Equilibrium Vectors\n" \ "=======================\n\n" \ "Ideal Likelihood\n" \ "----------------\n\n" \ " * initial: {ideal_initial!r}\n" \ " * final: {ideal_final!r}\n\n\n" \ "Missed-events Likelihood\n" \ "------------------------\n\n" \ " * initial: {equi_initial!r}\n" \ " * final: {equi_final!r}\n\n\n\n" \ "CHS Vectors\n" \ "===============\n\n" \ "Missed-events Likelihood\n" \ "------------------------\n\n" \ " * tcritical: {tcritical}\n" \ " * initial: {chs_initial!r}\n" \ " * final: {chs_final!r}" \ .format( ideal_initial = idealG.initial_vectors, ideal_final = idealG.final_vectors, equi_initial = eG.initial_vectors, equi_final = eG.final_vectors, chs_initial = eG.initial_CHS_vectors(tcritical), chs_final = eG.final_CHS_vectors(tcritical), tcritical = tcritical ) )
- C++11:
All vectors are accessed via function calls acting on the
IdealGandMissedEventsG.#include <iostream> #include <likelihood/missed_eventsG.h> #include <likelihood/idealG.h> #include <likelihood/vectors.h> int main() { // Define parameters. HJCFIT::t_rmatrix matrix(5 ,5); matrix << -3050, 50, 3000, 0, 0, 2./3., -1502./3., 0, 500, 0, 15, 0, -2065, 50, 2000, 0, 15000, 4000, -19000, 0, 0, 0, 10, 0, -10; HJCFIT::QMatrix qmatrix(matrix, /*nopen=*/2); HJCFIT::t_real const tau(1e-4); // in seconds // Create missed-events G HJCFIT::MissedEventsG eG(qmatrix, tau); // Create ideal G HJCFIT::IdealG idealG(qmatrix); HJCFIT::t_real const tcritical(5e-3); std::cout << "Equilibrium vectors\n" << "=======================\n\n" << "Ideal Likelihood\n" << "----------------\n\n" << " * initial: " << HJCFIT::vectors(idealG) << "\n" << " * final: " << HJCFIT::vectors(idealG, false) << "\n\n\n" << "Missed-events Likelihood\n" << "------------------------\n\n" << " * initial: " << HJCFIT::vectors(eG) << "\n" << " * final: " << HJCFIT::vectors(eG, false) << "\n\n\n\n" << "CHS vectors\n" << "===============\n\n" << "Missed-events Likelihood\n" << "------------------------\n\n" << " * tcritical: " << tcritical << "\n" << " * initial: " << HJCFIT::CHS_vectors(eG, tcritical) << "\n" << " * final: " << HJCFIT::CHS_vectors(eG, tcritical, false) << "\n"; return 0; }
In C++, the vectors are kept outside of the classes because computing these values is outside the pure remit of the classes (which is to compute the likelihood). However, in Python, practicality beats purity, and it makes practical sense to keep likelihood and equilibrium vectors together.
Note
Log10Likelihood() uses equilibrium vectors depending on the
value of its attribute tcritical:
if it is
None,numpy.nan, or negative, then the equilibrium vectors are used;if it is a strictly positive real number, then the CHS vectors are computed.