<div dir="ltr"><div>Looks like Wolfram MathWorld would favor the docstring, but the possibility of a "use-domain" dependency seems plausible (after all, a similar dilemma is observed, e.g., w/ the Fourier Transform)--I guess one discipline's future is another discipline's past. :-)</div>
<div><br></div><a href="http://mathworld.wolfram.com/Autocorrelation.html">http://mathworld.wolfram.com/Autocorrelation.html</a><div><br></div><div>DG<br><div class="gmail_extra"><br>Date: Tue, 8 Oct 2013 20:10:41 +0100<br>
<div class="gmail_quote"><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">
From: Richard Hattersley <<a href="mailto:rhattersley@gmail.com">rhattersley@gmail.com</a>><br>
Subject: Re: [Numpy-discussion] Bug in numpy.correlate documentation<br>
To: Discussion of Numerical Python <<a href="mailto:numpy-discussion@scipy.org">numpy-discussion@scipy.org</a>><br>
Message-ID:<br>
        <CAP=RS9k54vtNFHy9ppG=U09oEHwB=KLV0xvwR6BfFgB3o5S=<a href="mailto:fw@mail.gmail.com">fw@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Hi Bernard,<br>
<br>
Looks like you're on to something - two other people have raised this<br>
discrepancy before: <a href="https://github.com/numpy/numpy/issues/2588" target="_blank">https://github.com/numpy/numpy/issues/2588</a>.<br>
Unfortunately, when it comes to resolving the discrepancy one of the<br>
previous comments takes the opposite view. Namely, that the docstring is<br>
correct and the code is wrong.<br>
<br>
Do different domains use different conventions here? Are there some<br>
references to back up one stance or another?<br>
<br>
But all else being equal, I'm guessing there'll be far more appetite for<br>
updating the documentation than the code.<br>
<br>
Regards,<br>
Richard Hattersley<br>
<br>
<br>
On 7 October 2013 22:09, Bernhard Spinnler <<a href="mailto:Bernhard.Spinnler@gmx.net">Bernhard.Spinnler@gmx.net</a>>wrote:<br>
<br>
> The numpy.correlate documentation says:<br>
><br>
>         correlate(a, v) = z[k] = sum_n a[n] * conj(v[n+k])<br>
><br></blockquote><div><snip> </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">> [so] according to the documentation, z should be<br>

><br>
>         z[-1] = a[1] * conj(v[0]) = 4.+0.j<br>
>         z[0]  = a[0] * conj(v[0]) + a[1] * conj(v[1]) = 2.-2.j<br>
>         z[1] = a[0] * conj(v[1]) = 0.-1.j<br>
><br>
> which is the time reversed version of what correlate() calculates.<br></blockquote></div>
</div></div></div>