Kaptue Tchuente, Armel
2013-Jun-12 00:25 UTC
[R] how to extract coefficient from a gamma distribution?
Hello everyone, I'm trying to fit the gamma probability distribution to time series datasets suing the following command gam<-fitdistr(x=hist2fit,"gamma") where hist2fit is the bar histogram of a sample distribution. The problem is that for some points, it is not possible to fit the gamma distribution for instance with an histogram having identical value. I would like to know how to test whether the command gam<-fitdistr(x=hist2fit,"gamma") properly ended such that I can decide to save the gamma-parameters (for instance as NaN in this case). Without this test, the program stops when I try to store the scale and the shape parameters. Any thoughts for a code will be very much appreciated. Thanks Armel [[alternative HTML version deleted]]
David Winsemius
2013-Jun-12 00:42 UTC
[R] how to extract coefficient from a gamma distribution?
On Jun 11, 2013, at 5:25 PM, Kaptue Tchuente, Armel wrote:> I'm trying to fit the gamma probability distribution to time series datasets suing the following command gam<-fitdistr(x=hist2fit,"gamma") where hist2fit is the bar histogram of a sample distribution. > > The problem is that for some points, it is not possible to fit the gamma distribution for instance with an histogram having identical value. > > I would like to know how to test whether the command gam<-fitdistr(x=hist2fit,"gamma") properly ended such that I can decide to save the gamma-parameters (for instance as NaN in this case). >?try ?tryCatch> Without this test, the program stops when I try to store the scale and the shape parameters. > > Any thoughts for a code will be very much appreciated. > > >-- David Winsemius Alameda, CA, USA