I have a problem with a certain vector. I'm tying to find out IF it's gamma-distributed and (if so) what the parameters (shape, rate) are. MY vector has 400 entries but lets take e.g.
x <- c(45.94,31.04,17.49,9.81,6.34,4.18,2.93,2.01,1.61,1.27,1.04,0.809)
I read something about fitdistr(). But I didn't quite understand what it actually does! I tried thie following with my real (long) vector:
fitdistr(x, "gamma")
shape rate
0.167498708 0.519997226
(0.008849548) (0.068359517)
Warning messages:
1: In densfun(x, parm[1], parm[2], ...) : NaNs wurden erzeugt
2: In densfun(x, parm[1], parm[2], ...) : NaNs wurden erzeugt
3: In densfun(x, parm[1], parm[2], ...) : NaNs wurden erzeugt
4: In densfun(x, parm[1], parm[2], ...) : NaNs wurden erzeugt
5: In densfun(x, parm[1], parm[2], ...) : NaNs wurden erzeugt
6: In densfun(x, parm[1], parm[2], ...) : NaNs wurden erzeugt
7: In densfun(x, parm[1], parm[2], ...) : NaNs wurden erzeugt
What does the output mean? Are these my fitting parameters? I tested them, but the KS-Test gave me a negative result:
> ks.test(anzahl, "pgamma", 0.167498708, 0.519997226)
One-sample Kolmogorov-Smirnov test
data: anzahl
D = 0.3388, p-value < 2.2e-16
alternative hypothesis: two-sided
So could you maybe tell me how I can find out if my vector is gamma-distributed and what the parameters are?