Gpfit error on line 74. Not even working with the given matlab example.
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi there,
It appears that upgrading matlab to 2016a made no difference to my problem and once again, I cannot even perform the matlab example using the gpfit function. I get the following error when using the Matlab code online:
y =
0.0017 7.2773
Operands to the || and && operators must be convertible to
logical scalar values.
Error in gpfit (line 74)
if n == 0 || ~isfinite(rangex)
and the function keeps spitting y out as the minimum and maximum (rangex). My data is too big to attach and I do not think it is worth it to scale down as it is really just a matrix of wind speeds. No Nans no Infs.
When I add a breakpoint to the gpfit code, I can see that n is scalar 1x1 so I am pretty confused!
Any ideas?
Thanks!
1 comentario
hdrees
el 17 de En. de 2017
You shouldn't bother with fixing the error: gpfit usually gives nonsensical output even for nice data sets, e.g. k less than -1 although the likelihood function is unbounded for k<-1 (i.e. an MLE cannot exist on this range).
The function mle with 'distribution' equal to 'gp' works slightly better, but often gives values far off the true MLE, too. (To check, just compare the output with the one obtained from some reliable R package or plot the likelihood function and determine its maximum "manually".) So, unfortunately, so far MTALAB does not offer any reliable ML estimate for GPD data.
Respuestas (1)
Steven Lord
el 21 de Mzo. de 2016
What size is rangex when you reach that line?
Are you sure you're calling the ISFINITE function included with MATLAB on that line? How about the NOT function, which is the function form of the operator "~"? Check each:
which -all isfinite
which -all not
5 comentarios
Walter Roberson
el 22 de Mzo. de 2016
The example does not use wind speed, it creates a random value it looks to me.
What is size() of the array you are passing in? Not the approximate number of elements, the size(). I am examining the hypothesis that the shape of the input matters.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!