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

View source: R/functions.R

rkrecR Documentation

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, ...)

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.

Value

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

See Also

ros

Examples

# 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)


mos documentation built on June 16, 2025, 5:09 p.m.