Re: [R] Error in optim while using fitdistr() function for estimationof parameters

From: <Bill.Venables_at_csiro.au>
Date: Sun, 10 Feb 2008 17:13:04 +1000

Chenge your model, most likely.

You are telling us a) the response is discrete and b) there is a substantial probability that the value is zero. The gamma distributon is a model for a continuous response, your response is integer valued. Perhaps you should consider something the Poisson or Negative Binomial.

Evem from the little you give us, the problem seems more statistical than computational to me.

Bill Venables
CSIRO Laboratories
PO Box 120, Cleveland, 4163
AUSTRALIA

Office Phone (email preferred): +61 7 3826 7251
Fax (if absolutely necessary):  +61 7 3826 7304
Mobile:                         +61 4 8819 4402
Home Phone:                     +61 7 3286 7700
mailto:Bill.Venables_at_csiro.au
http://www.cmis.csiro.au/bill.venables/

-----Original Message-----
From: r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-project.org] On Behalf Of Aswad Gurjar
Sent: Sunday, 10 February 2008 4:17 PM
To: r-help_at_r-project.org
Subject: [R] Error in optim while using fitdistr() function for estimationof parameters

  Hello,

I am trying to fit distribution for data consisting of 421 readings.It is
basically no of requests arrived per minute.It contains many 0 entries as no
of requests.When i use
fd<-fitdistr(V2,"gamma")
I get following error:
Error in optim(x = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, :

        initial value in 'vmmin' is not finite

What should I do ? I need this function because I want to get value of estimated parameters.
Is there any other function to perform such calculations? Please help me.
Thank You.

Code is as follows:
x<-data.frame()
N<-data.frame((read.table("cs2ip.txt"))) attach(N)
library(MASS)
fd<-fitdistr(V2,"gamma")

Aswad

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sun 10 Feb 2008 - 07:26:20 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 10 Feb 2008 - 09:30:13 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive