Displaying 20 results from an estimated 20000 matches similar to: "error in runif"
2008 Jun 17
1
invalid arguments RUNIF
Hi all
I would be grateful you can help me with my problem.
I try to run an optimization code . in one line I have runif in order to sample the PDF. I get this error while i run it.
Error in runif(1, f$d[[n.of.u.vars + n.of.o.vars + j]][[2]][1], f$d[[n.of.u.vars + :
invalid arguments
Here is a part of that code:
# initialize random numeber generator
if (seed>0)
2011 Feb 03
1
random sequences for rnorm and runif
Dear R experts,
For a fixed seed, the first random number produced by rnorm and runif
has the same rank within the distribution, which I find useful. The
following ranks differ, however.
> set.seed(123)
> runif(4)
[1] *0.2875775* 0.7883051 *0.4089769* 0.8830174
> set.seed(123)
> pnorm(rnorm(4))
[1] 0.2875775 0.4089769 0.9404673 0.5281055
I noticed that rnorm seems to
2017 Nov 03
0
Extreme bunching of random values from runif with Mersenne-Twister seed
>>>>> Tirthankar Chakravarty <tirthankar.lists at gmail.com>
>>>>> on Fri, 3 Nov 2017 13:19:12 +0530 writes:
> This is cross-posted from SO
> (https://stackoverflow.com/q/47079702/1414455), but I now
> feel that this needs someone from R-Devel to help
> understand why this is happening.
Why R-devel -- R-help would have been
2007 Oct 17
0
predictable bit patterns in runif(n) shortly after set.seed
Mersenne Twister generator is known to be sensitive to the
algorithm used to generate its initial state. The initialization
used in R generates the initial state in a way, which leaves
linear dependencies mod 2 among the bits in the initial state.
Since Mersenne Twister performs only operations, which are
linear mod 2, these dependencies propagate to the output sequence.
An easy to see
2017 Nov 03
0
Extreme bunching of random values from runif with Mersenne-Twister seed
The random numbers in a stream initialized with one seed should have about
the desired distribution. You don't win by changing the seed all the
time. Your seeds caused the first numbers of a bunch of streams to be
about the same, but the second and subsequent entries in each stream do
look uniformly distributed.
You didn't say what your 'upstream process' was, but it is easy to
2018 Jan 30
0
Simulation based on runif to get mean
Hello,
Right. Missed that one.
Rui Barradas
Enviado a partir do meu smartphone Samsung Galaxy.-------- Mensagem original --------De: Eric Berger <ericjberger at gmail.com> Data: 30/01/2018 10:12 (GMT+00:00) Para: Rui Barradas <ruipbarradas at sapo.pt> Cc: Daniel Nordlund <djnordlund at gmail.com>, smart hendsome <putra_autumn86 at yahoo.com>, r-help at r-project.org
2017 Nov 03
0
Extreme bunching of random values from runif with Mersenne-Twister seed
Another other generator is subject to the same problem with the same
probabilitiy.
> Filter(function(s){set.seed(s,
kind="Knuth-TAOCP-2002");runif(1,17,26)>25.99}, 1:10000)
[1] 280 415 826 1372 2224 2544 3270 3594 3809 4116 4236 5018 5692 7043
7212 7364 7747 9256 9491 9568 9886
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Fri, Nov 3, 2017 at 10:31 AM, Tirthankar
2017 Nov 05
0
Extreme bunching of random values from runif with Mersenne-Twister seed
> On 5 Nov 2017, at 15:17 , Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
>
> On 04/11/2017 10:20 PM, Daniel Nordlund wrote:
>> Tirthankar,
>> "random number generators" do not produce random numbers. Any given
>> generator produces a fixed sequence of numbers that appear to meet
>> various tests of randomness. By picking a seed you enter
2017 Nov 05
0
Extreme bunching of random values from runif with Mersenne-Twister seed
Tirthankar,
"random number generators" do not produce random numbers. Any given
generator produces a fixed sequence of numbers that appear to meet
various tests of randomness. By picking a seed you enter that sequence
in a particular place and subsequent numbers in the sequence appear to
be unrelated. There are no guarantees that if YOU pick a SET of seeds
they won't produce
2017 Nov 03
1
Extreme bunching of random values from runif with Mersenne-Twister seed
Martin,
Thanks for the helpful reply. Alas I had forgotten that (implied)
unfavorable comparisons of *nix systems with Windows systems would likely
draw irate (but always substantive) responses on the R-devel list -- poor
phrasing on my part. :)
Regardless, let me try to address some of the concerns related to the
construction of the MRE itself and try to see if we can clean away the
shrubbery
2018 Jan 30
1
Simulation based on runif to get mean
Hello,
Another way would be to use ?replicate and ?colMeans.
set.seed(2511) # Make the results reproducible
fun <- function(n){
f <- function(){
a <- runif(5, 1, 10)
b <- runif(5, 10, 20)
colMeans(cbind(a, b))
}
replicate(n, f())
}
fun(10)
Hope this helps,
Rui Barradas
On 1/30/2018 8:58 AM, Daniel Nordlund wrote:
> On 1/29/2018
2004 Jun 25
1
ties in runif() output
I get ties in output from runif() when I generate as few as 10^5
variates and get quite a lot when I generate 10^6. Is this
expected?? I haven't seen any duplication with rnorm(10^6), but
see varying amounts of duplication using rexp(), rbeta() and
rgamma(). I would have thought that there'd be enough precision
that one wouldn't get ties until generating samples larger than this..
2017 Nov 04
0
Extreme bunching of random values from runif with Mersenne-Twister seed
In the code below, you seem to be essentially using the random number
generator to implement a hash function. This isn't a good idea.
My impression is that pseudo-random number generation methods are
generally evaluated by whether the sequence produced from any seed
"appears" to be random. Informally, there may be some effort to make
long sequences started with seeds 1, 2, 3, etc.
2017 Nov 03
2
Extreme bunching of random values from runif with Mersenne-Twister seed
Bill,
Appreciate the point that both you and Serguei are making, but the sequence
in question is not a selected or filtered set. These are values as observed
in a sequence from a mechanism described below. The probabilities required
to generate this exact sequence in the wild seem staggering to me.
T
On Fri, Nov 3, 2017 at 11:27 PM, William Dunlap <wdunlap at tibco.com> wrote:
>
2013 Feb 18
2
Random number generator used in 'runif'
Dear list,
For the implementation of a particular optimization algorithm it is
very important the random number generator.
I would like to know if somebody could tell me what is the random
number generator used by default in the 'runif' function.
>From the help page of 'runif' and '.Random.seed' I guess that the
default algorithm is 'Mersenne-Twister', but I
2017 Nov 03
2
Extreme bunching of random values from runif with Mersenne-Twister seed
Bill,
I have clarified this on SO, and I will copy that clarification in here:
"Sure, we tested them on other 8-digit numbers as well & we could not
replicate. However, these are honest-to-goodness numbers generated by a
non-adversarial system that has no conception of these numbers being used
for anything other than a unique key for an entity -- these are not a
specially constructed
2009 Jan 03
1
runif (and other generator) "precision" / man pages
I'm inclined to agree with the view that the "precision" of a generator
should be highlighted better in the manual pages. When I do
?runif
I don't see a mention, but ?.Random.seed DOES give the info, as Duncan
points out, and it is suggested to look there.
A 1-liner with each random number generator
"CAUTION: random number generators use different mechanisms and
2003 Dec 22
3
runif and sample with reproducibility
Hello,
I would like to sample a population but the result needs to be
reproducible, using 'runif' or 'sample' is the good way to do it but I
can't manage to make the results reproducible even with the 'set.seed'
function.
My aim is that th call to 'sample(1:100,10)' gives always the same result,
how can I do that?
Thanks!
Eric Esposito
2010 Jul 23
2
randomness using runif
I'm working on a problem where I'm introducing random error and have
been using the built in function runif to provide that random error.
However, I realized that I seem to be getting some unexpected behavior
out of the function and was hoping someone could share some insight.
I don't know the runif algorithm at all, but from the behavior I'm
seeing, it seems that whenever I open
2008 Jun 22
1
readLines problem in iteration
Hi there
My script at each iteration produces a .dat file which I save in a directory with write.table. Then I need to read each line of this file and create a directory for each line and put elements of that row in that directory. I do it with the following script which I have inserted somewhere between my outer iteration loop, it works fine for the first iteration, but the problem is that it