I am using the MASS library function fitdistr(x, dpois, list(lambda=2)) but I get Error in optim(start, mylogfn, x = x, hessian = TRUE, ...) : Function cannot be evaluated at initial parameters In addition: There were 50 or more warnings (use warnings() to see the first 50) and all the first 50 warnings say 1: non-integer x = 1.452222 etc Can anyone tell me what I am doing wrong. p.s. the data was read in from a .csv file that I wrote using octave
Mark Miller <mmiller <at> nassp.uct.ac.za> writes:> > I am using the MASS library function > > fitdistr(x, dpois, list(lambda=2)) > > but I get > > Error in optim(start, mylogfn, x = x, hessian = TRUE, ...) : > Function cannot be evaluated at initial parameters > In addition: There were 50 or more warnings (use warnings() to see the first > 50) >The docs say: For the following named distributions, reasonable starting values will be computed if start is omitted or only partially specified: cauchy, gamma, logistic, negative binomial (parametrized by mu and size), t and weibull. dpois is not among them, so you probably have to provide reasonable starting values for the parameters. Dieter
Can you advise another distribution, was thinking of exponential, but was advised poisson since independent, forgot about requiring integers On Wednesday 02 November 2005 14:44, you wrote:> Mark Miller wrote: > > I am using the MASS library function > > > > fitdistr(x, dpois, list(lambda=2)) > > > > but I get > > > > Error in optim(start, mylogfn, x = x, hessian = TRUE, ...) : > > Function cannot be evaluated at initial parameters > > In addition: There were 50 or more warnings (use warnings() to see the > > first 50) > > > > and all the first 50 warnings say > > > > 1: non-integer x = 1.452222 > > etc > > > > Can anyone tell me what I am doing wrong. p.s. the data was read in from > > a .csv file that I wrote using octave > > Hi, Mark, > > If you think the data are poisson, the observations should be integers. > > --sundar
On Wed, 2 Nov 2005 14:32:52 +0200, Mark Miller wrote: MM> I am using the MASS library function MM> MM> fitdistr(x, dpois, list(lambda=2)) MM> MM> but I get MM> MM> Error in optim(start, mylogfn, x = x, hessian = TRUE, ...) : MM> Function cannot be evaluated at initial parameters MM> In addition: There were 50 or more warnings (use warnings() to see MM> the first 50) MM> MM> and all the first 50 warnings say MM> MM> 1: non-integer x = 1.452222 MM> etc MM> are the data integers (as implicit in the assumption of Poisson dist'n)? the above message seems to say that they are not Adelchi Azzalini -- Adelchi Azzalini <azzalini at stat.unipd.it> Dipart.Scienze Statistiche, Universit?? di Padova, Italia tel. +39 049 8274147, http://azzalini.stat.unipd.it/
Hi, Mark, Not without seeing you data. You only provide the first value is a warning message below. --sundar Mark Miller wrote:> Can you advise another distribution, was thinking of exponential, but was > advised poisson since independent, forgot about requiring integers > > > On Wednesday 02 November 2005 14:44, you wrote: > >>Mark Miller wrote: >> >>>I am using the MASS library function >>> >>>fitdistr(x, dpois, list(lambda=2)) >>> >>>but I get >>> >>>Error in optim(start, mylogfn, x = x, hessian = TRUE, ...) : >>> Function cannot be evaluated at initial parameters >>>In addition: There were 50 or more warnings (use warnings() to see the >>>first 50) >>> >>>and all the first 50 warnings say >>> >>>1: non-integer x = 1.452222 >>>etc >>> >>>Can anyone tell me what I am doing wrong. p.s. the data was read in from >>>a .csv file that I wrote using octave >> >>Hi, Mark, >> >>If you think the data are poisson, the observations should be integers. >> >>--sundar
At 10:32 2/11/2005, you wrote:>I am using the MASS library function > >fitdistr(x, dpois, list(lambda=2)) > >but I get > >Error in optim(start, mylogfn, x = x, hessian = TRUE, ...) : > Function cannot be evaluated at initial parameters >In addition: There were 50 or more warnings (use warnings() to see the first >50) > >and all the first 50 warnings say > >1: non-integer x = 1.452222 >etc > >Can anyone tell me what I am doing wrong. p.s. the data was read in from >a .csv file that I wrote using octaveMark, Try fitdistr(x, "Poisson") I think this is enough for fit Poisson distribuition for your data Bernardo Rangel Tura, MD, MSc National Institute of Cardiology Laranjeiras Rio de Janeiro Brazil --