Error using gpfit (line 46)The data in X must be positive.

Good evening all, I am new in Matlab and I am trying to use it for statistical purpose, in particular to analyze time series of precipitation and temperature within the Extreme Value Theory.
Until now I create the script, that works with random numbers (rndn), but it does not work with the real time series.
When I run the script the error that Matlab shows up is the following:
*Error using gpfit (line 46) The data in X must be positive.
Error in GPD_real_1D (line 44) [parmhat,parmci] = gpfit(z-threshold(ii));*
I deleted all the zero from my time series but the problem still exist.
What shall I do?
Please help me, it is vital. Thanks Paolo

 Accepted Answer

Before calling gpfit, print out "z-threshold(ii)". Is it an array with all values positive ?
Best wishes
Torsten.

2 Comments

Hi Torsten, the array "z-threshold(ii)" has got 6 zero values, maybe the problem is this one?
thanks
I think so.
Best wishes
Torsten.

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Asked:

on 9 Jun 2015

Commented:

on 9 Jun 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!