Learn R Programming

mixer (version 1.2)

setSeed: Set internal seed

Description

This utility sets the internal random seed used by mixer.

Usage

setSeed( seed = 1 )

Arguments

seed
sets the seed of the internal random generator in the mixer C/C++ libraries (integer value).

Details

Sets the seed of the random generator (srand) in the C standard library. This random generator is used inside the mixer initialization stage. This function is useful to generate exactly the same initial conditions before two mixer runs.

Examples

Run this code
graph.affiliation(n=100,c(1/3,1/3,1/3),0.8,0.2)->g
setSeed(777)
mixer(g$x,qmin=2,qmax=6)->xout
plot(xout)

# Produce strictly the same result
setSeed(777)
mixer(g$x,qmin=2,qmax=6)->xout
plot(xout)

Run the code above in your browser using DataLab