3#ifndef cMHN_COMMON_LEARN_INDEPENDENCE_MODEL_H
4#define cMHN_COMMON_LEARN_INDEPENDENCE_MODEL_H
19 template<
class T,
class S>
21 std::map<S, T>
const &pD)
23 constexpr pRC::Index
D =
typename S::Dimension();
25 pRC::Tensor<T, D, D> theta = pRC::zero();
27 for(
auto const &[index, value] : pD)
29 for(pRC::Index i = 0; i <
D; ++i)
38 diagonal(log(theta / (pRC::unit<pRC::Tensor<T, D, D>>() - theta)));
pRC::Size const D
Definition: CalculatePThetaTests.cpp:9
Definition: calculate_pTheta.hpp:15
static auto learnIndependenceModel(std::map< S, T > const &pD)
Calculate the theta matrix corresponding to the independence model for a given data distribution.
Definition: learn_independence_model.hpp:20