Aswad Gurjar
2008-Feb-10 06:16 UTC
[R] Error in optim while using fitdistr() function for estimation of 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]]
Bill.Venables at csiro.au
2008-Feb-10 07:13 UTC
[R] Error in optim while using fitdistr() function for estimationof parameters
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.
Possibly Parallel Threads
- Error in optim while using fitdistr() function
- Problem with fitdistr function while estimating parameters
- Problem with fitdistr function
- Error while using fitdistr() function or goodfit() function
- Does goodfit() require frequency count of the numbers or numbers themselves?