redf: Random numbers from empirical distribution function.

View source: R/activity_code.r

redfR Documentation

Random numbers from empirical distribution function.

Description

Random numbers drawn from an empirical distribution defined by paired values and probabilities.

Usage

redf(n, fit)

Arguments

n

Integer number of random numbers to return.

fit

Data frame defining the emprical distribution (see details).

Details

The distribution function is defined by fit, which must be a dataframe containing (at least) columns named: x: a regular sequence of values from which to draw; y: corresponding pdf values.

Value

A numeric vector.

Examples

data(BCItime)
tm <- 2*pi*subset(BCItime, species=="paca")$time
mod <- fitact(tm)
rn <- redf(1000, as.data.frame(mod@pdf))

activity documentation built on Sept. 27, 2023, 9:08 a.m.

Related to redf in activity...