Hi Rui, Â Yes, it works beatifully this time. Â Thank you so much for your help.
________________________________ From: Rui Barradas <ruipbarra...@sapo.pt> Cc: R help forum <R-help@r-project.org> Sent: Wednesday, July 17, 2013 11:28 PM Subject: Re: [R] error message in gev Hello, And what if you try it without a block value? out.list <- lapply(dat, gev) Rui Barradas Em 17-07-2013 14:53, Roslina Zakaria escreveu: > Hi Rui, > I have tried different block values and below are the error message I got: > >>out <- gev(dat, "A") > Error in as.POSIXlt.default(attributes(data)$times) : > >Â Â do not know how to convert 'attributes(data)$times' to class >âPOSIXltâ > > > > out.list <- lapply(dat, gev, block = 10) > Error in optim(theta, negloglik, hessian = TRUE, ..., tmp = data) : >Â Â non-finite finite-difference value [2] > > > *From:* Rui Barradas <ruipbarra...@sapo.pt> > *Cc:* 'r-help' <r-help@r-project.org> > *Sent:* Wednesday, July 17, 2013 8:49 PM > *Subject:* Re: [R] error message in gev > > Hello, > > It's better if you Cc the list, the odds of getting more and better > answers are greater. > > Have you tried with different block values? > > Rui Barradas > > Em 17-07-2013 13:33, Roslina Zakaria escreveu: >Â > Hi Rui, >Â > Yes, I am using gev from 'evir' >Â > install.packages("evir") >Â > library(evir) >Â > I have tried your suggestion and follow are what I got. >Â > >Â >>out.list <- lapply(dat, gev, block = 20) >Â > Error in optim(theta, negloglik, hessian = TRUE, ..., tmp = data) : >Â >Â Â non-finite finite-difference value [1] >Â > In addition:Warning messages: >Â > 1: In FUN(X[[7L]], ...) : optimization may not have succeeded >Â > 2: In FUN(X[[7L]], ...) : optimization may not have succeeded >Â > 3: In sqrt(diag(varcov)) : NaNs produced >Â > 4: In FUN(X[[7L]], ...) : optimization may not have succeeded >Â > 5: In FUN(X[[7L]], ...) : optimization may not have succeeded >Â > 6: In FUN(X[[7L]], ...) : optimization may not have succeeded >Â > 7: In FUN(X[[7L]], ...) : optimization may not have succeeded >Â > >Â > >Â > >Â > Thank you. >Â > >Â > >Â > *From:* Rui Barradas <ruipbarra...@sapo.pt <mailto:ruipbarra...@sapo.pt>> com>> >Â > *Cc:* "r-help@r-project.org <mailto:r-help@r-project.org>" > <r-help@r-project.org <mailto:r-help@r-project.org>> >Â > *Sent:* Wednesday, July 17, 2013 5:51 PM >Â > *Subject:* Re: [R] error message in gev >Â > >Â > Hello, >Â > >Â > You should say which package is gev() coming from. I believe it's from >Â > evir, and what follows assumes that. >Â > The problem is that 'dat' is a data.frame, a special type of list. It is >Â > a list of vectors and gev is expecting just one vector. You could try >Â > instead, to fit generalized extreme value distributions to each of the >Â > vectors in the data.frame, >Â > >Â > out.list <- lapply(dat, gev, block = 20) >Â > >Â > >Â > to get a list of 10 objects of class gev, like the help page says. >Â > >Â > Hope this helps, >Â > >Â > Rui Barradas >Â > >Â > Em 17-07-2013 10:33, Roslina Zakaria escreveu: >Â >Â > >Â >Â > Hi r-users, >Â >Â > >Â >Â > I would like to use gev and my data (annual rainfall ) is as follows: >Â >Â > >Â >Â >> head(dat,20)Â AÂ Â BÂ Â CÂ Â DÂ Â EÂ Â FÂ Â GÂ Â HÂ >Â I J >Â >Â > 1Â 45.1 41.5 58.5 50.1 46.0 49.1 37.7 49.1 59.8 54.0 >Â >Â > 2Â 50.3 39.8 49.4 56.4 49.4 48.8 42.1 49.8 49.4Â 58.3 >Â >Â > 3Â 41.7 39.3 44.6 39.1 35.7 41.5 40.8 40.8 38.5Â 45.6 >Â >Â > 4Â 50.7 33.9 48.4 28.2 35.5 39.1 61.4 17.0 30.7Â 38.3 >Â >Â > 5Â 39.3 30.6 46.9 23.8 25.8 17.1 37.9 40.1 35.4Â 30.1 >Â >Â > 6Â 50.2 43.6 55.5 26.7 36.6 20.6 35.2 46.0 52.2Â 30.5 >Â >Â > 7Â 46.0 37.0 55.3 36.3 51.9 50.6 43.2 44.9 38.2Â 45.4 >Â >Â > 8Â 46.0 15.4 35.7 27.3 40.2 21.2 41.1 65.7 35.7Â 28.7 >Â >Â > 9Â 52.0 36.5 49.6 55.0 38.3 32.0 43.8 43.8 50.3Â 36.5 >Â >Â > 10 57.5 51.0 47.0 63.0 43.0 46.5 41.5 82.8 50.5Â 38.5 >Â >Â > 11 71.0 48.0 59.5 48.5 47.0 57.5 55.8 64.5 60.0Â 43.4 >Â >Â > 12 57.5 52.5 58.5 42.0 62.0 44.0 47.5 59.5 45.0Â 51.5 >Â >Â > 13 47.0 38.0 49.9 50.5 55.0 57.5 51.5 54.5 45.0Â 49.7 >Â >Â > 14 66.5 44.4 60.0 99.5 54.5 41.3 57.0 69.5 33.0Â 58.4 >Â >Â > 15 61.5 43.6 68.5 50.7 48.0 50.5 50.5 58.8 53.2Â 47.0 >Â >Â > 16 55.5 58.5 55.5 45.8 48.0 57.0 52.0 48.5 58.5 437.5 >Â >Â > 17 96.7 96.7 96.7 45.5 65.1 46.5 51.0 96.7 61.3 310.5 >Â >Â > 18 71.5 55.5 63.0 52.5 59.0 55.5 55.5 51.1 47.0Â 49.5 >Â >Â > 19 71.5 42.5 64.0 56.5 61.0 54.0 46.5 53.7 43.0Â 44.0 >Â >Â > 20 57.5 51.5 51.3 34.0 55.0 61.0 55.5 51.3 51.3Â 44.5 >Â >Â > >Â >Â > When I apply the gev function, I have the following error message: >Â >Â > >Â >Â > out <- gev(dat, 20) Error in gev(dat, 20) : (list) object cannot be >Â > coerced to type 'double' >Â >Â > >Â >Â > Can anybody explain to me what does it means. I tried to read the >Â > package manual but could not understand about the block. >Â >Â > >Â >Â > Thank you so much for any help given. >Â >Â >Â Â [[alternative HTML version deleted]] >Â >Â > >Â >Â > >Â >Â > >Â >Â > ______________________________________________ >Â >Â > R-help@r-project.org <mailto:R-help@r-project.org> > <mailto:R-help@r-project.org <mailto:R-help@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 > <http://www.r-project.org/posting-guide.html> >Â >Â > and provide commented, minimal, self-contained, reproducible code. >Â >Â > >Â > >Â > > > [[alternative HTML version deleted]]
______________________________________________ R-help@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.