View source: R/generateNonHomogeneousExp.R
nhExpRand | R Documentation |
This function generates random variables from a non-homogeneous exponential distribution based on a provided rate function.
nhExpRand(n, rate_func, now = 0, tMax = Inf)
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. |
A numeric vector of generated variables.
rate_function_example <- function(t) { 1 + sin(t) }
nh_exp_vars <- nhExpRand(10, rate_function_example, now = 0, tMax = 20)
print(nh_exp_vars)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.