RandomWeibullArray-class: DelayedArray of random Weibull-distributed values

Description Usage Arguments Value Author(s) See Also Examples

Description

A DelayedArray subclass that performs on-the-fly sampling of Weibull-distributed values.

Usage

1
2
3
4
5
6
RandomWeibullArraySeed(dim, shape, scale = 1, chunkdim = NULL)

## S4 method for signature 'RandomWeibullArraySeed'
DelayedArray(seed)

RandomWeibullArray(dim, shape, scale = 1, chunkdim = NULL)

Arguments

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 qweibull. Alternatively, a numeric array-like object with the same dimensions as dim.

chunkdim

Integer vector of length equal to dim, containing the dimensions of each chunk.

seed

A RandomWeibullArraySeed object.

Value

All constructors return an instance of a RandomWeibullArray object, containing random draws from a Weibull distribution with the specified parameters.

Author(s)

Aaron Lun

See Also

The RandomArraySeed class, for details on chunking and the distributional parameters.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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

LTLA/DelayedRandomArray documentation built on Dec. 18, 2021, 3:40 a.m.