r_ditrunc_elife: Sample observations from an interval truncated excess...

View source: R/simulation.R

r_ditrunc_elifeR Documentation

Sample observations from an interval truncated excess lifetime distribution

Description

Sample observations from an interval truncated excess lifetime distribution

Usage

r_ditrunc_elife(
  n,
  rate,
  scale,
  shape,
  lower,
  upper,
  family = c("exp", "gp", "gomp", "gompmake", "weibull", "extgp", "gppiece",
    "extweibull", "perks", "beard", "perksmake", "beardmake")
)

Arguments

n

sample size

rate

rate parameter(s)

scale

scale parameter(s)

shape

shape parameter(s)

lower

vector of lower bounds

upper

vector of upper bounds

family

string; choice of parametric family

Value

a vector of n observations

Examples

n <- 100L
# the lower and upper bound are either scalar,
# or else vectors of length n
r_dtrunc_elife(n = n, scale = 1, shape = -0.1,
               lower = pmax(0, runif(n, -0.5, 1)),
               upper = runif(n, 6, 10),
               family = "gp")

longevity documentation built on Nov. 12, 2023, 5:07 p.m.