Evir :: gev() optim non-finite finite difference error with certain data type

Viewed 17

I am trying to fit a distribution to my max scores to get a significance threshold. I am using evir::gev() to do so. When I pull my values directly from the object I have, which contains the extreme values, this fitting method throws an error. If I import the values as a vector that I have defined by hand, there is no error. From what I can tell, the data object is virtually the same in both runs, but clearly is being handled differently. (both are a vector of doubles)

This code works:

data<- c(5.401319,6.580631,6.120880,5.686255,6.640302,6.990672,5.797920,6.902248,5.694203,6.853788)
print(data)
typeof(data)

fit<- evir::gev(data)

This does not::

data<- permuted_scans$max.statistics$LOD
print(data)
typeof(data)


fit<- evir::gev(data)

Error in optim(theta, negloglik, hessian = TRUE, ..., tmp = data) : non-finite finite-difference value 1

R Notebook of error

1 Answers

I'm not sure about where the error was stemming from, exactly, but when I simulated more datapoints for my permuted scans, the error disappeared. I assume the gev() function was fitting poorly with the small sample size (only 10 values) and was getting negative numbers. I'm not sure why the error did not appear with the vector inputted by hand.

Related