Navigation

Operators and Keywords

Function List:

C++ API

Function File: narysource (probability_dist,n_order)

This function creates a N-ary order source using the given probability_dist (as a column vector) of a 1-order source building a probability distribution of size len(probability_dist)^order. Basically if you have X-symbol distribution with a N-ary source then we have, in the resultant N-ary source with a X^N symbols. The function is equivalent to the definitions of a q-ary order source.

           pdist=[1 2 3 4]./10;
           ndist = narysource(pdist,2)
                 ⇒  [ 0.010000   0.020000   0.030000   0.040000   0.020000 0.040000   0.060000   0.080000   0.030000   0.060000    0.090000   0.120000   0.040000   0.080000   0.120000   0.160000]
See also: entropy