-1
$\begingroup$

I know about the fitdist() function from the fitdistrplus package in R, however, I am not able to use it to predict a gaussian distribution. I can predict normal, logistic, weibull etc. How can I use it for gaussian? are there any other ways to predict this?

$\endgroup$
8
  • $\begingroup$ If you can do "normal" you can do "Gaussian". They're the same thing. And where does fitdist come from? Its not in the base R packages. Always specify packages if mentioning an R function not in the base. $\endgroup$
    – Spacedman
    Commented Nov 8, 2016 at 11:01
  • $\begingroup$ This is what I am using to test the distribution type: fit.norm <- fitdist(a$Hours, "norm") This tells me its not normal, so probably its not gaussian as well. How to figure out what distribution it is? $\endgroup$ Commented Nov 8, 2016 at 11:39
  • $\begingroup$ I get: Error: object 'fitdist' not found. There is no such function. Edit your question and put the exact R code, from a clean session, into it. $\endgroup$
    – Spacedman
    Commented Nov 8, 2016 at 14:56
  • $\begingroup$ you would need to install the package "fitdistrplus" to use the function $\endgroup$ Commented Nov 9, 2016 at 7:39
  • 1
    $\begingroup$ Anyway, this is all irrelevant to your question. Normal and Gaussian are the same thing. $\endgroup$
    – Spacedman
    Commented Nov 9, 2016 at 14:19

3 Answers 3

0
$\begingroup$

You can try the following:

The minimum syntax you can use is:

fit.norm <- fitdist(x, "norm")

to fit the normal density function to the data x.

Use the parameters "gamma", "weibull", "lnorm" for fitting gamma, weibull and lognormal distributions respectively.

After doing that, you can use plot() function on your object fit.norm to visualize the fitted distribution ,q-q plot, p-p plot and empirical and theoretical CDF's.

Normal distribution and Gaussian distribution are one and the same.

The following is the output due to plot() function on the object generated by fitdist() function for 1000 standard normal variates. enter image description here

$\endgroup$
8
  • $\begingroup$ fitdist(runif(100),"pnorm") gives "Error in fitdist(runif(100), "pnorm") : The dpnorm function must be defined". You didn't even try this. The second argument of fitdist has to be "norm" here, not "pnorm" or "qnorm". $\endgroup$
    – Spacedman
    Commented Nov 10, 2016 at 16:53
  • $\begingroup$ While presenting, I made a mistake. You are right. $\endgroup$
    – Lella
    Commented Nov 10, 2016 at 16:58
  • $\begingroup$ @Spacedman I have corrected the typo. I observed that dnorm (without quotes) is same as "norm". $\endgroup$
    – Lella
    Commented Nov 10, 2016 at 17:15
  • $\begingroup$ @Spacedman Is there a function called dpnorm? $\endgroup$
    – Lella
    Commented Nov 10, 2016 at 17:22
  • $\begingroup$ No. It takes the string you give it, sticks "d" on the start, and looks for a function of that name to return a density. So if you can write the density, distribution, and quantile functions dfoo, pfoo, and qfoo for the fictonal foo distribution, then fitdist can act as a framework to fit parameters. $\endgroup$
    – Spacedman
    Commented Nov 10, 2016 at 17:34
2
$\begingroup$

The Normal distribution is the same as the Gaussian distribution. Its just two names for the same thing. Whatever you do - fit parameters, compute goodness-of-fit, etc - if the documentation says its for a Normal distribution then you can say "Gaussian" instead. Completely and totally identical.

$\endgroup$
0
$\begingroup$

It depends on what you mean by predicting Gaussian/normal distribution.

If you want to check the fit, then you can estimate mean and standard deviation of your sample and plot two histograms: one for your sample and second after generating a sample Gaussian distribution with the mean and standard deviation. By comparing the two you can roughly "see" the fit.

$\endgroup$
2
  • $\begingroup$ Have you missed the point about Gaussian and normal distributions being the same? $\endgroup$
    – Spacedman
    Commented Nov 9, 2016 at 15:57
  • 1
    $\begingroup$ No, I did not. I know its the same. Its a simple trick to compare a sample distribution with a known (normal aka Gaussian) one (if mean and std are known). $\endgroup$
    – Subspacian
    Commented Nov 10, 2016 at 8:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.