<div dir="ltr">Actually, I was wrong about the exponential distribution's KL divergence.  It's the relative error (b-a)/b  plus another term: log(b/a) — so I guess I don't see what relative error means except as a heuristic.<div><br></div><div>Anyway, even if your symmetric error makes sense to you, does anyone already use it?  If it were up to me, relative error would be b-a/b + log(b/a), but since no one uses that, I think it's a bad idea.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 15, 2015 at 10:46 PM, Neil Girdhar <span dir="ltr"><<a href="mailto:mistersheik@gmail.com" target="_blank">mistersheik@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Thu, Jan 15, 2015 at 10:28 PM, Stephen J. Turnbull <span dir="ltr"><<a href="mailto:stephen@xemacs.org" target="_blank">stephen@xemacs.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>Neil Girdhar writes:<br>
<br>
 > The symmetric error that people are proposing in this thread has no<br>
 > intuitive meaning to me.<br>
<br>
</span>There are many applications where the goal is to match two values,<br>
neither of which is the obvious standard (eg, statistical tests<br>
comparing populations,</blockquote><div><br></div></span><div>No, if you're trying to answer the question whether two things belong to the same population as opposed to another, you should infer the population statistics based on a and b and a your estimated overall population statistics and then calculate cross entropies.  Using some symmetric cross relative error has no meaning.</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">or even electrical circuits, where it may be<br>
important that two components be matched to within 1%, although the<br>
absolute value might be allowed to vary by up to 10%).  Symmetric<br>
error is appropriate for those applications.  Symmetric error may be<br>
less appropriate for applications where you want to hit an absolute<br>
value, but it's (provably) not too bad.<br>
<br>
By "provably not too bad" I mean that if you take the word "close" as<br>
a qualitative predicate, then although you can make the "distance"<br>
explode by taking the "actual" to be an order of magnitude distant in<br>
absolute units, you'll still judge it "not close" (just more so, but<br>
"more so" is meaningless in this qualitative context).  On the other<br>
hand, for values that *are* close (with reasonable tolerances) it<br>
doesn't much matter which value you choose as the standard: "most" of<br>
the time you will get the "right" answer (and as the tolerance gets<br>
tighter, "most" tends to a limit of 100%).<br></blockquote><div><br></div></span><div>In statistics and machine learning at least many people have argued that the cross entropy error is the most reasonable loss function.   When you have an observed value and estimated value, the right way of comparing them is a cross entropy error, and that's what absolute error and relative error are doing.  They correspond to cross entropies of the minimum assumptive distributions over the reals and positive reals.</div><div><br></div><div>I think the numpy.allclose function almost always gives you what you want when you have an actual and an estimated value, which is the more usual case.</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
The generic "are_close()" function should be symmetric.  I suppose it<br>
might also to useful to have an "is_close_to()" function that is<br>
asymmetric.<br></blockquote><div><br></div></span><div>I disagree. Since the usual case is to have an observed and estimated value, then the close function should not be symmetric.  Either you should have two functions: relative error and absolute error, or you should combine them like numpy did.</div><div><br></div><div>Best,</div><div><br></div><div>Neil </div></div></div><div class="gmail_extra"><br></div></div>
</blockquote></div><br></div>