0

I want to fitting about Generalized normal distribution. However, the R code for performing this was input, and the following error occurred. I really need your help to solve this. Help me.

library(fitdistrplus)
data(mtcars)
head(mtcars)
fit <- fitdist(mtcars$mpg, "gnorm", start=list(mean=mean(mtcars$mpg), 
                                               sd=sd(mtcars$mpg), 
                                               shape=0))

The following are the results of the implementation.

> fit <- fitdist(mtcars$mpg, "gnorm", 
+                start=list(mean=mean(mtcars$mpg), 
+                           sd=sd(mtcars$mpg), 
+                           shape=0))
Error in checkparamlist(arg_startfix$start.arg, arg_startfix$fix.arg,  : 
'start' must specify names which are arguments to 'distr'.

I want an R code that can solve these problems, and I want a brief description of it. Thanks a lot.

Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
  • 2
    Check `help("dgnorm")` for the parameters you need to specify. `library(gnorm); fit <- fitdist(mtcars$mpg, "gnorm", start=list(mu=mean(mtcars$mpg), alpha=1, beta=1))` – Roland Feb 06 '23 at 09:31
  • Thanks for your reply. I tried as you told, but I still have a problem. The results are as follows. > fit <- fitdist(mtcars$mpg, "gnorm", start=list(mu=mean(mtcars$mpg), alpha=1, beta=1)) Not defined for negative values of alpha and/or beta. – Data Science study Feb 08 '23 at 05:44
  • I got the same messages but the algorithm converged successfully to parameter estimates that were all positive. – Roland Feb 08 '23 at 06:08
  • May I know the example data that you have successfully performed? Something simple is fine. – Data Science study Feb 09 '23 at 01:32
  • Yes, you may. I used `mtcars$mpg` as per your example. – Roland Feb 09 '23 at 05:57
  • Thank you very much. Finally, I solved the problem. Parameters were successfully estimated. :) – Data Science study Feb 10 '23 at 07:29

0 Answers0