get_rng_substream: Get the rng substream for an rstream object corresponding to...

Description Usage Arguments Value

View source: R/utils.R

Description

Importantly, by default this function has the side effect of setting RNG to use rstream with the returned object. This behavior is determined by the set_rng argument. This means the caller doesn't have to worry about doing anything unless (a) it wants to use more than 1 substream or (b) it is going to parallelize or do any RNG in a different R session. Because of strange behavior in the rstream package, this function can be called at most once without the rngstream argument in a given R session.

Usage

1
2
get_rng_substream(rngstream, seed = 9029979, method, year, week,
  set_rng = TRUE)

Arguments

rngstream

(optional) object of class "rstream.mrg32k3a" which will be advanced from its current state.

seed

integer seed for rng; the default was randomly generated

method

character string specifying prediction method currently one of "sarima", "kcde", or "kde"

year

character string specifying year, format "1998"

week

character string specifying epidemic week, in format "02"

set_rng

boolean should rng be set to use rstream with the returned rngstream object?

Value

invisible object of class "rstream.mrg32k3a", but advanced to the first substream reserved for the given combination of prediction method, region, and season. The object has been packed via rstream.packed.


reichlab/2017-2018-cdc-flu-contest documentation built on May 24, 2019, 6:17 a.m.