nhExpRand: Generate Non-Homogeneous Exponential Random Variables

View source: R/generateNonHomogeneousExp.R

nhExpRandR Documentation

Generate Non-Homogeneous Exponential Random Variables

Description

This function generates random variables from a non-homogeneous exponential distribution based on a provided rate function.

Usage

nhExpRand(n, rate_func, now = 0, tMax = Inf)

Arguments

n

The number of variables to generate.

rate_func

The rate function of the non-homogeneous process.

now

The current time, default is 0.

tMax

The maximum time, default is Inf.

Value

A numeric vector of generated variables.

Examples

rate_function_example <- function(t) { 1 + sin(t) }
nh_exp_vars <- nhExpRand(10, rate_function_example, now = 0, tMax = 20)
print(nh_exp_vars)

franciscorichter/emphasis documentation built on Jan. 6, 2025, 7:06 p.m.