Learn R Programming

mos (version 0.1.3)

rkrec: Generate Upper and Lower k-Records from Continuous Distributions

Description

This function generates \(k\)-records (upper or lower) from a specified continuous distribution.

Usage

rkrec(size, k, record = c("upper", "lower"), dist, ...)

Value

A numeric vector of size size, representing the simulated k-records.

Arguments

size

number of k-records to generate.

k

the rank of the record to generate (\(k\)-record).

record

the type of record to generate: "upper" for upper k-records, "lower" for lower k-records. Default is "upper".

dist

a character string specifying the name of the continuous distribution (e.g., "norm", "exp", "gamma").

...

further arguments to be passed to dist.

Details

Note: Setting k = 1 generates standard (1-)records.

See Also

ros

Examples

Run this code
# Generate 5 upper 2-records from the normal distribution
rkrec(size = 5, k = 2, record = "upper", dist = "norm", mean = 0, sd = 1)

# Generate 5 lower 3-records from the exponential distribution
rkrec(size = 5, k = 3, record = "lower", dist = "exp", rate = 1)

Run the code above in your browser using DataLab