gentime: Generating Irregularly spaced times

gentimeR Documentation

Generating Irregularly spaced times

Description

A method for generating time points based on a statistical distribution. The results are stored in the 'times' slot of the 'utilities' object.

Usage

gentime(x, ...)

Arguments

x

An object of class 'utilities'.

...

Additional arguments for generating time points:

n

A positive integer. Length of observation times.

distribution

A character string specifying the distribution of the observation times. Default is '"expmixture"'. Available options are: - '"expmixture"': A mixture of two exponential distributions. - '"uniform"': A uniform distribution. - '"exponential"': A single exponential distribution. - '"gamma"': A gamma distribution.

lambda1

Mean (1/rate) of the exponential distribution or the first exponential distribution in a mixture of exponential distributions. Default is '130'.

lambda2

Mean (1/rate) of the second exponential distribution in a mixture of exponential distributions. Default is '6.5'.

p1

Weight of the first exponential distribution in a mixture of exponential distributions. Default is '0.15'.

p2

Weight of the second exponential distribution in a mixture of exponential distributions. Default is '0.85'.

a

Shape parameter of a gamma distribution or lower limit of the uniform distribution. Default is '0'.

b

Scale parameter of a gamma distribution or upper limit of the uniform distribution. Default is '1'.

Value

An updated 'utilities' object with the generated observation times stored in the 'times' slot.

References

\insertRef

Eyheramendy_2018iAR

Examples

set.seed(12917)
o1=iAR::utilities()
o1<-gentime(o1, n=200, distribution = "expmixture", lambda1 = 130, 
lambda2 = 6.5,p1 = 0.15, p2 = 0.85)
st=o1@times
mean(diff(st))

o1=iAR::utilities()
o1<-gentime(o1, n=200, distribution = "expmixture", lambda1 = 15, 
lambda2 = 2.5,p1 = 0.15, p2 = 0.85)
st=o1@times
mean(diff(st))


iAR documentation built on April 4, 2025, 2:21 a.m.

Related to gentime in iAR...