Full_Name: Kjetil Kjernsmo Version: 1.0.1 OS: osf1 Submission from: (NULL) (129.240.28.227) Hello! I'm getting strange numbers from a random number generation function again. I was wondering if it could be the same problem as I reported in (PR#439). I'm using the functions (some comments deleted for brevity): qamp <- function(p, type=c("point", "nolens")) { if(type == "point") return(1 / (2 * sqrt(1 - p))) else return(1) } ramp <- function(n, type=c("point", "nolens")) { if(type == "point") return(qamp(runif(n), type)) else return(rep(1, n)) } ...to generate random numbers. I think there might be something wrong with runif, possibly the same problem as rpois had. More details: I'm calling this function a number of times through a function intensityfromcloud <- function(ncloudsbin, cloudintensity, amptype, exptime, ...) { amps <- ramp(ncloudsbin, amptype) write(c(max(amps), sum(amps), sum(amps - 1)), "lastamps.dat", ncolumns=3, append=T) return(cloudintensity * exptime * amps) } ...that is called a lot. As you can see, I'm writing the maximum (among other things) of the generated numbers to file (this is a preliminary hack, for a (quite unrelated) sanity check I'm running). Now, it turns out that in 8080 maxima, the number 14654.29 appears twice. Things like that happen, this _is_ statistics, and my pdf doesn't fall that fast, but you know... I thought I'd report this sooner the better... I made a histogram of the logarithm of the maxima for the 8080 points and put it at <URL:http://www.astro.uio.no/~kjetikj/tmp/ampsmax.ps> BTW, update on my other reports: The problem I had with match.arg() (PR#536) was in the same piece of code, and unfortunately, it seems to happen with 1.0.1 as well. About my crashes, PR#545 and PR#551, I had another crash today, and I have a 250MB (Warning! :-)) core dump at <URL:http://www.astro.uio.no/~kjetikj/tmp/core2> I was doing a summary of a rather strange data.frame, I was just curious as to what summary would say to such a thing. I don't know if it would be of any use. Uwe suggested that it might be a hardware problem, and I have contacted my sysadm, and a check will hopefully be performed on Friday. If it would be useful to see my actions prior to the crash, please let me know. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Tue, 23 May 2000 kjetikj@astro.uio.no wrote:> Full_Name: Kjetil Kjernsmo > Version: 1.0.1 > OS: osf1 > Submission from: (NULL) (129.240.28.227) > > > Hello! > > I'm getting strange numbers from a random number generation > function again. I was wondering if it could be the same problem > as I reported in (PR#439). > > I'm using the functions (some comments deleted for brevity): > > qamp <- function(p, type=c("point", "nolens")) > { > if(type == "point") > return(1 / (2 * sqrt(1 - p))) > else return(1) > } > > ramp <- function(n, type=c("point", "nolens")) > { > if(type == "point") > return(qamp(runif(n), type)) > else return(rep(1, n)) > } > > ...to generate random numbers. I think there might be something wrong > with runif, possibly the same problem as rpois had.Not at all, that problem is fixed.> More details: > I'm calling this function a number of times through a function > intensityfromcloud <- function(ncloudsbin, cloudintensity, amptype, > exptime, ...) > { > amps <- ramp(ncloudsbin, amptype) > write(c(max(amps), sum(amps), sum(amps - 1)), > "lastamps.dat", ncolumns=3, append=T) > return(cloudintensity * exptime * amps) > } > ...that is called a lot. As you can see, I'm writing the maximum > (among other things) of the generated numbers to file > (this is a preliminary hack, for a (quite unrelated) sanity > check I'm running). > Now, it turns out that in 8080 maxima, the number 14654.29 appears > twice. Things like that happen, this _is_ statistics, > and my pdf doesn't fall that fast, but you know... > I thought I'd report this sooner the better...And which random number generator are you using? And have you a proven stable procedure based on its results? (Doesn't look like it, I have to say.) Please do read the advice in the FAQ on reporting a bug. There is npthing here that I can see is a bug, or see how to investigate. All PRNGs have deficiencies, and you have to program procedures to take account of them. R provides several alternatives for you to try out. Do make use of them! -- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._