[R] three par. fitting with fitdistr

From: Carsten Steinhoff <carsten.steinhoff_at_stud.uni-goettingen.de>
Date: Wed 13 Jul 2005 - 01:49:34 EST


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 Received on Wed Jul 13 01:52:52 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:34 EST