rmph: Simulate a MPH* random vector

View source: R/RcppExports.R

rmphR Documentation

Simulate a MPH* random vector

Description

Generates a sample of size n from a MPH* distribution with parameters alpha, S and R.

Usage

rmph(n, alpha, S, R)

Arguments

n

Sample size.

alpha

Initial probabilities.

S

Sub-intensity matrix.

R

Reward matrix.

Value

The simulated sample.

Examples

alpha <- c(0.5, 0.3, 0.2)
S <- matrix(c(c(-1, 0, 0), c(1, -2, 0), c(0, 1, -5)), nrow = 3, ncol = 3)
R <- matrix(c(c(1, 0, 0.8), c(0, 1, 0.2)), nrow = 3, ncol = 2)
n <- 10
rmph(n, alpha, S, R)

jorgeyslas/phfrailty documentation built on April 17, 2025, 4:11 p.m.