This is a brief description on one way to determine the distribution of given data. There are several ways to accomplish this in R especially if one is trying to determine if the data comes from a normal distribution. Rather than focusing on hypothesis testing and determining if a distribution is actually the said distribution this example shows one simple approach to determine the parameters of a distribution. I’ve found this useful when I’m given a dataset and I need to generate more of the same type of data for testing and simulation purposes. The example below uses data that originated from a gamma (1,2). Here we can see how well the data fits the distribution.

I can’t launch the function correctly i have an error message :Erreur dans raw < -t(matrix(c(1, 0.4789, 1, 0.125, 2, 0.7048, 2, 0.2482, :
comparaison (3) possible seulement pour les types liste et atomique

WordPress did a strange thing with the “<-" value and put a space between the two characters. I updated the post and used a "=" symbol instead.
As far a the parameters go, if you look at the fit.distr$estimate you will see an array of values. For one parameter distributions (e.g. exponential) it will only contain one value. For two parameters distributions (e.g. beta) it will contain the two values. These values are the parameters based on the data.

Where does the function fitdistr() come from?

It is contained in the MASS package.

Hello,

I can’t launch the function correctly i have an error message :Erreur dans raw < -t(matrix(c(1, 0.4789, 1, 0.125, 2, 0.7048, 2, 0.2482, :

comparaison (3) possible seulement pour les types liste et atomique

Secondly how did you find the parameters?

Best regarfs

WordPress did a strange thing with the “<-" value and put a space between the two characters. I updated the post and used a "=" symbol instead. As far a the parameters go, if you look at the fit.distr$estimate you will see an array of values. For one parameter distributions (e.g. exponential) it will only contain one value. For two parameters distributions (e.g. beta) it will contain the two values. These values are the parameters based on the data.

Hello,

Thx for the update, all it works good.

Best regards