arnohakk
arnohakk

Reputation: 53

Problems fitting arbitray distributions using the fitdistplus package

I am trying to fit my data using the fitdist() function from the fitdistrplus package in R. I succeeded using a normal and a lognormal distribution via key words 'norm' and 'lnorm' which I found via searching online.

I was not able to get other distributions working; the help of fitdist() says:

distr: A character string "name" naming a distribution for which the corresponding density function dname, the corresponding distribution function pname and the corresponding quantile function qname must be defined, or directly the density function.

I checked and when entering ?norm or ?norm into the R command line, neither function norm() nor lnorm() is found. This confuses me totally.

When I try for example fitdist(data, 'poisson'), I get the following error message:

Error in fitdist(data$time, "poisson") : The dpoisson function must be defined

I am somewhat a noob in R, can anybody give a hint?

Upvotes: 2

Views: 592

Answers (1)

RolandASc
RolandASc

Reputation: 3923

norm() in R is a different function to compute norms of a matrix, so not directly related to the normal distribution.

?Normal brings up the documentation related to the normal distribution, and you'll see the 4 functions dnorm, pnorm, qnorm and rnorm belonging to this family.

If you look at ?Lognormal you'll see the same convention with the typical 4 functions.

More generally, you can look-up ?Distributions, which links all of them. There you can see that the keyword for the poisson distribution should actually be pois.

Upvotes: 2

Related Questions