josemiotto / pylevy

Levy distributions for Python
GNU General Public License v3.0
34 stars 18 forks source link

Levy_fit error II #7

Closed rodrigomp84 closed 5 years ago

rodrigomp84 commented 5 years ago

First of all, thank you for the great job. I'm new to python, so I apologize if this is just me being stupid. Also if the project is no longer under development.

Anyway, I'm facing problems with the Levy_fit function and the other open issue #3 on this topic did not help (I noted some things were already corrected in the code). It seems quite similar though, and I suspect it has to do with Python versions, but this is all still a mystery to me. I've been trying to use python3, and I also tested 2.7 with no luck.

If I simply use param = levy.fit_levy(data) the code works and gives results which seem fine, although my data set is quite weird. It gives me beta=-1 when I would expect 0, still I would bet that's on the data. But if I try to fix beta param = levy.fit_levy(data, beta=0.0) then I get the error message

Traceback (most recent call last): File "save_epsilons_alpha2.py", line 29, in param=levy.fit_levy(v[i:i+M],beta=0.0) File "/usr/local/lib/python3.4/dist-packages/levy.py", line 354, in fit_levy parameters.x = optimize.minimize(neglog_density, parameters.x, method='L-BFGS-B', bounds=par_bounds) File "/usr/local/lib/python3.4/dist-packages/scipy/optimize/_minimize.py", line 450, in minimize callback=callback, **options) File "/usr/local/lib/python3.4/dist-packages/scipy/optimize/lbfgsb.py", line 260, in _minimize_lbfgsb raise ValueError('length of x0 != length of bounds') ValueError: length of x0 != length of bounds

Since I have this weird data I also tried fixing beta=-1 but I get the same message. Same thing if trying to fix mu. Where am I screwing this?

josemiotto commented 5 years ago

Hi Rodrigo,

it's a long time that I do not work in that code. Maybe this weekend is time to fix those bugs! so, I'll let you know, but don't have many hopes :)

best José

On Fri, Aug 17, 2018 at 6:14 PM Rodrigo notifications@github.com wrote:

First of all, thank you for the great job. I'm new to python, so I apologize if this is just me being stupid. Also if the project is no longer under development.

Anyway, I'm facing problems with the Levy_fit function and the other open issue #3 https://github.com/josemiotto/pylevy/issues/3 on this topic did not help (I noted some things were already corrected in the code). It seems quite similar though, and I suspect it has to do with Python versions, but this is all still a mystery to me. I've been trying to use python3, and I also tested 2.7 with no luck.

If I simply use param = levy.fit_levy(data) the code works and gives results which seem fine, although my data set is quite weird. It gives me beta=-1 when I would expect 0, still I would bet that's on the data. But if I try to fix beta param = levy.fit_levy(data, beta=0.0) then I get the error message

Traceback (most recent call last): File "save_epsilons_alpha2.py", line 29, in param=levy.fit_levy(v[i:i+M],beta=0.0) File "/usr/local/lib/python3.4/dist-packages/levy.py", line 354, in fit_levy parameters.x = optimize.minimize(neglog_density, parameters.x, method='L-BFGS-B', bounds=par_bounds) File "/usr/local/lib/python3.4/dist-packages/scipy/optimize/_minimize.py", line 450, in minimize callback=callback, **options) File "/usr/local/lib/python3.4/dist-packages/scipy/optimize/lbfgsb.py", line 260, in _minimize_lbfgsb raise ValueError('length of x0 != length of bounds') ValueError: length of x0 != length of bounds

Since I have this weird data I also tried fixing beta=-1 but I get the same message. Same thing if trying to fix mu. Where am I screwing this?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/josemiotto/pylevy/issues/7, or mute the thread https://github.com/notifications/unsubscribe-auth/AAQp0gaChve9lCG-NJPaaVlVhdECDi9yks5uRuvegaJpZM4WB07L .