I am trying to fit a dynamic mixture model (Weibull for the bulk, Pareto for the tail) using the fdwm()
function from the evmix
package:
library(repmis)
library(evmix)
data=source_data("https://www.dropbox.com/s/r7i0ctl1czy481d/test.csv?dl=0")[,1]
test=fdwm(data,c(0.9150062,75.4699181,quantile(data,0.98),11.21,87.41,0.05))
I am experiencing a weird behavior: the function first returns an error...:
Error in integrate(rx, wshape, wscale, cmu = cmu, ctau = ctau, sigmau = sigmau, : non-finite function value
...but continues to function and finally returns some values:
test$mle
[1] 1.212213e+00 5.877943e+01 5.160288e+02 8.364144e-04 1.206929e+02 8.952331e-02
Further,
xeval=seq(min(data),max(data)+sd(data),length=length(data))
test.distr=ddwm(xeval,test$mle[1],test$mle[2],test$mle[3],test$mle[4],test$mle[5],test$mle[6])
hist(data,probability=TRUE)
lines(xeval,test.distr,col="red")
gives:
So, it seems that the estimated parameters are valid.
Therefore, should I ignore the error returned by the fdwm()
function? Can I use the estimated parameter values?
Some info about my R session:
R version 3.1.2 (2014-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
I am using the version 2.5 of evmix
.