search for: 1e5

Displaying 20 results from an estimated 113 matches for "1e5".

Did you mean: 15
2019 Mar 01
1
issue with sample in R 3.6.0.
...is an issue in the sampling rejection algorithm in R 3.6.0. The do_sample2 function in src/main/unique.c still has 4.5e15 as an upper limit, implying that numbers greater than INT_MAX are still to be supported by sample in base R. Please review the examples below: set.seed(123) max(sample(2^31, 1e5)) [1] 2147430096 set.seed(123) max(sample(2^31 + 1, 1e5)) [1] 1 set.seed(123) max(sample(2^32, 1e5)) [1] 1 set.seed(123) max(sample(2^35, 1e5)) [1] 8 set.seed(123) max(sample(2^38, 1e5)) [1] 64 set.seed(123) max(sample(2^38, 1e5)) [1] 64 set.seed(123) max(sample(2^42, 1e5)) [1] 1024 >From...
2009 Mar 27
1
Out of memory crash on 64-bit Fedora
...machine. I don't know if this is an R problem or a Fedora problem (I suppose the kernal should be killing R before it crashes, but shouldn't R stop before it takes all the memory?). To replicate this behavior, I can crash the system by allocating more and more memory in R: v1=matrix(nrow=1e5,ncol=1e4) v2=matrix(nrow=1e5,ncol=1e4) v3=matrix(nrow=1e5,ncol=1e4) v4=matrix(nrow=1e5,ncol=1e4) etc. until R claims all RAM and swap space, and crashes the machine. If I try this on a windows machine eventually the allocation fails with an error in R, " Error: cannot allocate vector of siz...
2010 Jan 26
1
splitting a factor column into binary columns for each factor
...rep("44444444", 4*n)) orig.unique <- unique(orig) names(orig.unique) <- orig.unique time <- system.time(df <- data.frame(check.names=FALSE, lapply(orig.unique, function(x) as.numeric(orig == x)))) list(time = time, df = df) } For n=10^5 the times were > g0(1e5)$time user system elapsed 20.65 0.41 20.64 > g1(1e5)$time user system elapsed 2.35 0.05 2.36 > g2(1e5)$time user system elapsed 0.73 0.10 0.77 and the data.frames each produced were identical. Another approach is to use outer() to make a matrix...
2016 Oct 20
2
[test-suite] making polybench/symm succeed with "-Ofast" and "-ffp-contract=on"
...e minimum relative tolerance that you need for them to pass? Setting FP_ABSTOLERANCE=1e-5, the two tests are passing when compiled with -Ofast for the following relative tolerance: polybench/linear-algebra/kernels/symm, FP_TOLERANCE=1e-10 polybench/linear-algebra/solvers/gramschmidt, FP_TOLERANCE=1e5 gramschmidt passes validation against reference output, symm does not pass validation against reference output: I have opened a bug for that: "__attribute__((optnone)) not respected with -ffast-math or -Ofast" https://llvm.org/bugs/show_bug.cgi?id=30745 Sebastian
2005 Feb 11
1
Re: [R-SIG-Mac] Bug running pbinom() in R-GUI?
On Feb 10, 2005, at 7:38 PM, George W. Gilchrist wrote: > Today I was running a graduate level stats lab using R and we > encountered a > major problem while using the current build of the Cocoa GUI: > >> From the GUI: >> system.time(pbinom(80, 1e5, 806/1e6)) > [1] 14.37 4.94 30.29 0.00 0.00 >> > >> From the command line on the same machine: >> system.time(pbinom(80, 1e5, 806/1e6)) > [1] 0.02 0.00 0.02 0.00 0.00 >> > > I've tried the CRAN version and the latest build of the R-GUI and both > del...
2004 Mar 07
6
applying data generating function
Hello Coming from matlab background, I could use some help on this one. I need to generate a data set based on this equation X(t) = 3.8x(t-1) (1-x(t-1)) + e(t), where e(t) is a N(0,0,001) random variable I need say 100 values. How do I do this? Thanks
2019 Feb 07
6
Optimización identificación de casos similares
Buen día a todos, Agradezco su ayuda con lo siguiente: Tengo 100.000 registros con nombres de personas con su respectivo número de documento, quiero identificar casos que tengan un porcentaje de igualdad alto, no del 100% porque ya esos los tengo identificados, sino casos como por ejemplo: Nombre: Juan Pérez Documento: 123456789 Nombre: Juan Pérez Documento: 1234056789 Este caso sería una
2005 Feb 14
3
'combinations' in gtools and stack overflow
Dear R-users, Let me ask about the 'stack overflow' error which I got when I used the function 'combinations' in "gtools". The following is what I did: --------- library(gtools) options(expressions=1e5) combinations(500, 3, 1:500) # or combinations(400, 2, 1:400) Error: protect(): stack overflow --------- How can I overcome this error? Is there perhaps any other function to do this more efficiently? Hope that somone can help me out. Thanks in advance. Lee P.S. R 2.0.0; alphaev68-dec-osf4.0f
2013 May 23
0
Code compilation: Drop certain statements in a function before calling it multiple times?
...foo <- function(...) { ... }; if (verbose) { foo <- dropVerbose(foo); } foo(..., verbose=verbose); } Instead of me reinventing the wheel does anyone know of tools that makes it easier to drop certain statements in existing functions? RESULTS: > t <- system.time(for (k in 1:1e5) foo()); > tT <- system.time(for (k in 1:1e5) fooT()); > tT/t user system elapsed 0.6635514 NaN 0.6605505 I am aware of the 'compiler' package, which is great, but as far as I understand the above speed up when dropping statements still applies; > fooC <- co...
2001 Nov 06
1
R-devel & ATLAS generates Dr. Watson on NT (was RE: Look, Wa tson! La.svd & ATLAS)
...ve two versions of ATLAS 3.2.1. One was compiled on my old Thinkpad 600E (PII), the other was compiled on my new Thinkpad T22 (PIIISSE1). I compiled R-devel dated 10/31, 11/01 and 11/04, linked against either of the two ATLAS libs. All gave Dr. Watson when given this code: La.svd(matrix(runif(1e5), 1e3, 1e2)) (There's no problem with smaller matrices, say 100x100.) When compiled without ATLAS, the above code ran fine in all three R-devel's. I tried R-1.3.1 with both ATLAS libs, and both ran fine. Any ideas on what could be wrong? Seems like R-devel doesn't like ATLAS, at le...
2017 Oct 03
0
Revert to R 3.2.x code of logicalSubscript in subscript.c?
...d read mods-dir/README if you want to build this, and in particular, you need to run create-configure in the top-level source directory first. I modified your tests a bit, including producing versions using both vectors of length 1e8 like you did (which will not fit in cache) and vectors of length 1e5 (which will fit in at least the L3 cache). I ran tests on an Intel Skylake processor (E3-1270v5 @ 3.6GHz), using gcc 7.2 with -O3 -march=native -mtune=native. I got the following results with R-3.4.2 (with R_ENABLE_JIT=0, which is slightly faster than using the JIT compiler): R-3.4.2, LARGE VECT...
2010 Jan 26
0
splitting a factor column into binary columns for each level
...rep("44444444", 4*n)) orig.unique <- unique(orig) names(orig.unique) <- orig.unique time <- system.time(df <- data.frame(check.names=FALSE, lapply(orig.unique, function(x) as.numeric(orig == x)))) list(time = time, df = df) } For n=10^5 the times were > g0(1e5)$time user system elapsed 20.65 0.41 20.64 > g1(1e5)$time user system elapsed 2.35 0.05 2.36 > g2(1e5)$time user system elapsed 0.73 0.10 0.77 and the data.frames each produced were identical. Another approach is to use outer() to make a matrix...
2001 Nov 02
1
Look, Watson! La.svd & ATLAS
...`demo()' for some demos, `help()' for on-line help, or `help.start()' for a HTML browser interface to help. Type `q()' to quit R. > set.seed(1) > x <- matrix(runif(1e4), 1e2, 1e2) > invisible(La.svd(x)) # This ran fine. > x <- matrix(runif(1e5), 1e3, 1e2) > invisible(La.svd(x)) (Dr. Watson says there's an access violation.) So far La.svd is the only thing I know of that generates Dr. Watson. The version info: _ platform i386-pc-mingw32 arch x86 os...
2018 Oct 04
2
Bug : Autocorrelation in sample drawn from stats::rnorm (hmh)
...thought I'd just add what I could from playing around with it a little bit. For anyone who wishes to give it a try, I suggest this implementation of the autocorrelation tester which is about 80 times faster: DistributionAutocorrelation_new <- function(SampleSize)????{ ? ? Cor <- replicate(1e5, function() {X <- rnorm(SampleSize)? ? return(cor(X[-1], X[-length(X)]))})? ? return(Cor)} I have the same Stats package version installed. - (Thomas) William BellHons BSc Candidate (Biology and Mathematics)BA Candidate (Philosophy)McMaster University # Hi,#?#?# I just noticed the following bug:...
2018 Oct 04
2
Bug : Autocorrelation in sample drawn from stats::rnorm (hmh)
...thought I'd just add what I could from playing around with it a little bit. For anyone who wishes to give it a try, I suggest this implementation of the autocorrelation tester which is about 80 times faster: DistributionAutocorrelation_new <- function(SampleSize)????{ ? ? Cor <- replicate(1e5, function() {X <- rnorm(SampleSize)? ? return(cor(X[-1], X[-length(X)]))})? ? return(Cor)} I have the same Stats package version installed. - (Thomas) William BellHons BSc Candidate (Biology and Mathematics)BA Candidate (Philosophy)McMaster University # Hi,#?#?# I just noticed the following bug:...
2010 Nov 06
1
Hashing and environments
...y.lexicon <- new("Lexicon",wfreqs=c("the"=2,"person"=1)) wfreq(my.lexicon,"the") *** However, testing indicates that the way I have set this up does not achieve the intended benefits of having the environment hashed: *** sample.wfreqs <- trunc(runif(1e5,max=100)) names(sample.wfreqs) <- as.character(1:length(sample.wfreqs)) lex <- new("Lexicon",wfreqs=sample.wfreqs) words.to.lookup <- trunc(runif(100,min=1,max=1e5)) ## look up the words directly from the sample.wfreqs vector system.time({ for(i in words.to.lookup) sample.wfre...
2010 Aug 24
3
multiple assignments ?
Simple one, have read and googled, still no luck! I want to create several empty vectors all of the same length. I would like multiple empty vectors (vec1, vec2, vec3) and want to create them all in one line. I've tried vec1,vec2,vec3 <- vector(length=5) and c(vec1,vec2,vec3) <- vector(length=5) and several other attempts but nothing seems to work ... suggestions? Thanks Jim
2011 Oct 17
1
compressing/reducing data for plot
...001 5.224477718002e-006 2.000000000000e-009 7.218354344368e-001 5.224477718002e-006 4.000108361244e-009 7.218354344368e-001 5.224478627497e-006 8.000325083733e-009 7.218354344368e-001 5.224478627497e-006 as the timesteps are small, each simulation results in a lot of data, about 1e5 data points per simulation. Now I want to plot this data. If I do this with a simple plot(x=data$Time, y=data$V, type="l") the resulting file (I plot into postscript files) is huge and takes a long time to render, since R creates a new line segment for each timestep. Of course it makes...
2004 Nov 26
2
sorting a data.frame using a vector
Hi all, I'm looking for an efficient solution (speed and memory) for the following problem: Given - a data.frame x containing numbers of type double with nrow(x)>ncol(x) and unique row lables and - a character vector y containing a sorted order labels Now, I'd like to sort the rows of the data.frame x w.r.t. the order of labels in y. example: x <- data.frame(c(1:4),c(5:8))
2010 Jul 09
3
apply is slower than for loop?
...apply actually takes a significantly longer than a for loop. Am I missing something? It doesn't matter much if I do column wise calculations rather than row wise ## Example of how apply is SLOWER than for loop: #rm(list=ls()) ## DEFINE VARIABLES mu=0.05 ; sigma=0.20 ; dt=.25 ; T=50 ; sims=1e5 timesteps = T/dt ## MAKE PHI AND DS phi = matrix(rnorm(timesteps*sims), nrow=sims, ncol=timesteps) ds = mu*dt + sigma * sqrt(dt) * phi ## USE APPLY TO CALCULATE ROWWISE CUMULATIVE PRODUCT system.time(y1 <- apply(1+ds, 1, cumprod)) ## UNTRANSFORM Y1, BECAUSE ROW APPLY FLIPS THE MATRIX y1=t(y1)...