similar to: lapply and runif issue?

Displaying 20 results from an estimated 100 matches similar to: "lapply and runif issue?"

2017 Nov 15
0
lapply and runif issue?
Hi Bert, On Tue, Nov 14, 2017 at 8:11 PM, Bert Gunter <bgunter.4567 at gmail.com> wrote: > Could someone please explain the following? I did check bug reports, but > did not recognize the issue there. I am reluctant to call it a bug, as it > is much more likely my misunderstanding. Ergo my request for clarification: > > ## As expected: > >> lapply(1:3, rnorm, n = 3)
2008 Jun 16
0
error in 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)
2012 Mar 21
0
runif error - maximum limit?
Dear all, I am receiving the error below, I think because my n is exceeding the allowable limit for a vector. Can anyone confirm, and help with the following questions? The function and error: > stPte8 <- rtrunc(rnorm, nx * ny * nsimu, linf=0, mean=as.vector(PTmn), > sd=as.vector(PTsd)) Error in runif(n, min = pinf, max = psup) : invalid arguments My total n is calculated by: nx=4053,
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.
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..
2009 Jan 02
1
runif limited precision
runif appears to give 31 bits of precision, but this isn't mentioned in the documentation page. The R numeric type supports 53 digits of precision, and other numeric functions (sin, etc.) give full-precision results. So I'd think that either runif should give full precision or its documentation should mention this limitation. #integers table(runif(10000,-2^30,2^30) %% 1) 0 0.5 4972
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
2010 Dec 06
4
Runif Help: same variable, 3 different parameters
So I am working on an economic model and I need to change the parameters of the runif statement as time goes on. Ex. X <-runif(1:50,0,5) X <-runif(51:100,100,150) X <-runif(100:T, 1,2) Not sure how to go about entering this in to R properly. -- View this message in context: http://r.789695.n4.nabble.com/Runif-Help-same-variable-3-different-parameters-tp3073893p3073893.html Sent from
2013 Feb 13
1
context of runif()
Greetings, I am exploring some random forest analysis methods and have come upon one aspect I don't fully understand from any manual. The code of interest is as follows from the randomForest package: myiris=cbind(iris[1:4], matrix(runif(508*nrow(iris)),nrow(iris),508)) This would be following by the rfcv() function for cross-validation but I am confused about the former syntax. My
2010 Jan 20
3
question on runif
Hello! I have a question on uniform distribution. I want to plot n, say 20, points, uniformly distributed, in a circle, with radius=0.1 and center,say, (0.4, 0.8) I do not know how~ Thank you for your time. Yours Wolfgang Amadeus [[alternative HTML version deleted]]
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
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
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
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 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
2007 May 30
2
runif with weights
Dear all, I would like to generate 25 numbers from 1 to 100 but I would like to have some numbers that could be more probable to come out. I was thinking of the function runif: runif(25, 1, 100) , but I don?t know how to give more weight to some numbers. Example: each number from 2 to 10 has the probability of 40% to come out but the probability of each number from 11 to 100 to come out is
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
2018 Jan 30
0
Simulation based on runif to get mean
On 1/29/2018 9:03 PM, smart hendsome via R-help wrote: > Hello everyone, > I have a question regarding simulating based on runif.? Let say I have generated matrix A and B based on runif. Then I find mean for each matrix A and matrix B.? I want this process to be done let say 10 times. Anyone can help me.? Actually I want make the function that I can play around with the number of simulation
2011 Aug 10
2
function runif in for loop
Hello, I'd like to perform a regression using MCMCregress (MCMCpack). One variable therefore should be a function rather than a variable: I want to use X as an input and X should be defined as a random number between to values. Therefore I want to use the function runif like: X <-(1, Xa, Xb) but it seems that runif doesn't allow to use vectors. So I think I've to calculate the new
2018 Jan 30
2
Simulation based on runif to get mean
Hello everyone, I have a question regarding simulating based on runif.? Let say I have generated matrix A and B based on runif. Then I find mean for each matrix A and matrix B.? I want this process to be done let say 10 times. Anyone can help me.? Actually I want make the function that I can play around with the number of simulation process that I want. Thanks. Eg: a <- matrix(runif(5,1, 10))