Displaying 20 results from an estimated 40000 matches similar to: "R-alpha: compatibility"
1997 Sep 15
0
R-alpha: set.seed(.) [was 'compatibility']
>>>>> Thomas Lumley writes:
>> Two compatibility issues found while trying to convert a simulation
>> from S to R.
>> 1. set.seed() We don't have this function. According to Venables &
>> Ripley it just picks a seed from a list of 1000 possibilities. How about
>>
>> "set.seed" <-function (i)
1999 May 05
1
RNG R/Splus compatibility
Starting with example Wichmann-Hill code from Brian Ripley I have been playing
with a set of programs for getting the same random sequences from R and Splus. A
copy is included below along with a test (which works in Solaris with R and
Splus 3.3).
The approach is somewhat different from the usual problems on this list as I am
trying to get the same results from Splus as I get from R. However,
1999 Apr 29
0
Problems with setting .Random.seed (PR#179)
I have commited fixes for 0.64.1 for
(1) From: Mai Zhou <mai@ms.uky.edu>
> .Random.seed <- c(1, 1:2)
> .Random.seed
[1] 1 1 2
> runif(5)
Warning: Wrong length .Random.seed; forgot initial RNGkind? set to
Wichmann-Hill[1] 0.02253721 0.84832584 ........
Here the length of the seed was being tested before the kind was
picked out, so the length of the previous type was used.
(2)
1997 Nov 04
0
R-alpha: compatibility functions
Below is a revised copy of my compatibility functions with additions
from Martin. I expect I may need a new version when 0.6 arrives but I
thought it would be worth circulating this in case it suggests anything
which might be resolved before the release of 0.6 rather than after.
Thanks to a few people for pointing out the R function machine(). I have
a kludge below for determining the same
1997 Aug 25
0
R-alpha: Re: missing' BB functions
Kurt
The function tempfile is available based on some C code from Friedrich
Leisch. The function unlink is fairly simple in unix but I haven't
experimented elsewhere. In this regard, I have put together a small
kernel set of functions to try to handle cross platform and R vs S
issues. This is appended below and I would certainly appreciate
feedback. The purpose of this kernel is so that I can
2000 Jan 19
1
random number generator
This question may not be specific to R, but I'm using R so here goes:
Since R is slow (as is Splus) I want to split a simulation and run it on
2 or 3 systems at once. The simulations involve generating a large number
of random values. How can I set .Random.seed so that the succession of
random values don't overlap across systems.
I see that when I invoke R and give command runif(1) a
2006 Apr 27
1
? bug in 'sample' (PR#8813)
I have found that specifying different "sizes" in the sample command has
a funny effect on the random sampling. The code below is a condensed
version of a function I wrote to simulate a bootstrap method. For
simplicity, I eliminated the internal bootstrap loop, but kept a
statement to draw one bootstrap sample, because this is where the
problem occurs. The output (mean(y)^2) should be
1999 Aug 30
1
rexp and rweibull
In splus rexp() and rweibull() are related:
> set.seed(153)
> rexp(1)
[1] 0.0493267
> set.seed(153)
> rweibull(1, shape=1)
[1] 0.0493267
(you can also try shape =2, then rweibull = sqrt(rexp) )
However, in rw0.64.1 (on Win NT) they are different
> .Random.seed <- 1:4
> rexp(1)
[1] 1.412030
> .Random.seed <- 1:4
> rweibull(1, shape=1)
[1] 2.054032
May be rweibull
1997 Jul 25
0
R-alpha: Treatment of seed
There is a difference between R and S (or S-Plus, I'm not sure about
that) concerning the generation of random numbers.
If an error occurs during the execution of a function, the seed is
restored to its old value in S-Plus, but not in R. This feature of S-Plus
has just turned out to be very useful for me because I got an error
message during a small simulation for a certain choice of
2019 Mar 01
1
issue with sample in R 3.6.0.
Hello,
I think there 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
1997 Nov 24
0
R-alpha: random number generator -- S-plus's
--Multipart_Mon_Nov_24_14:51:09_1997-1
Content-Type: text/plain; charset=US-ASCII
>>>>> "PaulG" == Paul Gilbert <pgilbert@bank-banque-canada.ca> writes:
MM> The code is basically in V&R 1 and 2; V&R2 on p.167. I have it as a
MM> C function that I used to dyn.load into S-plus in order
MM> to prove that S-plus was using it.
2011 Aug 03
2
convert a splus randomforest object to R
Hi,
I have a randomforest object "cost.rf" that was created in splus 8.0,
now I need to use this trained RF model in R. So in Splus, I dump the RF
file as below
data.dump("cost.rf", file="cost.rf.txt", oldStyle=T)
then in R, restore the dumped file,
library(foreign)
data.restore("cost.rf.txt")
it works fine and able to restore the
2007 Feb 08
1
Suggestion about "R equivalent of Splus peaks() function"
In 2004 there was this R-Help posting from Jan 2004:
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/33097.html
R equivalent of Splus peaks() function?
The peaks function there has worked well for me on a couple of projects, but
some code using "peaks" failed today, which had worked fine in the past.
I was looking for a peak in a test case that was a sine curve over one
2003 Feb 10
2
Pearson's residuals in logistic regression (PR#2539)
Full_Name: Bin Nan
Version: 1.3.0
OS: Win32
Submission from: (NULL) (141.211.15.110)
The function resid(fit, "pearson") seems not giving the same Pearson's residuals
for logistic regression as what Splus does. I found the problem when I fitted
glm with family = binomial using Crowder's seed data.
2003 Jan 14
1
Random number generator in R compared to S
I''m doing some simulations for which i need to use both S-plus and R.
I generate in S+ some random normal distributions to define one dataset by
iteration. I need to use the same dataset generated in S-plus in R.
I was first thinking to generate in R the same dataset by using the same
random number generator with a fixed seed. But It seems that S-plus and R
don''t use the same
2016 Sep 01
2
A bug in the R Mersenne Twister (RNG) code?
On 08/30/2016 06:29 PM, Duncan Murdoch wrote:
> I don't see evidence of a bug. There have been several versions of the
> MT; we may be using a different version than you are. Ours is the
> 1999/10/28 version; the web page you cite uses one from 2002.
>
> Perhaps the newer version fixes some problems, and then it would be
> worth considering a change. But changing the
2001 Mar 04
2
.Random.seed(0) is not a valid Normal type
Dear R-Developers and -Community,
after compiling and installing R 1.2.2., I started 'demo(graphics)' for
a test, and got:
'Error in rnorm(0): .Random.seed(0) is not a Normal type'
Obviously .Random.seed was not initialized appropriately. Following the
the documentation for '.Random.seed' [see below 'Examples'], this can be
fixed
rm(.Random.seed);
2003 Oct 16
2
.Random.seed
I am writing a function for the purposes of a simulation. Due to memory
problems, the function sometimes crashes. In order to get around this
problem, I would like to include to be able to save the "last" seed, so I
can pick up with the next run of the simulation after a "crash". I am
having trouble understanding what is going on with .Random.seed!
For each run of the
2012 Jan 06
1
How to properly re-set a saved seed? I've got the answer, but no explanation
Hello, happy new year.
I've come back to a problem from last spring. I need to understand
what what is the technically correct method to save a seed and then
re-set it. Although this example arises in the context of MT19937,
I'm needing to do this with other generators as well, including
L'Ecuyer streams.
The puzzle is this comment in ?Random: "?set.seed? is the recommended
way
2016 Aug 30
4
A bug in the R Mersenne Twister (RNG) code?
Whomever,
I recently sent the "bug report" below toR-core at r-project.org and have
just been asked to instead submit it to you.
Although I am basically not an R user, I have installed version 3.3.1
and am also the author of a statistics program written in Visual Basic
that contains a component which correctly implements the Mersenne
Twister (MT) algorithm. I believe that it is