[Tutor] Fitting data to error function

Danny Yoo dyoo at hashcollision.org
Mon Mar 16 03:57:45 CET 2015


> What does fft expect to receive as an argument?  We can read the following:
>
>     http://docs.scipy.org/doc/scipy/reference/generated/scipy.fftpack.fft.html#scipy.fftpack.fft
>
> Since fft is erroring out: there's only one possibility: E_(x) is not
> providing a value that's appropriate to fft().
>
> Why would it do that?  Two possibilities:
>
>     1.  E_ is buggy and needs investigation.
>
>     2.  E_ is fine, but the inputted value of x is one that E_x is not
> defined to handle.
>
>
> And so we start the investigation by considering those two
> possibilities.  Start with #1.
>
> Do you know if E_ is fine?  What is it supposed to do?  What is the
> shape of its input?  What is the shape of its output?  Is its output
> something that fft() is designed to handle?

Just to add: this is not to say that E_() is buggy.  We just have to
start investigation somewhere, and it seemed as good a place as any,
since I don't know if _any_ of the functions are behaving.  :P

This is very much the reason why programmers like to do unit testing:
we want to know what functions at least do something that we know is
useful.  We know all too well that whole programs break, and we want
to have some confidence on what components of our program are likely
ok.

If #2 is the actual issue, then the question becomes: why is the
program producing an invalid input 'x'?  And that's where we need to
start reasoning backwards, to discover how that value was constructed.


More information about the Tutor mailing list