Closed natashawatkins closed 5 years ago
That looks suspiciously like the bug related to extrapolation that I fixed recently. Which version are you running ?
If the problem is not with library version this issue is a bit hard for me to address as I have no idea what triggers the faulty behaviour. I would need a reduced example or at least some code that I can run.
I believe I updated to 2.0.1
Are you sure you deinstalled any pip version you might have had on your computer?
On Tue, Oct 2, 2018 at 7:23 PM Natasha notifications@github.com wrote:
I believe I updated to 2.0.1
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/EconForge/interpolation.py/issues/32#issuecomment-426359329, or mute the thread https://github.com/notifications/unsubscribe-auth/AAQ5KQ0ay2I5ksrAbMvLK9AktmxXmGglks5ug6EdgaJpZM4XEaqR .
Yep I just uninstalled and then reinstalled and I'm still having issues
I can't replicate it on my computers. Could you do the following please ?
conda remove interpolation
pip uninstall interpolation
and repeat the operation twiceconda install interpolation
Then if it still doesn't work, can you send me an example of faulty code ? Are you doing 1d, 2d, or higher dimension interpolation ?Do you mean pip install interpolation
? I'm almost very sure I have 2.0.1 installed. It only occurs with this specific piece of code I'm using
Here is the issue again after reinstalling:
No, I mean pip uninstall ...
. Sometimes an old pip version can cohabitate with the conda version.
hmm, I don't see the issue ;-)
I did pip uninstall but I couldn't find the conda package? Am I meant to have a channel configured or something?
sorry, should have specified it: conda install -c conda-forge interpolation
On Wed, Oct 3, 2018 at 9:43 AM Natasha notifications@github.com wrote:
I did pip uninstall but I couldn't find the conda package? Am I meant to have a channel configured or something?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/EconForge/interpolation.py/issues/32#issuecomment-426541839, or mute the thread https://github.com/notifications/unsubscribe-auth/AAQ5KX39D0HJVBFZVVLF1-XMAGFmCrZjks5uhGqigaJpZM4XEaqR .
Ok I installed via conda-forge and still got the same error
Thank you @natashawatkins . But in order to understand the problem, I need to see the code where the function interp
is being called. This is not apparent in the example you supply. Can you point me to the source ?
In this notebook here: https://github.com/jstac/jitting_py_lectures/blob/master/lucas_model.ipynb
Thanks, let me have a look.
So this comes from the extrapolation behaviour of np.interp
and interpolation.interp
. The former uses a constant equal to the nearest value on the grid, while the latter extrapolates linearly (see graph).
Apparently this causes the convergence failure of the iterations, maybe by causing negative values.
There are plans for a flexible extrapolation system, but in the meantime I'll commit a small change so that interp works with constant extrapolation and matches better default options of np.interp
Thanks!!
Currently trying to switch
np.interp
tointerp
, and running into some stability issues - sometimes it works but sometimes I run into this error and my code won't work