RandomWeibullArray-class {DelayedRandomArray} | R Documentation |
A DelayedArray subclass that performs on-the-fly sampling of Weibull-distributed values.
RandomWeibullArraySeed(dim, shape, scale = 1, chunkdim = NULL) ## S4 method for signature 'RandomWeibullArraySeed' DelayedArray(seed) RandomWeibullArray(dim, shape, scale = 1, chunkdim = NULL)
dim |
Integer vector of positive length, specifying the dimensions of the array. |
shape, scale |
Numeric vector used as the argument of the same name in |
chunkdim |
Integer vector of length equal to |
seed |
A RandomWeibullArraySeed object. |
All constructors return an instance of a RandomWeibullArray object, containing random draws from a Weibull distribution with the specified parameters.
Aaron Lun
The RandomArraySeed class, for details on chunking and the distributional parameters.
X <- RandomWeibullArraySeed(c(1e5, 1e5), shape=10) Y <- DelayedArray(X) Y # Fiddling with the distribution parameters: X2 <- RandomWeibullArraySeed(c(1e5, 1e5), shape=round(runif(1e5, 10, 20))) Y2 <- DelayedArray(X2) Y2 # Using another array as input: library(Matrix) shape <- round(RandomUnifArray(c(1e5, 1e5), 10, 20)) X3 <- RandomWeibullArraySeed(c(1e5, 1e5), shape=shape) Y3 <- DelayedArray(X3) Y3