Hello,
 
I want to fit a tree parameter distribution to given data. I tried it with
sample data using the "fitdistr" function.
 
Here my workflow that didn't had any result:
 
I started with the generalized gamma distr, which is:
r*dgamma(x^r,shape,rate)
 
The R-function is: 
 
ggamma = function (x,r,shape,rate) r*dgamma(x^r,shape,rate=rate)
 
For the first step I assumed r = 1 and I generated random numbers with the
"standard" Gamma distr.
 
rn=rgamma(1000,10,5)
 
In the last step I want to reconstruct the parameters from the dataset:
 
library(MASS)
fitdistr(rn, ggamma, list(r=1,shape=10,rate=5))
 
 
But there is an error: Error in fitdistr(rn, ggamma, list(r = 1, shape = 10,
rate = 5)) :  optimization failed
although I should have a nearly model-made dataset.
 
Where is the problem and how could it be solved?
 
Carsten

        [[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to