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

Problem using confidence interval with genpareto distribution #41

Open
cehiles opened this issue Nov 19, 2018 · 0 comments
Open

Problem using confidence interval with genpareto distribution #41

cehiles opened this issue Nov 19, 2018 · 0 comments

Comments

@cehiles
Copy link

cehiles commented Nov 19, 2018

Hello,

I previously used wafo under Matlab but I am now migrating to python.

The issue I am currently encountering occurs when I attempt to plot a genpareto distribution with confidence intervals. My script and the terminal response is below. The last line of the response just keeps repeating until I kill it. There are a lot of warnings in the response and I am having trouble teasing out where this error is originating. It may have something to do with that fact that I am running a newer version of Python than WAFO was tested with (Anaconda, Python 3.6). Any suggestions on where to go from here would be greatly appreciated.

Thanks,

Clayton

My script:

import matplotlib.pyplot as plt
import wafo.data as wd
from wafo import stats as ws
plt.ioff()

Hs = wd.atlantic()
gpd3 = ws.genpareto.fit2(Hs[Hs>3],floc=3)
fig, axes = plt.subplots()
gpd3.plotesf(plot_ci=True)
plt.show()

Terminal response:

$ python test_wafo_genpar_ci.py 
/home/clayton/anaconda3/envs/wafo/lib/python3.6/site-packages/wafo/stats/estimation.py:1553: UserWarning: P-value is on the conservative side (i.e. too large) due to ties in the data!
  ' ties in the data!')
QApplication: invalid style override passed, ignoring it.
/home/clayton/anaconda3/envs/wafo/lib/python3.6/site-packages/wafo/stats/estimation.py:122: RuntimeWarning: invalid value encountered in double_scalars
  return (x - loc) * c / expm1(-c * logsf)
/home/clayton/anaconda3/envs/wafo/lib/python3.6/site-packages/wafo/stats/_distn_infrastructure.py:490: RuntimeWarning: invalid value encountered in greater_equal
  return (self.a <= x) & (x <= self.b)
/home/clayton/anaconda3/envs/wafo/lib/python3.6/site-packages/wafo/stats/_distn_infrastructure.py:490: RuntimeWarning: invalid value encountered in less_equal
  return (self.a <= x) & (x <= self.b)
/home/clayton/anaconda3/envs/wafo/lib/python3.6/site-packages/numpy/core/fromnumeric.py:83: RuntimeWarning: invalid value encountered in reduce
  return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
/home/clayton/anaconda3/envs/wafo/lib/python3.6/site-packages/scipy/optimize/optimize.py:563: RuntimeWarning: invalid value encountered in subtract
  numpy.max(numpy.abs(fsim[0] - fsim[1:])) <= fatol):
/home/clayton/anaconda3/envs/wafo/lib/python3.6/site-packages/wafo/stats/estimation.py:41: UserWarning: Exceeded max iterations. (p_min0=[-6.57391905], p_min=[-1.38503693e-24], p=0.0)
  warnings.warn(msg)
/home/clayton/anaconda3/envs/wafo/lib/python3.6/site-packages/wafo/stats/estimation.py:41: UserWarning: Exceeded max iterations. (p_max0=[6.57391905], p_max=[1.38503693e-24], p=0.0)
  warnings.warn(msg)
/home/clayton/anaconda3/envs/wafo/lib/python3.6/site-packages/wafo/misc.py:856: RuntimeWarning: divide by zero encountered in true_divide
  (f[ind + 1] - f[ind]))
/home/clayton/anaconda3/envs/wafo/lib/python3.6/site-packages/wafo/misc.py:928: UserWarning: No level v = -944.77 crossings found in x
  warnings.warn('No level v = %0.5g crossings found in x' % v)
/home/clayton/anaconda3/envs/wafo/lib/python3.6/site-packages/wafo/stats/estimation.py:523: UserWarning: Number of crossings is zero, i.e., upper and lower bound is not found!
  warnings.warn('Number of crossings is zero, i.e., upper and lower '
/home/clayton/anaconda3/envs/wafo/lib/python3.6/site-packages/scipy/optimize/optimize.py:563: RuntimeWarning: invalid value encountered in subtract
  numpy.max(numpy.abs(fsim[0] - fsim[1:])) <= fatol):
/home/clayton/anaconda3/envs/wafo/lib/python3.6/site-packages/wafo/stats/estimation.py:365: UserWarning: The fitted parameters does not provide the optimum fit. Something wrong with fit (par = [-0.2352845   3.         -0.00389864], par_old= [-0.2352845   3.          2.91429383], dl = 1.1368683772161603e-13)
  dL))
/home/clayton/anaconda3/envs/wafo/lib/python3.6/site-packages/scipy/optimize/optimize.py:563: RuntimeWarning: invalid value encountered in subtract
  numpy.max(numpy.abs(fsim[0] - fsim[1:])) <= fatol):
/home/clayton/anaconda3/envs/wafo/lib/python3.6/site-packages/scipy/optimize/optimize.py:563: RuntimeWarning: invalid value encountered in subtract
  numpy.max(numpy.abs(fsim[0] - fsim[1:])) <= fatol):
/home/clayton/anaconda3/envs/wafo/lib/python3.6/site-packages/scipy/optimize/optimize.py:563: RuntimeWarning: invalid value encountered in subtract
  numpy.max(numpy.abs(fsim[0] - fsim[1:])) <= fatol):
/home/clayton/anaconda3/envs/wafo/lib/python3.6/site-packages/scipy/optimize/optimize.py:563: RuntimeWarning: invalid value encountered in subtract
  numpy.max(numpy.abs(fsim[0] - fsim[1:])) <= fatol):
/home/clayton/anaconda3/envs/wafo/lib/python3.6/site-packages/scipy/optimize/optimize.py:563: RuntimeWarning: invalid value encountered in subtract
  numpy.max(numpy.abs(fsim[0] - fsim[1:])) <= fatol):
/home/clayton/anaconda3/envs/wafo/lib/python3.6/site-packages/scipy/optimize/optimize.py:563: RuntimeWarning: invalid value encountered in subtract
  numpy.max(numpy.abs(fsim[0] - fsim[1:])) <= fatol):
/home/clayton/anaconda3/envs/wafo/lib/python3.6/site-packages/scipy/optimize/optimize.py:563: RuntimeWarning: invalid value encountered in subtract
  numpy.max(numpy.abs(fsim[0] - fsim[1:])) <= fatol):
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

1 participant