rmdt: Simulate from a multiple decrement table

Description Usage Arguments Value Details Author(s) See Also Examples

View source: R/6_randomGenerationFunctions.R

Description

Simulate from a multiple decrement table

Usage

1
2
rmdt(n = 1, object, x = 0, t = 1, t0 = "alive",
  include.t0 = TRUE)

Arguments

n

Number of simulations.

object

The mdt object to simulate from.

x

the period to simulate from.

t

the period until to simulate.

t0

initial status (default is "alive").

include.t0

should initial status to be included (default is TRUE)?

Value

A matrix with n columns (the length of simulation) and either t (if initial status is not included) or t+1 rows.

Details

The functin uses rmarkovchain function from markovchain package to simulate the chain

Author(s)

Giorgio Spedicato

See Also

rLifeContingenciesXyz,rLifeContingencies

Examples

1
2
3
mdtDf<-data.frame(x=c(0,1,2,3),death=c(100,50,30,10),lapse=c(150,20,2,0))
myMdt<-new("mdt",name="example Mdt",table=mdtDf)
ciao<-rmdt(n=5,object = myMdt,x = 0,t = 4,include.t0=FALSE,t0="alive")

lifecontingencies documentation built on March 6, 2019, 1:05 a.m.