aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
KL Class Reference

KL is the base class for KL computation betweens 2 BNs. More...

#include <BNdistance.h>

Detailed Description

KL is the base class for KL computation betweens 2 BNs.

KL is not virtual because it may be instantiated but protected methods throw gum::OperationNotAllow : we do not know here how the computation is done. Since this computation may be very difficult, KL.Complexity() give an estimation ( KL_Complexity::Heavy,KL_Complexity::Difficult,KL_Complexity::Correct ) of the needed time. KL.process() computes KL(P||Q) using klPQ() and KL(Q||P) using klQP(). The computations are made once. The second is for free :)

It may happen that P*ln(P/Q) is not computable (Q=0 and P!=0). In such a case, KL keeps working but trace this error (errorPQ() and errorQP())?


The documentation for this class was generated from the following file: