rtweibull {iclogcondist}R Documentation

Simulate from a Truncated Weibull Distribution

Description

This function generates random samples from a truncated Weibull distribution using inverse transform sampling. When shape = 1, it reduces to a truncated exponential distribution.

Usage

rtweibull(n, shape = 1, scale = 1, upper_bound = Inf)

Arguments

n

An integer specifying the number of random samples to generate.

shape

A positive numeric value representing the shape parameter of the Weibull distribution. Default is 1.

scale

A positive numeric value representing the scale parameter of the Weibull distribution. Default is 1.

upper_bound

A positive numeric value indicating the upper truncation point. Default is Inf (no truncation).

Value

A numeric vector of n random samples from the truncated Weibull distribution.

Examples

# Generate 10 random samples from a truncated Weibull distribution
rtweibull(10, shape = 2, scale = 1, upper_bound = 5)


[Package iclogcondist version 1.0.1 Index]