RNG: Extracting RNG Data from NMF Objects

Description Usage Arguments Functions Methods (by generic) Examples

Description

The nmf function returns objects that contain embedded RNG data, that can be used to exactly reproduce any computation. These data can be extracted using dedicated methods for the S4 generics getRNG and getRNG1.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
getRNG1(object, ...)

## S4 method for signature 'NMFfitX'
getRNG1(object)

## S4 method for signature 'NMFfitX1'
getRNG1(object)

## S4 method for signature 'NMFfitXn'
getRNG1(object)

## S4 method for signature 'NMFfitXn'
.getRNG(object, ...)

Arguments

object

an R object from which RNG settings can be extracted, e.g. an integer vector containing a suitable value for .Random.seed or embedded RNG data, e.g., in S3/S4 slot rng or rng$noise.

...

extra arguments to allow extension and passed to a suitable S4 method .getRNG or .setRNG.

Functions

Methods (by generic)

Examples

1
2
3
4
5
6
7
8
9
# For multiple NMF runs, the RNG settings used for the first run is also stored
V <- rmatrix(20,10)
res <- nmf(V, 3, nrun=4)
# RNG used for the best fit
getRNG(res)
# RNG used for the first of all fits
getRNG1(res)
# they may differ if the best fit is not the first one
rng.equal(res, getRNG1(res))

renozao/NMF documentation built on June 14, 2020, 9:35 p.m.