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)
-
From: Gorjanc Gregor [EMAIL PROTECTED]
To: r-help@stat.math.ethz.ch
Sent: Wednesday, June 08, 2005 3:27 PM
Subject: [R] 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
On 6/8/2005 9:27 AM, Gorjanc Gregor wrote:
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
.
--
-Original Message-
From: Duncan Murdoch [mailto:[EMAIL PROTECTED]
Sent: sre 2005-06-08 15:53
To: Gorjanc Gregor
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] Random seed problem in MCMC coupling of chains
On 6/8/2005 9:27 AM, Gorjanc Gregor wrote:
Hello!
I am performing coupling of chains
The tools in setRNG are intended for this kind of problem and I do use
them regularly in much more complicated situations. They help save all
the information, in addition to the seed, that you need for reproducible
simulations. Try
niter - 3
nchain - 2
for (i in 1:niter) { # iterations
To: Gorjanc Gregor
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] Random seed problem in MCMC coupling of chains
On 6/8/2005 9:27 AM, Gorjanc Gregor wrote:
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
.
--
-Original Message-
From: Duncan Murdoch [mailto:[EMAIL PROTECTED]
Sent: sre 2005-06-08 15:53
To: Gorjanc Gregor
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] Random seed problem in MCMC coupling of chains
On 6/8/2005 9:27 AM, Gorjanc Gregor wrote:
Hello!
I am performing coupling
Thanks to Paul and Gabor for additional tips/examples. Actually, I find
Pauls suggestion with setRNG also nice and is exactly what I wanted.
Paul, if I understand this correctly, your suggestion with setRNG does not
alter RNG flow, it just takes care that chains really have equal seeds.
I
Here is a small variation. We define a list to hold
the last seed for each chain. Each time we enter the simulation
for a chain we use that seed and each time we exit we update it.
The loop becomes simpler since the setup is all done prior
to looping and everything else is done in the inner
On Wed, Jun 08, 2005 at 12:55:07PM -0400, Gabor Grothendieck wrote:
That could be addressed like this (where changing the offset
changes the experiment).
offset - 123
niter - 3
nchain - 2
for (i in 1:niter) { # iterations
for (j in 1:nchain) { # chains
set.seed(i+offset)
a -
And a last post from Paul Gilbert. Thanks to all! This disscusion was
really beneficial for me!
-Original Message-
From: Paul Gilbert [mailto:[EMAIL PROTECTED]
Sent: sre 2005-06-08 21:01
To: Gorjanc Gregor
Subject: Re: [R] Random seed problem in MCMC coupling of chains
Gorjanc Gregor
Gorjanc Gregor wrote:
Thanks to Paul and Gabor for additional tips/examples. Actually, I find
Pauls suggestion with setRNG also nice and is exactly what I wanted.
Paul, if I understand this correctly, your suggestion with setRNG does not
alter RNG flow, it just takes care that chains really
On 6/8/05, Gorjanc Gregor [EMAIL PROTECTED] wrote:
And a last post from Paul Gilbert.
-Original Message-
From: Paul Gilbert [mailto:[EMAIL PROTECTED]
In your example it is important that you generate the same number of
random numbers in each pass through the chain. If that is not
Hi,
I have a R wrapper function that calls my C code via .C(). In my C code,
I have been calling GetRNGstate() (and PutRNGstate()) once at the
beginning (and the end) of the code. However, if I generate a random
number within the R wrapper function (say via runif()), then my C code
produces the
My guess is that
http://cran.r-project.org/src/contrib/Descriptions/rlecuyer.html might be
relevant, too.
Cheers,
Andy
From: Duncan Murdoch
On Mon, 2 Aug 2004 17:50:44 -0500, Bickel, David
[EMAIL PROTECTED] wrote:
After reading the help page on set.seed, I am unsure about
how to solve
On Mon, 2 Aug 2004 17:50:44 -0500, Bickel, David
[EMAIL PROTECTED] wrote:
After reading the help page on set.seed, I am unsure about
how to solve the following problem. I need to call function f
a thousand times. The list of values returned by f, should be
as random as possible. f
After reading the help page on set.seed, I am unsure about how to solve the following
problem. I need to call function f a thousand times. The list of values returned by f,
should be as random as possible. f calls g twice:
f - function(){g1 - g(1); g2 - g(2); c(g1; g2)}
The function g in
17 matches
Mail list logo