R Under development (unstable) (2024-10-17 r87242 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > > library(randtoolbox) Loading required package: rngWELL This is randtoolbox. For an overview, type 'help("randtoolbox")'. > > mytrace <- TRUE > mytrace <- FALSE > > if(FALSE) + { + #degree 0 + res <- sobol.directions.mj(1, 1, 5) + apply(res, 2, bit2int) + + + #degree 3 : x^3+x^2+1, p306 Glasserman (2003) + p13 <- int2bit(13) + m1 <- 1 + m2 <- m3 <- 3 + + prevmj <- cbind(int2bit(m1), int2bit(m2), int2bit(m3)) + sobol.directions.mj(prevmj, p13, 5, input="binary", output="real") + + + + #degree 1 : x+1, p319 Glasserman (2003) + p3 <- int2bit(3) + m1 <- 1 + sobol.directions.mj(int2bit(m1), p3, 7, input="binary", output="real", echo=mytrace) + + #degree 2 : x^2+x+1, p319 Glasserman (2003) + p7 <- int2bit(7) + m1 <- m2 <- 1 + prevmj <- cbind(int2bit(m1), int2bit(m2)) + sobol.directions.mj(prevmj, p7, 6, input="binary", output="real", echo=mytrace) + sobol.directions.vj(prevmj, p7, 6, input="binary", output="real", echo=mytrace) + + #degree 3 : x^3+x+1, p319 Glasserman (2003) + p11 <- int2bit(11) + m1 <- 1 + m2 <- 3 + m3 <- 7 + prevmj <- cbind(int2bit(m1), int2bit(m2), int2bit(m3)) + sobol.directions.mj(prevmj, p11, 6, input="binary", output="real", echo=mytrace) + sobol.directions.vj(prevmj, p11, 6, input="binary", output="real", echo=mytrace) + + } > > proc.time() user system elapsed 0.23 0.14 0.32