setRNG/0000755000176000001440000000000012435034021011436 5ustar ripleyuserssetRNG/inst/0000755000176000001440000000000012267353621012430 5ustar ripleyuserssetRNG/inst/doc/0000755000176000001440000000000012431202245013161 5ustar ripleyuserssetRNG/inst/doc/setRNG.pdf0000644000176000001440000016011512431202245015022 0ustar ripleyusers%PDF-1.5 % 3 0 obj << /Length 2694 /Filter /FlateDecode >> stream xڕr>_Vvc,UrĔqR! QykwρmЇ3i[oLE^Y$[7wbi͢qa~weRdEDns}q?wU\6G5q*&6'Lalh+rO{]ѩ,l}^dYTT=($:֍ [D,<~?tbZ*#mlB0#ZV~H^mu *M΂NWYo_)e)7b 7~fGJZ|aJv,ȶ4ڵȥ=^ƻl!Rf[S+,< B];߭&Icf (6p{ړ&c"'e|NY$~U6 =z9q]#{ӶP0$I;TIy$ mDD13eiLBǎgR=^=}lyˆy0/r>g%ٙAQ "@clTrМWt&&]*2?yFp@t IvdU=^p - Bu-Q[[j!Işg]po8BRpD bG>I8"~HV~@"Eܡb<"]7rzX l v(jsz@*Huoze&ݚ|V!]@LJ .g$$qH5w=ix{kոҊfR|lU5 pq%r0{9ɾ i:.iaI"\B#nq3=bz7W Iv&~##VqU6&+2_?p@29].]+Εt775L:4$N 30CK.^_G0ѹIk~%I%&Nl2ԨXF]M9-J?SBK'I8$va- c!"z[Yͱ//WA4\"WOUx|3O0gH3$+HzYaٟ?_to/{ILw 7r0j󇴧|5R0 .*'^v_'q`iINh, ¼jN1F\k-"A=:M*@W\.%%64(V ډgMV$ z8L` jHU-g¢L&UImuMUDg!I 6* <})aULmEa|QUTqf" (L|!TU)|l9P+ꪯRQrZHr[EfT}5X3> stream xڍ4>N[{o^gT ID-JRjUQb϶Ejoi?} U!nP-7$ZXLDTnf!&'6пfP' )/: F_4+IĤdEE⢢rP 70!n~(_|199UW( F h'UE0`O v}||D"n(G%~!0zBQPWgk"'c7 y⅄@Qc}]w(!_`7Ww0t(஖-#!`U< Gh:?O) G+՘5u7WW(I|pj~?/`p$ ; h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108-05'00') /ModDate (D:20141113142108-05'00') /Trapped /False /PTEX.Fullbanner (This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian) kpathsea version 6.1.1) >> endobj 8 0 obj << /Type /ObjStm /N 16 /First 114 /Length 1300 /Filter /FlateDecode >> stream xWO9_;Ȭm U" ZTrm%lݴпfm tO'%x< 1ΜgV1Ι1q D2n諙$~-p=&SLp&=$fRjY&M&g _{=/|z_Λ0oj&ѕ\VP_qn|Pޱ ]^\pzP=Ix2)CRKx-5%G3*Ga!ak)\sC|6} 0#2-՜LwTjO4+١VW&q}l&+u053!hA1XI('Ihi3/0:4 W2Jvf uGucu8 OͲ1)D8>J EH2nuiTc^$ʒ&fRX0.C(%-D&:N{nڱy x_'8y&V5zvATfd/r7r*:TM$!=\飾h #@R;T F<̴q J}<[(p6&J:fq`[O8L}:s% 8Wm'鸡,Z'2*ʑa΍hgW^ "Lu7~Ӯ;m-DKJeӸXߤ:=UŢ)tX39>xtv805SIb-َSQ`xB1`י4xb7Ozpф;C; uLn!S8(`%54=yuX.w9x}<1b(FS1nwC܃@_p/`!k |Tf9  &I#&f+d4|jR"UQ@Ӽ ~ͤ /%,3|;*7`5ρo֋{ BV o0t|XꮀBlT:ÈuB%,kM;q&TNC]Gnen 0+F崜Sк@q7/-Y.ԯW+hGpL.)W<7lRs= nb C|`<د6R|UݐLamsۃM3}l[Ȗmm*zm[m/ضmRnk rӸ #IhM%B]F6%srKS/ <13B198DA4AC1F0798263180FC81D0B70>] /Length 79 /Filter /FlateDecode >> stream xȻ D]@E [ idbbh/8sg.!R@dI&e[ʼn mgykFụWG v endstream endobj startxref 57092 %%EOF setRNG/inst/doc/setRNG.Stex0000644000176000001440000000543512431202245015177 0ustar ripleyusers\documentclass[english]{article} \begin{document} %\VignetteIndexEntry{setRNG Guide} \SweaveOpts{eval=TRUE,echo=TRUE,results=hide,fig=FALSE} \begin{Scode}{echo=FALSE,results=hide} options(continue=" ") \end{Scode} \section{setRNG Functions} In R, the functions in this package are made available with \begin{Scode} library("setRNG") \end{Scode} As of R-2.1.0 the code from the vignette that generates this guide can be loaded into an editor with \emph{edit(vignette("setRNG"))}. This uses the default editor, which can be changed using \emph{options()}. Also, it should be possible to view the pdf version of the guide for this package with \emph{print(vignette("setRNG"))}. This library provides tools to simplify recording and resetting the random number generator, to help make monte carlo experiments easily reproducible. It uses the R/S tools for setting the seed, but also records and sets the mechanism for converting uniform numbers to normally distributed numbers. (It could be extended to other transformations, but I have not done that.) The setRNG function would typically be called by simulation programs. For example, if \emph{rng=NULL} is an argument to the function then the code \begin{Scode}{eval=FALSE,echo=FALSE,results=hide} rng <- NULL \end{Scode} \begin{Scode}{eval=FALSE,echo=TRUE,results=hide} if(!require("setRNG")) { stop("This function requires the setRNG package.") } if(is.null(rng)) rng <- setRNG() else {old.rng <- setRNG(rng); on.exit(setRNG(old.rng)) } \end{Scode} should be used before the random number generator is used. This will set the RNG information if given, and in all cases record the RNG information which can then be returned with the result of the simulation. (\emph{setRNG()} returns the setting so do not skip this if \emph{rng=NULL}.) With the information recorded the simulation can always be reproduced if necessary. In the case where the rng is set to a specified value it is good practice to set it back to the original value on exit. This prevents other random experiments from accidentally being affected by the rng setting. The library also implements an approach to random number generation which allows the same random experiments to be replicated in S and R. The functions in the S directory allow the R results using Wichmann-Hill and Box-Muller to be replicated in S. These were done with the aid of an example from B. D. Ripley. (The files in the S directory of the package are for use with S not R.) These functions are intended primarily as a way to confirm that simulations and estimations with simulated data work in the same way in both S and R, not as an improved RNG. (It has only been tested in Splus 3.3) Default and other RNGs can still be used and are preferred for both speed and theoretical reasons. \end{document} setRNG/tests/0000755000176000001440000000000012267353620012614 5ustar ripleyuserssetRNG/tests/RNGtest.R0000644000176000001440000000007312267353620014265 0ustar ripleyusers require("setRNG") Sys.info() random.number.test() setRNG/NAMESPACE0000644000176000001440000000013412267353621012670 0ustar ripleyusersexport("setRNG") export("random.number.test") export("getRNG") S3method("getRNG","default") setRNG/NEWS0000644000176000001440000000166612267353621012163 0ustar ripleyusersChanges in setRNG version 2013.9-1 o adjusted .Rbuildignore to exclude S/ directory. Changes in setRNG version 2011.11-1 o updated maintainer email address. Changes in setRNG version 2009.11-1 o setRNG sources migrated to distr project on R-forge. o Standardized NEWS format for new function news(). o The result of setRNG is now returned with invisible() except in the case it is called with no arguments. This avoids printout of large seeds. Changes in setRNG version 2008.3-1 o as.integer(seed) used explicitely to avoid warning caused when an integer stored as a double was used to set the seed. This should cause no changes other than eliminating the warning message. Changes in setRNG version 2006.4-1 o added setRNG-package.Rd overview. o added namespaces Changes in setRNG version 2004.4-1 o setRNG is now maintained as a separate package o Older NEWS is in the dse NEWS file. setRNG/R/0000755000176000001440000000000012267353620011653 5ustar ripleyuserssetRNG/R/setRNG.R0000644000176000001440000002174112267353620013145 0ustar ripleyusers ########################################################### # Random number generation. ########################################################### # Prior to R 0.99 Wichmann-Hill was the default and the DSE version of # Box-Muller was used for rnorm. setRNG <- function(kind=NULL, seed=NULL, normal.kind=NULL) {# with a null argument this also serves as getRNG #The next line means that setRNG with null args does not truly # return the state of the RNG in the case when it has not been # initialize. It first initializes it and then returns the state. The # rational is that querying the state is usually for the purpose of # reproducing it, so it must first be initialized to put it in a # reproducible state. if (!exists(".Random.seed", envir=.GlobalEnv, inherits = FALSE)) z <- runif(1) old <- list(kind=RNGkind()[1],normal.kind=RNGkind()[2], seed=get(".Random.seed", envir=.GlobalEnv, inherits = FALSE)[-1]) if (is.null(kind) & is.null(seed) & is.null(normal.kind)) return (old) if (is.list(kind)) {seed <- kind$seed normal.kind <- kind$normal.kind kind <- kind$kind } #Something like this might be nice, but there does not seem to be a way # to associate rng versions other than using R versions, and # that is too strict. Perhaps RNGversion() could return something. #v <- some number associated with kind and normal.kind #if (is.null(v)) warning("version cannot be verified.") #if (!all(unlist(RNGversion()) == unlist(v))) # warning("rng used but version does not correspond to original. Differences may occur.") k <- get(".Random.seed", envir=.GlobalEnv, inherits = FALSE)[1] remove(".Random.seed", envir=.GlobalEnv) # otherwise RNGkind complains RNGkind(kind=kind, normal.kind=normal.kind) # this sets .Random.seed seed <- as.integer(seed) #fix case where an integer is stored as double if ( 1==length(seed)) set.seed(seed) else assign(".Random.seed", c(get(".Random.seed", envir=.GlobalEnv, inherits = FALSE)[1], seed), envir=.GlobalEnv) invisible(old) } getRNG <- function(e=NULL)UseMethod("getRNG") getRNG.default <- function(e=NULL) {if (is.null(e)) k <- setRNG() else if (!is.null(e$rng)) k <- e$rng else if (!is.null(e$noise)) k <- e$noise$rng else stop("RNG information not found.") k } ######################################################### # test function (This test is run by other tests so it should # be defined here and not moved to tests directory. ######################################################### random.number.test <- function() {cat("Random number generator tests ...") if (is.R()) {test.seed<- 979 #previous to R 1.0.0: c( 979, 1479, 1542) # values from 0.49 beta #test.valueU <-c(5.693354055333957e-01,1.051357751852140e-01, # 5.846933178718317e-02, 7.537960906527452e-02, 7.043734921992200e-01) #test.valueN <-c(-5.559389931781886e-01, # -1.902431069568611e+00, 1.524595894866778e+00, # -7.863494805034426e-01, 1.328128164898773e-01) # values from 0.99.0a # test.valueU <-c(0.25603057077527752, 0.07879165329010961, # 0.60394682330171257, 0.20843868707503158, 0.97636939375111098) # test.valueN <-c( -1.39965726956837644, -0.24025807684466990, # 2.34362137305187446, -0.66321208109989371, -0.71183559894654214) # values from 1.1.0 (devel) should also work in 1.0.1 test.valueU.R1.6.2 <-c(0.59132864479704950, 0.76406894316060192, 0.18576870606880833, 0.81087542344137897, 0.05835627439859235) test.valueN.R1.7.1 <-c( 0.959409416512901569, 0.046546246157109825, -0.775306427558083988, -0.777761120323404387, -1.363043207314097227) test.valueN.R1.6.2 <-c( 0.959409416509782953, 0.046546246156130192, -0.775306427558391964, -0.777761120325662803, -1.363043207314267313) test.valueU <-c(0.6159259434789419, 0.2200001638848335, 0.7024894717615098, 0.4869760072324425, 0.2284618646372110) test.valueN <- c(0.2947980960879867, 0.5315740209738240, -0.7439218830522146, -0.9861002105572579, -0.3542773118879623) } if (!is.R()) {# above should really be if (is.Splus()) test.seed<- c(37, 39, 39, 4, 7, 2, 27, 58, 38, 15, 32, 2) test.valueU.S <- c(0.4299328043125570, 0.3092006836086512, 0.5808096211403608, 0.3061958812177181, 0.8137333435006440) test.valueN.S <- c( -0.7613318231781665, -0.5724360196433543, 0.8536399448225964, -0.2269096022522968, -0.8126790170570223) } old.seed <- setRNG(kind="default", seed=test.seed, normal.kind="default") on.exit(setRNG(old.seed)) ok <- TRUE if ( !is.R()) {if (1e-14 < max(abs(runif(5)-test.valueU.S))) {warning("The default runif number generator has been changed.") ok <- FALSE } setRNG(kind="default", seed=test.seed, normal.kind="default") if (1e-14 < max(abs(rnorm(5)-test.valueN.S))) {warning("The default rnorm number generator has been changed.") ok <- FALSE } } if ( is.R()) {if (as.numeric(version$major)+0.1*as.numeric(version$minor) > 1.62 ) {if (1e-14 < max(abs(runif(5)-test.valueU))) {warning("The default runif number generator has been changed.") ok <- FALSE } setRNG(kind="default", seed=test.seed, normal.kind="default") if (1e-14 < max(abs(rnorm(5)-test.valueN))) {warning("The default rnorm number generator has been changed.") ok <- FALSE } } # As of R 1.7.0 the default generator changed. For R 0.99 to 1.6.2 the # following corresponded to kind="default",normal.kind="default" setRNG(kind="Marsaglia-Multicarry", seed=test.seed, normal.kind="Kinderman-Ramage") if (1e-14 < max(abs(runif(5)-test.valueU.R1.6.2))) {warning("The Marsaglia-Multicarry runif number generator has been changed.") ok <- FALSE } # As of R 1.7.1 a bug was recognized in Kinderman-Ramage and it was changed. The # old version was named "Buggy Kinderman-Ramage" setRNG(kind="Marsaglia-Multicarr", seed=test.seed, normal.kind="Kinderman-Ramage") if (as.numeric(version$major)+0.1*as.numeric(version$minor) >= 1.71 ) {if (1e-14 < max(abs(rnorm(5) - test.valueN.R1.7.1 ))) {warning("The Kinderman-Ramage rnorm number generator has been changed.") ok <- FALSE} setRNG(kind="Marsaglia-Multicarr", seed=test.seed, normal.kind="Buggy Kinderman-Ramage") if (1e-14 < max(abs(rnorm(5) - test.valueN.R1.6.2 ))) {warning("The Buggy Kinderman-Ramage rnorm number generator has been changed.") ok <- FALSE } } else if (1e-14 < max(abs(rnorm(5) - test.valueN.R1.6.2 ))) {warning("The Kinderman-Ramage rnorm number generator (pre R 1.7.1)has been changed.") ok <- FALSE } } setRNG(kind="Wichmann-Hill", seed=c(979,1479,1542), normal.kind="Box-Muller") if (setRNG()$kind != "Wichmann-Hill" || setRNG()$normal.kind != "Box-Muller" || all(setRNG()$seed != c(979,1479,1542) )) {warning("RNG is not being set properly") ok <- FALSE } if (1e-14 < max(abs(runif(5) - c(0.56933540553339546, 0.10513577518521355, 0.05846933178718317, 0.07537960906527452, 0.70437349219921996)))) {warning("The Wichmann-Hill runif number generator has been changed.") ok <- FALSE } # for the next R 1.0.0 # setRNG(kind="Wichmann-Hill", seed=c(979,1479,1542), normal.kind="Box-Muller") # rnorm gives #[1] -1.92425218107175877 -0.89568905204068128 2.12213361588187510 #[4] 0.81669202948845299 -0.13569189805256629 # as does setRNG(kind="Wichmann-Hill", seed=c(979,1479,1542), normal.kind="Box-Muller") if (1e-14 < max(abs(rnorm(5) - c(-1.92425218107175877, -0.89568905204068128, 2.12213361588187510, 0.81669202948845299, -0.13569189805256629) # pre R 1,0,0 c(0.4605069059114530, 0.7685565310963474, -0.3737680932387061, # 0.5926372779538560, 1.4995245125275518) ))) {warning("The Box-Muller rnorm number generator has been changed.") ok <- FALSE } # this needs to be done twice with odd and even n to chech completely if (1e-14 < max(abs(rnorm(5) - c(-0.4602838255495997, 0.2761541652763959, 1.3265434523731297, 0.6856247181400722, -1.8336523890846541) ))) {warning("The Box-Muller rnorm state is not properly preserved.") ok <- FALSE } if (1e-14 < max(abs(rnorm(6) - c(1.9850437759531543, 0.6107700961454843, -0.9419893721776470, 1.1031328847642050, 0.4184702210057414, 0.9167797157851526) ))) {warning("The Box-Muller rnorm state is not properly preserved.") ok <- FALSE } if (1e-14 < max(abs(rnorm(6) - c(-0.724539745179790251, -0.439138566092752758, 1.466237618877826110, 0.289289597398559639, 0.003007778996985022, 1.008712871048744297) ))) {warning("The Box-Muller rnorm state is not properly preserved.") ok <- FALSE } if (ok) {cat("ok\n"); invisible(TRUE) } else { cat("failed!\n"); stop("failed")} } setRNG/vignettes/0000755000176000001440000000000012431202245013447 5ustar ripleyuserssetRNG/vignettes/setRNG.Stex0000644000176000001440000000543512267353620015500 0ustar ripleyusers\documentclass[english]{article} \begin{document} %\VignetteIndexEntry{setRNG Guide} \SweaveOpts{eval=TRUE,echo=TRUE,results=hide,fig=FALSE} \begin{Scode}{echo=FALSE,results=hide} options(continue=" ") \end{Scode} \section{setRNG Functions} In R, the functions in this package are made available with \begin{Scode} library("setRNG") \end{Scode} As of R-2.1.0 the code from the vignette that generates this guide can be loaded into an editor with \emph{edit(vignette("setRNG"))}. This uses the default editor, which can be changed using \emph{options()}. Also, it should be possible to view the pdf version of the guide for this package with \emph{print(vignette("setRNG"))}. This library provides tools to simplify recording and resetting the random number generator, to help make monte carlo experiments easily reproducible. It uses the R/S tools for setting the seed, but also records and sets the mechanism for converting uniform numbers to normally distributed numbers. (It could be extended to other transformations, but I have not done that.) The setRNG function would typically be called by simulation programs. For example, if \emph{rng=NULL} is an argument to the function then the code \begin{Scode}{eval=FALSE,echo=FALSE,results=hide} rng <- NULL \end{Scode} \begin{Scode}{eval=FALSE,echo=TRUE,results=hide} if(!require("setRNG")) { stop("This function requires the setRNG package.") } if(is.null(rng)) rng <- setRNG() else {old.rng <- setRNG(rng); on.exit(setRNG(old.rng)) } \end{Scode} should be used before the random number generator is used. This will set the RNG information if given, and in all cases record the RNG information which can then be returned with the result of the simulation. (\emph{setRNG()} returns the setting so do not skip this if \emph{rng=NULL}.) With the information recorded the simulation can always be reproduced if necessary. In the case where the rng is set to a specified value it is good practice to set it back to the original value on exit. This prevents other random experiments from accidentally being affected by the rng setting. The library also implements an approach to random number generation which allows the same random experiments to be replicated in S and R. The functions in the S directory allow the R results using Wichmann-Hill and Box-Muller to be replicated in S. These were done with the aid of an example from B. D. Ripley. (The files in the S directory of the package are for use with S not R.) These functions are intended primarily as a way to confirm that simulations and estimations with simulated data work in the same way in both S and R, not as an improved RNG. (It has only been tested in Splus 3.3) Default and other RNGs can still be used and are preferred for both speed and theoretical reasons. \end{document} setRNG/MD50000644000176000001440000000136112435034021011747 0ustar ripleyusers5984ba77e886db7adce849b3cac7e6c2 *DESCRIPTION 8c2ef3f2ed55a520caa10c020749612d *LICENSE bef2dd25dd2c3804fa6395e07a1b88d9 *NAMESPACE aa57ed43084982056994531f284a31cc *NEWS 3acf4e5781de2a2feac277777c8375df *R/setRNG.R 772f93def69547a9ef4d23ac4dfa7ff8 *build/vignette.rds b15575f710c9c1eacef389b5fe02f901 *inst/doc/setRNG.Stex aaa36864b2dfc0208c238e516cdb6170 *inst/doc/setRNG.pdf 7ceb115a50ae35d97c1f3fd54aaf607f *man/00.setRNG.Intro.Rd 128661192e4c93da007b28f6a086f724 *man/getRNG.Rd 2270b6def5b8129231a7b354e06e8790 *man/random.number.test.Rd 1f5453bbda78703c41f2a7e06c584d55 *man/setRNG-package.Rd 766fd7f4ee154013d53d8d2b7163e708 *man/setRNG.Rd 7cbbba2105812c2eb90c6e1d2381f34c *tests/RNGtest.R b15575f710c9c1eacef389b5fe02f901 *vignettes/setRNG.Stex setRNG/build/0000755000176000001440000000000012431202245012536 5ustar ripleyuserssetRNG/build/vignette.rds0000644000176000001440000000031012431202245015067 0ustar ripleyusersb```b`fdb`b2 1# '.N- s .I@H)fqAp@ev !@„5/17M3KjAj^ HvN,/AQU▙ 7$apq2݀a>9`~tMI,F(WJbI^ZP?lޯ~setRNG/DESCRIPTION0000644000176000001440000000142212435034021013143 0ustar ripleyusersPackage: setRNG Title: Set (Normal) Random Number Generator and Seed Description: SetRNG provides utilities to help set and record the setting of the seed and the uniform and normal generators used when a random experiment is run. The utilities can be used in other functions that do random experiments to simplify recording and/or setting all the necessary information for reproducibility. See the vignette and reference manual for examples. Depends: R (>= 2.5.0) Version: 2013.9-1 LazyLoad: yes License: GPL-2 | file LICENSE Author: Paul Gilbert Maintainer: Paul Gilbert URL: http://distr.r-forge.r-project.org/ Packaged: 2014-11-13 19:21:09 UTC; paul NeedsCompilation: no Repository: CRAN Date/Publication: 2014-11-25 09:04:33 setRNG/man/0000755000176000001440000000000012267353621012226 5ustar ripleyuserssetRNG/man/random.number.test.Rd0000644000176000001440000000170112267353621016241 0ustar ripleyusers\name{random.number.test} \alias{random.number.test} \title{Test the random number generator} \description{Test the random number generator.} \usage{ random.number.test() } \arguments{None} \value{logical} \details{ This function checks that the RNG is working properly and has not been changed. If the RNG does not return values as in previous versions of R then the function executes \code{stop()}. Since changes to the RNG will cause comparisons of simulation results to fail, this is a useful check before investigating more complicated problems that may be a result of other "improvements" in your simulation or estimation programs. } \section{Side Effects}{Executes \code{stop()} if the tests fail.} \seealso{ \code{\link{set.seed}} \code{\link{RNGkind}} \code{\link{runif}} \code{\link{rnorm}} \code{\link{setRNG}} } \examples{ random.number.test() } \keyword{programming} \keyword{utilities} setRNG/man/setRNG-package.Rd0000644000176000001440000000420712267353621015253 0ustar ripleyusers\name{setRNG-package} \alias{setRNG-package} \alias{setRNG.Intro} \docType{package} \title{setRNG} \section{Usage}{ library("setRNG") } \description{ Programs to set random number generator (and seed) in R and S.} \section{Introduction}{ This library provides tools to simplify recording and resetting the random number generator, to help make monte carlo experiments easily reproducible. It uses the R/S tools for setting the seed, but also records and sets the mechanism for converting uniform numbers to normally distributed numbers. (It could be extended to other transformations, but I have not done that.) The setRNG function would typically be called by simulation programs (see example) to set the RNG information if given, and record the RNG information in all cases. This information can be returned with the result of the simulation. That way the simulation can always be reproduced if necessary. The library also implements an approach to random number generation which allows the same random experiments to be replicated in S and R. The functions in the S/ directory allow the R results using Wichmann-Hill and Box-Muller to be replicated in S. These were done with the aid of an example from B. D. Ripley. (The files in the S/ directory of the package are for use with S not R.) These functions are intended primarily as a way to confirm that simulations and estimations with simulated data work in the same way in both S and R, not as an improved RNG. (It has only been tested in Splus 3.3) Default and other RNGs can still be used and are preferred for both speed and theoretical reasons. } \examples{ setRNG(kind="Wichmann-Hill", seed=c(979,1479,1542), normal.kind="Box-Muller") rnorm(10) sim <-function(rng=NULL) {if(!require("setRNG")) stop("This function requires the setRNG package.") if(is.null(rng)) rng <- setRNG() # returns setting so don't skip if NULL else {old.rng <- setRNG(rng); on.exit(setRNG(old.rng)) } x <- list(numbers=rnorm(10)) x$rng <- rng x } z <- sim() sim()$numbers sim(rng=getRNG(z))$numbers z$numbers } \keyword{programming} \keyword{interface} \keyword{utilities} \keyword{distribution} setRNG/man/getRNG.Rd0000644000176000001440000000205212267353621013642 0ustar ripleyusers\name{getRNG} \alias{getRNG} \alias{getRNG.default} \title{get the RNG and seed from an object} \description{ Get the random number generator and seed used to generate an object. } \usage{ getRNG(e=NULL) \method{getRNG}{default}(e=NULL) } \arguments{ \item{e}{an object generated by simulation (which stored the RNG information).} } \value{The random seed and other random number generation information used to generate the object. } \details{Extract the RNG information used to generate the object. If \code{e} is \code{NULL} then \code{getRNG} returns the RNG setting, as returned by \code{setRNG()}. Otherwise, the default method assumes the object is a list and the RNG information is in the element \code{rng} or \code{noise\$rng}. } \seealso{ \code{\link{setRNG}}, \code{\link{.Random.seed}} } \examples{ \dontrun{ if (require("dse")) { data("eg1.DSE.data.diff", package="dse") model <- estVARXls(eg1.DSE.data.diff) sim <- simulate(model) getRNG(sim) } } } \keyword{ts} \keyword{programming} \keyword{utilities} setRNG/man/00.setRNG.Intro.Rd0000644000176000001440000000046312267353621015172 0ustar ripleyusers\name{00.setRNG.Intro} \alias{00.setRNG.Intro} \docType{package} \title{setRNG} \description{Programs to set random number generator (and seed) in R and S.} \details{ See \code{\link{setRNG-package}} ( in the help system use package?setRNG or ?"setRNG-package") for an overview. } \keyword{package} setRNG/man/setRNG.Rd0000644000176000001440000000303312267353621013656 0ustar ripleyusers\name{setRNG} \alias{setRNG} \title{Set the Random Number Generator} \description{Set the RNG or return information about the setting of the RNG.} \usage{ setRNG(kind=NULL, seed=NULL, normal.kind=NULL) } \arguments{None required \item{kind}{a character string.} \item{seed}{a vector of numbers (depending on kind).} \item{normal.kind}{a character string.} } \value{The old setting.} \details{ Sets the uniform and normal random number generators and the seed. The old setting is returned using \code{invisible()} in a format which can be used in another call to \code{setRNG}. (This would reset to the original value.) If no arguments are given the current setting is returned, not using \code{invisible()}. In R see \code{RNGkind} for more details. Note that in a function using \code{setRNG} it is good practice to assign the old setting to a variable, then reset to the old value on exiting the function (using \code{on.exit}). This avoids the possibility that overall RNG behaviour in a session, other than within your function, may be disrupted by your function. } \section{Side Effects}{Sets global variables controlling the uniform and normal random number generators and the global seed.} \seealso{ \code{\link{RNGkind}}, \code{\link{set.seed}}, \code{\link{runif}}, \code{\link{rnorm}}, \code{\link{random.number.test}} } \examples{ setRNG(kind="Wichmann-Hill", seed=c(979,1479,1542), normal.kind="Box-Muller") rnorm(10) } \keyword{programming} \keyword{utilities} setRNG/LICENSE0000644000176000001440000000110512267353620012454 0ustar ripleyusers Copyright 1993, 1994, 1995, 1996 Bank of Canada. Copyright 1997 (June), Paul Gilbert. Copyright 1997 (Aug.), Bank of Canada. Copyright 1998-2011 Bank of Canada. The user of this software has the right to use, reproduce and distribute it. Bank of Canada and Paul Gilbert make no warranties with respect to the software or its fitness for any particular purpose. The software is distributed by the Bank of Canada and by Paul Gilbert solely on an "as is" basis. By using the software, user agrees to accept the entire risk of using this software.