Re: [R] Gamma distribution parameter estimation

2011-08-07 Thread Rolf Turner
On 08/08/11 13:20, Peter Ehlers wrote: On 2011-08-07 16:57, Rolf Turner wrote: Neither Ted Harding's post, nor Prof. Ripley's, really appear to address the OP's follow-up question which was *why* did he get the ``weird error'' (non-finite finite difference, NaNs produced) when he applied fitd

Re: [R] Gamma distribution parameter estimation

2011-08-07 Thread Peter Ehlers
On 2011-08-07 16:57, Rolf Turner wrote: Neither Ted Harding's post, nor Prof. Ripley's, really appear to address the OP's follow-up question which was *why* did he get the ``weird error'' (non-finite finite difference, NaNs produced) when he applied fitdistr(), as he was advised to do by Jorge

Re: [R] Gamma distribution parameter estimation

2011-08-07 Thread Rolf Turner
Neither Ted Harding's post, nor Prof. Ripley's, really appear to address the OP's follow-up question which was *why* did he get the ``weird error'' (non-finite finite difference, NaNs produced) when he applied fitdistr(), as he was advised to do by Jorge Ivan Velez. The ``weird error'' did

Re: [R] Gamma distribution parameter estimation

2011-08-07 Thread J. R. M. Hosking
On 2011-08-06 15:14, Alexander Engelhardt wrote: Hey, I have a set of income data which I'd like to fit to a gamma distribution. How can I estimate the two parameters of the gamma distribution for a vector, e.g. c(2039L, 2088L, 5966L, 2353L, 1966L, 2312L, 3305L, 2013L, 3376L, 3363L, 3567L, 4798L

Re: [R] Gamma distribution parameter estimation

2011-08-07 Thread Prof Brian Ripley
Well, 'Alexander Engelhardt' failed to follow the posting guide, and so did not get a reply from some knowledgeable people. (1) When using fitdistr you need to roughly scale your data: e.g. divide by 1000 here. (2) fitdistr does 'go down the maximum likeilhood route' and it does find reasona

Re: [R] Gamma distribution parameter estimation

2011-08-06 Thread Ted Harding
On 06-Aug-11 19:37:49, Alexander Engelhardt wrote: > On 08/06/2011 09:23 PM, Jorge Ivan Velez wrote: >> Hi Alex, >> >> Try >> >>> require(MASS) >> Loading required package: MASS >>> b<- c(2039L, 2088L, 5966L, 2353L, 1966L, 2312L, 3305L, 2013L, 3376L, >> + 3363L, 3567L, 4798L, 2032L, 1699L, 3001L, 2

Re: [R] Gamma distribution parameter estimation

2011-08-06 Thread Alexander Engelhardt
On 08/06/2011 09:23 PM, Jorge Ivan Velez wrote: Hi Alex, Try require(MASS) Loading required package: MASS b<- c(2039L, 2088L, 5966L, 2353L, 1966L, 2312L, 3305L, 2013L, 3376L, + 3363L, 3567L, 4798L, 2032L, 1699L, 3001L, 2329L, 3944L, 2568L, + 1699L, 4545L) fitdistr(b, 'gamma') shape

Re: [R] Gamma distribution parameter estimation

2011-08-06 Thread Jorge Ivan Velez
Hi Alex, Try > require(MASS) Loading required package: MASS > b <- c(2039L, 2088L, 5966L, 2353L, 1966L, 2312L, 3305L, 2013L, 3376L, + 3363L, 3567L, 4798L, 2032L, 1699L, 3001L, 2329L, 3944L, 2568L, + 1699L, 4545L) > fitdistr(b, 'gamma') shape rate 6.4528939045 0.0021887943 (0.

[R] Gamma distribution parameter estimation

2011-08-06 Thread Alexander Engelhardt
Hey, I have a set of income data which I'd like to fit to a gamma distribution. How can I estimate the two parameters of the gamma distribution for a vector, e.g. c(2039L, 2088L, 5966L, 2353L, 1966L, 2312L, 3305L, 2013L, 3376L, 3363L, 3567L, 4798L, 2032L, 1699L, 3001L, 2329L, 3944L, 2568L, 169