Skip to content

Commit

Permalink
Fix Histogram distribution sampling description
Browse files Browse the repository at this point in the history
The two steps were confused in the sampling description.
The steps are rearranged and clarified.
  • Loading branch information
rakhimov committed Dec 21, 2016
1 parent fd29549 commit 6bfed97
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mef/stochastic_layer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -767,11 +767,11 @@ Histograms
for each of the intervals :math:`[b_{i-1}, b_i)`.
The lower bound of the first interval :math:`b_0` is given apart.

The drawing of a value according to a histogram is a two-step process.
First, a value :math:`z` is drawn uniformly in the range :math:`[b_0, b_n]`.
Then, a value is drawn at random by means of the expression :math:`w_i`,
where :math:`i` is the index of the interval
such that :math:`b_{i-1} \leq x < b_i`.
The drawing of a value according to a histogram distribution is a two-step process.
First, the interval :math:`i` is drawn at random
from a discrete distribution with the corresponding weights :math:`w_i\cdot(b_i - b_{i-1})`;
then, a random value :math:`x` is drawn uniformly from the range :math:`[b_{i-1}, b_i)`.
These sampling of the intervals and random values must be independent.

The probability density function of the histogram (or piece-wise constant) distribution:

Expand Down

0 comments on commit 6bfed97

Please sign in to comment.