2

I am attempting to obtain parameter estimates for the GEV function using built in maximum likelihood methods in python rather than in MATLAB, but the parameters estimated in MATLAB (gevfit_rev) are different from those found using the scipy.stats.genextreme.fit. An example using the data

data = np.array([ 22.20379411,  22.99151292,  24.27032696,  24.82180626,
    25.23163221,  25.39987272,  25.54514567,  28.56710007,
    29.7575898 ,  30.15641696,  30.79168255,  30.88147532,
    31.0236419 ,  31.17380647,  31.61932755,  32.23452568,
    32.76262978,  33.39430032,  33.81080069,  33.90625861,
    33.99142006,  35.45748368,  37.0342621 ,  37.14768791,
    38.14350221,  42.72699534,  44.16449992,  48.77736737,
    49.80441736,  50.57488779])

Scipy provides the parameters (shape,location,scale)

genextreme.fit(data)
(0.46794425159397518, 29.321600290365303, 4.7986571014800141)

MATLAB provides (shape,scale,location)

gevfit_rev(data)
0.0144    5.8983   29.7621

Can anyone suggest why these estimates are different?

captain_M
  • 287
  • 2
  • 10
  • When you make the call to `genextreme.fit()`, do you get a warning? – Warren Weckesser Mar 01 '16 at 21:16
  • 1
    With scipy 0.16.1 and with scipy's development version, `genextreme.fit` gives a warning, and returns `(-0.014387281261850815, 29.762126238637851, 5.8983127779873605)`. Note that the shape parameter used by scipy's `genextreme` has the opposite sign of the shape parameter used in, for example, the wikipedia article on the generalized extreme value distribution, so those values match the numbers that you show for the Matlab output. – Warren Weckesser Mar 01 '16 at 21:33
  • Which version of scipy are you using? To check: `import scipy; print(scipy.__version__)` – Warren Weckesser Mar 01 '16 at 21:40
  • Solved, I was using scipy version 0.15.1. After updating to 0.16.1 I now am able to produce the same parameters as in MATLAB. Thanks for the help all! – captain_M Mar 02 '16 at 21:25

0 Answers0