# Thread: SSE, TSE & higher symbol probability estimations

1. 1. SSE is useless for mixture of different predictions because it was not designed for this purpose. Probability interpolation in SSE is also nearly useless because compression gain is negligible and execution time grows at order of magnitude. Thus, We need modeler with following properties:
a) possibility to attach new auxilary submodel without affecting to old ones;
b) weak dependency on input probability;

2. Suppose, We have some context model that generates probability estimation for symbol &#036;Prob_i^0&#036;, &#036;i&#036; is count of encoded symbols. This estimation is input for SSE-modeler that generates estimation &#036;Prob_i^1 = frac {Nom_i} {DeNom_i}&#036;. Suppose, our auxilary submodel gives small correction to probability estimation &#036;Prob_i^1&#036;, for simplicity of calculations, We can choose this correction as &#036;Prob_i = &#92;frac {Nom_i + &#92;varepsilon Nom_i} {DeNom_i + &#92;varepsilon Nom_i}&#036;. By weak definition of probability, &#036;&#92;sum_i Nom_i = &#92;sum_i &#92;delta_i DeNom_i&#036;, &#036;&#92;delta_i = 1&#036; - symbol is encoded on &#036;i&#036;th step, &#036;&#92;delta_i = 0&#036; - coding failure. From this equation, We get value of &#036;&#92;varepsilon&#036;:
&#036;&#036;&#92;varepsilon = &#92;frac {&#92;sum_i &#92;delta_i DeNom_i - Nom_i} {&#92;sum_i Nom_i - &#92;delta_i Nom_i}&#036;&#036;
Also, good choice for probability correction is &#036;Prob_i = &#92;frac {Nom_i} {DeNom_i + &#92;varepsilon (DeNom_i-Nom_i)}&#036;.

3. Code sample for DeNom ~ 2^15:
Code:
```extern int Nom, DeNom;
struct TSE_MODELER {
enum { S2_INIT=1 << 17, MAX_ADD=1 << 18, S1_BOUND=1 << 24 };
void init() { S1=0; S2=S2_INIT; }
void tuneProb(int ndn[]) {
ndn=Nom;                         ndn=DeNom;
Nom += i;                           DeNom += i;
if (abs(S1) > S1_BOUND) { S1 >>= 1; S2 >>= (S2 > S1_BOUND/64); }
if (S2 > (1 << 30))     { S1 >>= 1; S2 >>= 1; }
}
void update0(int ndn[]) { S1 -= ndn; S2 += ndn; }
void update1(int ndn[]) { S1 += ndn-ndn; }
int S1, S2;
};``` 2. Is it a bit messing, isn't it? Could you make it clear for us? 3. Originally Posted by osmanturan
Is it a bit messing, isnt it? Could you make it clear for us? It is TeX notation. You can simply copy text to your notepad and compile it with LaTeX. 4. That's supposed to look like this: 5. Originally Posted by Shelwien
Thats supposed to look like this:
Yes, it is pecisely that I meant. Thanks.
I forgot to say that TSE-modelers can be linked sequentially: one modeler per one submodel. #### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•