Displaying 5 results from an estimated 5 matches for "seed_pos".
Did you mean:
end_pos
2020 Jul 30
2
Seeding non-R RNG with numbers from R's RNG stream
...t;- function() {
# initialize a variable to pass to C++
init_var <- runif(1)
# get current state of RNG stream
# first entry of .Random.seed is an integer representing the algorithm used
# second entry is current position in RNG stream
# subsequent entries are pseudorandom numbers
seed_pos <- .Random.seed[2]
seed <- .Random.seed[seed_pos + 2]
out <- sample_cpp(init_var = init_var, seed = seed)
# move R's position in the RNG stream forward by 1 with a throw away sample
runif(1)
# return the output
out}
[[alternative HTML version deleted]]
2020 Jul 30
3
Seeding non-R RNG with numbers from R's RNG stream
...<- runif(1)
> >
> > # get current state of RNG stream
> > # first entry of .Random.seed is an integer representing the
> algorithm used
> > # second entry is current position in RNG stream
> > # subsequent entries are pseudorandom numbers
> > seed_pos <- .Random.seed[2]
> >
> > seed <- .Random.seed[seed_pos + 2]
> >
> > out <- sample_cpp(init_var = init_var, seed = seed)
> >
> > # move R's position in the RNG stream forward by 1 with a throw away
> sample
> > runif(1)
> >...
2020 Jul 30
0
Seeding non-R RNG with numbers from R's RNG stream
...e to pass to C++
> init_var <- runif(1)
>
> # get current state of RNG stream
> # first entry of .Random.seed is an integer representing the algorithm used
> # second entry is current position in RNG stream
> # subsequent entries are pseudorandom numbers
> seed_pos <- .Random.seed[2]
>
> seed <- .Random.seed[seed_pos + 2]
>
> out <- sample_cpp(init_var = init_var, seed = seed)
>
> # move R's position in the RNG stream forward by 1 with a throw away sample
> runif(1)
>
> # return the output
> out...
2020 Jul 30
0
Seeding non-R RNG with numbers from R's RNG stream
...>? ? # get current state of RNG stream
> >? ? # first entry of .Random.seed is an integer representing the
> algorithm used
> >? ? # second entry is current position in RNG stream
> >? ? # subsequent entries are pseudorandom numbers
> >? ? seed_pos <- .Random.seed[2]
> >
> >? ? seed <- .Random.seed[seed_pos + 2]
> >
> >? ? out <- sample_cpp(init_var = init_var, seed = seed)
> >
> >? ? # move R's position in the RNG stream forward by 1 with a
> throw away sam...
2020 Jul 30
2
Seeding non-R RNG with numbers from R's RNG stream
...nt state of RNG stream
> > > # first entry of .Random.seed is an integer representing the
> > algorithm used
> > > # second entry is current position in RNG stream
> > > # subsequent entries are pseudorandom numbers
> > > seed_pos <- .Random.seed[2]
> > >
> > > seed <- .Random.seed[seed_pos + 2]
> > >
> > > out <- sample_cpp(init_var = init_var, seed = seed)
> > >
> > > # move R's position in the RNG stream forward by 1...