Learn R Programming

UnivRNG (version 1.2.3)

draw.weibull: Generates variates from Weibull distribution

Description

This function implements pseudo-random number generation for a Weibull distribution with pdf

$$f(x|\alpha,\beta)=\frac{\alpha}{\beta^{\alpha}}x^{\alpha-1}e^{-(x/\beta)^{\alpha}}$$

for \(0 \leq x < \infty\) and \(\min(\alpha,\beta)>0\) where \(\alpha\) and \(\beta\) are the shape and scale parameters, respectively.

Usage

draw.weibull(nrep, alpha, beta)

Arguments

nrep

Number of data points to generate.

alpha

Shape parameter of the desired Weibull distribution.

beta

Scale parameter of the desired Weibull distribution.

Value

A list of length five containing generated data, the theoretical mean, the empirical mean, the theoretical variance, and the empirical variance with names y, theo.mean, emp.mean, theo.var, and emp.var, respectively.

Examples

Run this code
# NOT RUN {
draw.weibull(nrep=100000, alpha=0.5, beta=1)

draw.weibull(nrep=100000, alpha=5, beta=1)
# }

Run the code above in your browser using DataLab