This repository is a base of Eos.
Revisión | 847bc245a65f05bb22555ce05b3df3887b48870a (tree) |
---|---|
Tiempo | 2017-01-23 07:17:07 |
Autor | 久永浩司 <hisanagakouji@hisa...> |
Commiter | 久永浩司 |
modified eosBayesq
@@ -130,6 +130,10 @@ void eosBayesProbabilityRangeChange(eosBayes* d, int n, float percentage, int mo | ||
130 | 130 | for(i=0;i<d->numDistribution;i++){ |
131 | 131 | DEBUGPRINT2("%d/%d loop\n",i+1,d->numDistribution); |
132 | 132 | if(d->posterior[i].rangechangeflag==1){ |
133 | + if(d->posterior[i].n == 1){ | |
134 | + d->posterior[i].n = (int)(((d->posterior[i].max - d->posterior[i].min)/d->posterior[i].delta)+1); | |
135 | + DEBUGPRINT1("SET n: %d\n",d->posterior[i].n); | |
136 | + } | |
133 | 137 | DEBUGPRINT("Range change\n"); |
134 | 138 | total = d->posterior[i].probofmaxposterior; |
135 | 139 | DEBUGPRINT1("start total:%f\n",total); |
@@ -138,7 +142,7 @@ void eosBayesProbabilityRangeChange(eosBayes* d, int n, float percentage, int mo | ||
138 | 142 | for(j=1;total<=percentage;j++){ |
139 | 143 | if(d->posterior[i].iofmaxposterior-j >= 0){ |
140 | 144 | iofmin = d->posterior[i].iofmaxposterior-j; |
141 | - total += d->posterior[i].prob[iofmin]; | |
145 | + total += d->posterior[i].prob[iofmin]; | |
142 | 146 | DEBUGPRINT1("iofmin:%d\n",iofmin); |
143 | 147 | DEBUGPRINT1("value:%f\n",d->posterior[i].value[iofmin]); |
144 | 148 | } |
@@ -220,7 +220,7 @@ main(int argc, char* argv[]) | ||
220 | 220 | out.posterior[1].maxposteriorflag = 0; |
221 | 221 | out.posterior[3].maxposteriorflag = 0; |
222 | 222 | out.posterior[5].maxposteriorflag = 0; |
223 | - eosBayesMaxposteriorflagSet(&out,4); | |
223 | +// eosBayesMaxposteriorflagSet(&out,4); | |
224 | 224 | |
225 | 225 | DEBUGPRINT("set canstantflag of Ain"); |
226 | 226 | out.posterior[3].constantflag = 0; |
@@ -235,6 +235,7 @@ main(int argc, char* argv[]) | ||
235 | 235 | out.posterior[0].rangechangeflag = 1; |
236 | 236 | out.posterior[1].rangechangeflag = 1; |
237 | 237 | out.posterior[2].rangechangeflag = 1; |
238 | + out.posterior[4].rangechangeflag = 1; | |
238 | 239 | eosBayesProbabilityRangeChange(&out,20,0.95,0); |
239 | 240 | |
240 | 241 |