Vanúcia Schumacher
2012-Feb-21 14:24 UTC
[R] help error: In dweibull(x, shape, scale, log) : NaNs produzidos
Guys, I'm having an error when I use the command: library(MASS)> dados<-read.table("inverno.txt",header=FALSE)> vento50<-fitdistr(dados[[1]],densfun="weibull")Mensagens de aviso perdidas:1: In dweibull(x, shape, scale, log) : NaNs produzidos2: In dweibull(x, shape, scale, log) : NaNs produzidos3: In dweibull(x, shape, scale, log) : NaNs produzidos4: In dweibull(x, shape, scale, log) : NaNs produzidos5: In dweibull(x, shape, scale, log) : NaNs produzidos6: In dweibull(x, shape, scale, log) : NaNs produzidos> vento50 shape scale 0.61473436 2.43536064 (0.01895222) (0.13202750) Can someone help?? Regards! [[alternative HTML version deleted]]
Vanúcia Schumacher
2012-Feb-21 15:14 UTC
[R] FW: help error: In dweibull(x, shape, scale, log) : NaNs produzidos
Vanúcia SchumacherCurso de graduação em meteorologia - UFPELBolsista do Programa de Educação Tutorial - PET From: vanucia-schumacher@hotmail.com To: r-help@r-project.org Subject: help error: In dweibull(x, shape, scale, log) : NaNs produzidos Date: Tue, 21 Feb 2012 14:24:02 +0000 Guys, I'm having an error when I use the command: library(MASS)> dados<-read.table("inverno.txt",header=FALSE)> vento50<-fitdistr(dados[[1]],densfun="weibull")Mensagens de aviso perdidas:1: In dweibull(x, shape, scale, log) : NaNs produzidos2: In dweibull(x, shape, scale, log) : NaNs produzidos3: In dweibull(x, shape, scale, log) : NaNs produzidos4: In dweibull(x, shape, scale, log) : NaNs produzidos5: In dweibull(x, shape, scale, log) : NaNs produzidos6: In dweibull(x, shape, scale, log) : NaNs produzidos> vento50 shape scale 0.61473436 2.43536064 (0.01895222) (0.13202750) Can someone help?? Regards! [[alternative HTML version deleted]]
David Winsemius
2012-Feb-21 15:36 UTC
[R] help error: In dweibull(x, shape, scale, log) : NaNs produzidos
On Feb 21, 2012, at 9:24 AM, Van?cia Schumacher wrote:> > Guys, > I'm having an error when I use the command: > library(MASS)> dados<-read.table("inverno.txt",header=FALSE)> > vento50<-fitdistr(dados[[1]],densfun="weibull")Mensagens de aviso > perdidas:1: In dweibull(x, shape, scale, log) : NaNs produzidos2: In > dweibull(x, shape, scale, log) : NaNs produzidos3: In dweibull(x, > shape, scale, log) : NaNs produzidos4: In dweibull(x, shape, scale, > log) : NaNs produzidos5: In dweibull(x, shape, scale, log) : NaNs > produzidos6: In dweibull(x, shape, scale, log) : NaNs produzidos> > vento50 shape scale 0.61473436 2.43536064 > (0.01895222) (0.13202750) >It's not an error, it's only a warning, at least to the level of my ability to read Spanish. It suggests you managed to send negative or infinite numbers to dweibull, a distribution which only supports values when given positive, finite numbers. Look at your data more closely. And learn to post in plain text. HTML does a poor job of communication. -- David Winsemius, MD West Hartford, CT
peter dalgaard
2012-Feb-21 16:43 UTC
[R] help error: In dweibull(x, shape, scale, log) : NaNs produzidos
On Feb 21, 2012, at 16:36 , David Winsemius wrote:> It suggests you managed to send negative or infinite numbers to dweibull, a distribution which only supports values when given positive, finite numbers. Look at your data more closely.Zeros are a common cause, too. For a < 1 (the shape parameter), the Weibull density has a singularity at zero, and fitdistr() is not tolerant of observations rounded to zero in such cases. -- Peter Dalgaard, Professor Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
David Winsemius
2012-Feb-21 17:49 UTC
[R] help error: In dweibull(x, shape, scale, log) : NaNs produzidos
On Feb 21, 2012, at 11:43 AM, peter dalgaard wrote:> > On Feb 21, 2012, at 16:36 , David Winsemius wrote: > >> It suggests you managed to send negative or infinite numbers to >> dweibull, a distribution which only supports values when given >> positive, finite numbers. Look at your data more closely. > > Zeros are a common cause, too. For a < 1 (the shape parameter), the > Weibull density has a singularity at zero, and fitdistr() is not > tolerant of observations rounded to zero in such cases.And that may be more correct than my guess. I see that the estimate for the shape parameter from fitdistr is less than 1 and was surprised that dweibull(-1, 2,2) does give a returned value of 0. > dweibull(-.1, 0.61473436, 2.43536064 ) [1] 0 > dweibull(0, 0.61473436, 2.43536064 ) [1] Inf > dweibull(0, 1.61473436, 2.43536064 ) [1] 0 -- David Winsemius, MD West Hartford, CT
Vanúcia Schumacher
2012-Feb-21 18:10 UTC
[R] help error: In dweibull(x, shape, scale, log) : NaNs produzidos
Hi, then, If I replace the midpoint 0.0025 average values equal to 0there won't be prejudice in the results?Would then be the best thing to do? regards,> Subject: Re: [R] help error: In dweibull(x, shape, scale, log) : NaNs produzidos > From: pdalgd@gmail.com > Date: Tue, 21 Feb 2012 18:55:51 +0100 > To: vanucia-schumacher@hotmail.com > > > On Feb 21, 2012, at 18:34 , Vanúcia Schumacher wrote: > > > Thank's, > > > > but then I could simply round off my data which are equal to zero to 0.00001? > > Something like that. I'd maybe try something a little more carefully considered. E.g. if your data are rounded to two decimal figures, the "zeros" represent values of x with > > 0 < x < 0.005 > > since anything bigger would be rounded to 0.01. So replace with the interval midpoint of 0.0025. > > (One can do better by modifying the likelihood, but then you essentially have to rewrite fitdistr().) > > > > > Att, > > > > Vanúcia Schumacher > > Curso de graduação em meteorologia - UFPEL > > Bolsista do Programa de Educação Tutorial - PET > > > > > > > Subject: Re: [R] help error: In dweibull(x, shape, scale, log) : NaNs produzidos > > > From: pdalgd@gmail.com > > > Date: Tue, 21 Feb 2012 17:43:07 +0100 > > > CC: vanucia-schumacher@hotmail.com; r-help@r-project.org > > > To: dwinsemius@comcast.net > > > > > > > > > On Feb 21, 2012, at 16:36 , David Winsemius wrote: > > > > > > > It suggests you managed to send negative or infinite numbers to dweibull, a distribution which only supports values when given positive, finite numbers. Look at your data more closely. > > > > > > Zeros are a common cause, too. For a < 1 (the shape parameter), the Weibull density has a singularity at zero, and fitdistr() is not tolerant of observations rounded to zero in such cases. > > > > > > -- > > > Peter Dalgaard, Professor > > > Center for Statistics, Copenhagen Business School > > > Solbjerg Plads 3, 2000 Frederiksberg, Denmark > > > Phone: (+45)38153501 > > > Email: pd.mes@cbs.dk Priv: PDalgd@gmail.com > > > > > -- > Peter Dalgaard, Professor > Center for Statistics, Copenhagen Business School > Solbjerg Plads 3, 2000 Frederiksberg, Denmark > Phone: (+45)38153501 > Email: pd.mes@cbs.dk Priv: PDalgd@gmail.com >[[alternative HTML version deleted]]