133 SIZE_CHECK(statistics.size1() == state.size1());
134 SIZE_CHECK(statistics.size2() == state.size2());
138 for(std::size_t s = 0; s != state.size1();++s){
139 for(std::size_t i = 0; i != state.size2();++i){
145 for(
size_t s = 0; s != state.size1(); ++s){
146 for (
size_t i = 0; i != state.size2(); i++) {
147 double prob = statistics(s,i);
148 if (state(s,i) == 0) {
150 prob = (1. - alpha) * prob + alpha * prob / (1. - prob);
152 prob = (1. - alpha) * prob + alpha;
156 prob = (1. - alpha) * prob + alpha * (1. - (1. - prob) / prob);
158 prob = (1. - alpha) * prob;
177 SIZE_CHECK(statistics.size1() == state.size1());
178 SIZE_CHECK(statistics.size2() == state.size2());
180 RealVector logProbabilities(state.size1(),1.0);
181 for(std::size_t s = 0; s != state.size1();++s){
182 for(std::size_t i = 0; i != state.size2();++i){
183 logProbabilities(s) += (state(s,i) > 0.0)? std::log(statistics(s,i)) : std::log(1-statistics(s,i));
186 return logProbabilities;