Learn R Programming

fsdaR (version 0.9-0)

myrng: Set seed for the MATLAB random number generator

Description

Initializes the MATLAB random generator

Usage

myrng(seed)

Value

Integer, the seed value with which the MATLAB random number generator was initialized.

Arguments

seed

a single value, interpreted as an integer

Examples

Run this code

 if (FALSE) {
   data(wool)
   XX <- wool
   y <- XX[, ncol(XX)]
   X <- XX[, 1:(ncol(XX)-1), drop=FALSE]

   seed <- myrng()                       #i nitialized the RNG and keep the seed

   myrng(seed)                           # repeat the computations with the same seed
   (out2 <- fsreg(X, y, method="LTS"))

   all.equal(out1, out2)

 }

Run the code above in your browser using DataLab