Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculation hangs in 1D #11

Open
Pierre-Andre opened this issue Oct 17, 2024 · 1 comment
Open

Calculation hangs in 1D #11

Pierre-Andre opened this issue Oct 17, 2024 · 1 comment

Comments

@Pierre-Andre
Copy link

Dear authors

I have a problem in using GCVmoothedNSpline for a given dataset (french csv file attached)

from gcvspline import GCVSmoothedNSpline
import numpy as np
tab=np.loadtxt("bugGCV.csv", delimiter=";",skiprows=1)
tab.shape ##(309, 2)
x=tab[:,0]
y=tab[:,1]
GCV_auto = GCVSmoothedNSpline(x, y) ## hangs

bugGCV.csv

Is it a well known limitation of the algorithm ?

Best regards
Pierre-Andre

PS the output of "pip install" in a new venv

pip install  gcvspline
Collecting gcvspline
  Using cached gcvspline-0.5-cp311-cp311-linux_x86_64.whl
Collecting numpy>=1.12
  Using cached numpy-2.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.3 MB)
Installing collected packages: numpy, gcvspline
Successfully installed gcvspline-0.5 numpy-2.1.2

and my python3 version

Python 3.11.2 (main, Aug 26 2024, 07:20:54) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
@charlesll
Copy link
Owner

charlesll commented Oct 21, 2024

Hi,

To my knowledge, this is not a known behavior.

I reproduced the problem on my computer, while my install is fine and the example notebook runs fine...

A clue is that SmoothedNSpline runs fine, so I suspect the algorithm has a problem converging to a good smoothing factor using the GCV mode.

I noticed that your data are very irregularly spaced, with a X space that is increasing more and more as X increases. Maybe this creates a problem for the GCV routine?

In any case, the loophole seems to be on the side of the FORTRAN code and not of the Python code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants