search for: runifs

Displaying 20 results from an estimated 3091 matches for "runifs".

Did you mean: runif
2005 Jun 08
6
Random seed problem in MCMC coupling of chains
Hello! I am performing coupling of chains in MCMC and I need the same value of seed for two chains. I will show demo of what I want: R code, which might show my example is: niter <- 3 nchain <- 2 tmpSeed <- 123 for (i in 1:niter) { # iterations for (j in 1:nchain) { # chains set.seed(tmpSeed) a <- runif(1) cat("iter:", i, "chain:", j,
2017 Sep 25
1
Random Variable Generation
I am attempting to write a code that will generate a win probability for a hockey team. To do this, I have a code built that will generate a number of random variables between two standard deviations, and then weight them and add them together. However, when I attempt to assign this code to a variable, any time I use the variable, it will always give me the same numbers instead of being random
2016 Oct 28
2
Encontrar la primera columna no NA
Hola a todos, me ha gustado mucho la solución de Carlos, muy eficiente y muy ingeniosa al utilizar la funcion col() que o no la conocia o no me acordaba de ella. La parte mas "lenta" sigue siendo el apply que en el fondo no es mas que un ciclo for a traves de las filas, asi que inspirado por el metodo de Carlos pense que podria ser mas rapido si iteramos a traves de las columnas por lo
2005 Oct 05
8
R crashes for large formulas in lm() (PR#8180)
Full_Name: Hallgeir Grinde Version: 2.1.1 OS: Windows XP Submission from: (NULL) (144.127.1.1) While using lm(y~(x*z*c*...*v)^2) R crashes/closes if the numbers of variables are at least 8.
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
2005 Oct 05
1
Ad: Re: R crashes for large formulas in lm() (PR#8180)
Dette er en melding med flere deler i MIME-format. --=_alternative 004613C000257091_= Content-Type: text/plain; charset="US-ASCII" And some more informastion I forgot. R does not crash if I write out the formula: set.seed(123) x1 <- runif(1000) x2 <- runif(1000) x3 <- runif(1000) x4 <- runif(1000) x5 <- runif(1000) x6 <- runif(1000) x7 <- runif(1000) x8 <-
2017 Nov 15
3
lapply and runif issue?
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) [[1]] [1] 2.481575 1.998182 1.312786 [[2]] [1] 2.858383 1.827863 1.699015 [[3]] [1] 1.821910 2.530091 3.995677 ## Unexpected
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)
2006 Oct 19
2
Bug in Acrobat Reader 7 (or R?) with translucent text
My setup: R 2.4.0, Windows 2000, Acrobat Reader 7. When I create a .pdf with translucent colors, the translucency works correctly for points, but not for text. Below is some R code that creates a .pdf with this phenomenon. I was going to report this as a bug in R, but then I tried to view the pdf with a couple of other viewers and found that at least one of the viewers correctly displayed the
2008 Jul 28
2
Help with a loop
HI: I need ideas on how to make this code shorter (maybe with a second loop?). The code as it is works, but in this case I only have 14 samples, but it will become insane with more, so I need a way to make it more automatic. The problem is that the output from ts1, ts2, and so on is a vector with more than one value, so I do not know how to solve this. Thanks Prenewbie The code is the
2016 Oct 27
4
Encontrar la primera columna no NA
Por último, utilizando la indexación lineal de matriz que propusó luisfo en su momento: > t <- Sys.time() > M=as.matrix(dat) > index <- which(!is.na(M)) - 1 > meses<-colnames(M) > M2<- data.table(columna=index %/% nrow(M) +1L, jugador=index %% nrow(M) +1L , valor=M[index+1L]) > setkey(M2,jugador,columna) >
2005 Oct 05
0
Ad: Re: R crashes for large formulas in lm() (PR#8180)
On Wed, 5 Oct 2005 Hallgeir.Grinde at elkem.no wrote: > And some more informastion I forgot. > R does not crash if I write out the formula: > > set.seed(123) > x1 <- runif(1000) > x2 <- runif(1000) > x3 <- runif(1000) > x4 <- runif(1000) > x5 <- runif(1000) > x6 <- runif(1000) > x7 <- runif(1000) > x8 <- runif(1000) > y <-
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))
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
2005 Oct 05
0
Ad: Re: Ad: Re: R crashes for large formulas in lm() (PR#8180)
Dette er en melding med flere deler i MIME-format. --=_alternative 004C4E4A00257091_= Content-Type: text/plain; charset="US-ASCII" Yes. so (x1*x2*x3*x4*x5*x6*x7*x8)^2 = (x1+x2+x3+x4+x5+x6+x7+x8)^8 ? and there is a difference in (x1*x2*x3*x4*x5*x6*x7*x8)^2 and (x1*x2*x3*x4*x5*x6*x7*x8) althoug the resulting formulas are the same, or? This fikses my problem, but R still crashes for the
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
2017 Aug 22
4
boot.stepAIC fails with computed formula
I'm trying to use boot.stepAIC for feature selection; I need to be able to specify the name of the dependent variable programmatically, but this appear to fail: In R-Studio with MS R Open 3.4: library(bootStepAIC) #Fake data n<-200 x1 <- runif(n, -3, 3) x2 <- runif(n, -3, 3) x3 <- runif(n, -3, 3) x4 <- runif(n, -3, 3) x5 <- runif(n, -3, 3) x6 <- runif(n, -3, 3) x7
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.
2009 Aug 01
3
how do i retain decimal values
Hello, I am trying to do a spearman correlation. My data has tied values. To overcome this issue, I am adding some random noise (values) to my original data. However when I add the random noise to the data, the final matrix does not show the new values. I guess the reason being that the noise I add is very small and the full value including the decimals gets truncated to show only the value
2005 Oct 05
0
Ad: Re: Ad: Re: R crashes for large formulas in lm() (PR#8181)
On Wed, 5 Oct 2005 Hallgeir.Grinde at elkem.no wrote: > Yes. > so (x1*x2*x3*x4*x5*x6*x7*x8)^2 = (x1+x2+x3+x4+x5+x6+x7+x8)^8 ? Yes in the sense that the simplified formula given by terms() is the same. > and there is a difference in > (x1*x2*x3*x4*x5*x6*x7*x8)^2 > and > (x1*x2*x3*x4*x5*x6*x7*x8) > althoug the resulting formulas are the same, or? The first is reduced to the