I have the following data. I want to know which distribution best fits the data. First, I tried to check it using the Cullen and Frey graph, here are the results:
> library(fitdistrplus)
> descdist(respm, discrete = FALSE, boot = 500)
However, from these results I am still confused about which distribution is suitable. and i tried to use fitdistrplus package to identify it. From the graph it can be seen that the observations are closer to the lognormal and gamma distributions, but I cannot use "lnorm
" or "gamma
" because my data has negative values.
> fn1 <- fitdist(respm, "gamma")
Error in computing default starting values.
Error in manageparam(start.arg = start, fix.arg = fix.arg, obs = data, :
Error in startargdefault(obs, distname) :
values must be positive to fit an gamma distribution
I tried using other distributions such as "norm
" and "logis
", but after running there was an error.
> fn1 <- fitdist(respm, "norm")
<simpleError in optim(par = vstart, fn = fnobj, fix.arg = fix.arg,
obs = data, gr = gradient, ddistnam = ddistname, hessian = TRUE,
method = meth, lower = lower, upper = upper, ...): non-finite
finite-difference value [2]>
Error in fitdist(respm, "norm") :
the function mle failed to estimate the parameters,
with the error code 100
What solution should I do using R to get the distribution information that best fits my data?