Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I use this incremental median estimator:</p> <pre><code>median += eta * sgn(sample - median) </code></pre> <p>which has the same form as the more common mean estimator:</p> <pre><code>mean += eta * (sample - mean) </code></pre> <p>Here <em>eta</em> is a small learning rate parameter (e.g. <code>0.001</code>), and <code>sgn()</code> is the signum function which returns one of <code>{-1, 0, 1}</code>. (Use a constant <code>eta</code> like this if the data is non-stationary and you want to track changes over time; otherwise, for stationary sources use something like <code>eta = 1 / n</code> to converge, where <code>n</code> is the number of samples seen so far.)</p> <p>Also, I modified the median estimator to make it work for arbitrary quantiles. In general, a <a href="http://en.wikipedia.org/wiki/Quantile_function" rel="nofollow noreferrer">quantile function</a> tells you the value that divides the data into two fractions: <code>p</code> and <code>1 - p</code>. The following estimates this value incrementally:</p> <pre><code>quantile += eta * (sgn(sample - quantile) + 2.0 * p - 1.0) </code></pre> <p>The value <code>p</code> should be within <code>[0, 1]</code>. This essentially shifts the <code>sgn()</code> function's symmetrical output <code>{-1, 0, 1}</code> to lean toward one side, partitioning the data samples into two unequally-sized bins (fractions <code>p</code> and <code>1 - p</code> of the data are less than/greater than the quantile estimate, respectively). Note that for <code>p = 0.5</code>, this reduces to the median estimator.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload