r_weibull: Generate Weibull Distributed Values

Description Usage Arguments Details Value Examples

View source: R/built_in_distributions.R

Description

Generates a set of Weibull distributed values.

Usage

1
2
3
4
5
6
7
8
9
r_weibull(
  shape,
  scale = 1,
  ...,
  b_scale = NULL,
  B_scale = NULL,
  n = default_n(shape, scale, b_scale, B_scale),
  .seed = NULL
)

Arguments

shape

vector of shape parameters, strictly positive

scale

vector of scale parameters, strictly positive

...

Unused

b_scale, B_scale

alternative definition of scale parameter, cannot be provided with scale, strictly positive.

n

number of observations to generate. The default_n() function will provide a default value within context

.seed

One of the following:

  • NULL (default) will not change the current seed. This is the usual case for generating random numbers.

  • A numeric value. This will be used to set the seed before generating the random numbers. This seed will be stored with the results.

  • TRUE. A random seed value will be generated and set as the seed before the results are generated. Again, this will be stored with the results.

To extract the random seed from a previously generated set of values, use pull_seed()

Details

This function provides alternative definitions for the scale parameter depending on the user's parametrisation of the Weibull distribution, with k = shape.

Using λ = scale:

F(x) = 1 - exp(-(x/λ)^k)

Using b = b_scale:

F(x) = 1 - exp(-bx^k)

Using β = B_scale:

F(x) = 1 - exp(-(β x)^k)

Value

A numeric vector of length n

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
set_n(5)

r_weibull(10)

r_weibull(1:10, 2)

r_weibull(1:10, scale = 2)
r_weibull(1:10, b_scale = 2)
r_weibull(1:10, B_scale = 2)

r_weibull(10, 2, n = 10)

rando documentation built on Feb. 16, 2021, 5:07 p.m.