111 SIZE_CHECK(statistics.size1() == state.size1());
112 SIZE_CHECK(statistics.size2() == state.size2());
116 for(std::size_t s = 0; s != state.size1();++s){
117 for(std::size_t i = 0; i != state.size2();++i){
119 if(state(s,i)==0) state(s,i)=-1.;
124 for(
size_t s = 0; s != state.size1(); ++s){
125 for (
size_t i = 0; i != state.size2(); i++) {
126 double prob = statistics(s,i);
127 if (state(s,i) == -1) {
129 prob = (1. - alpha) * prob + alpha * prob / (1. - prob);
131 prob = (1. - alpha) * prob + alpha;
135 prob = (1. - alpha) * prob + alpha * (1. - (1. - prob) / prob);
137 prob = (1. - alpha) * prob;
141 if(state(s,i)==0) state(s,i)=-1.;
157 SIZE_CHECK(statistics.size1() == state.size1());
158 SIZE_CHECK(statistics.size2() == state.size2());
160 RealVector logProbabilities(state.size1(),1.0);
161 for(std::size_t s = 0; s != state.size1();++s){
162 for(std::size_t i = 0; i != state.size2();++i){
163 logProbabilities(s) += (state(s,i) > 0.0)? std::log(statistics(s,i)) : std::log(1-statistics(s,i));
166 return logProbabilities;