Description Usage Arguments Details Value Functions Examples
Generator functions for the S3 classes cont_phase_type
, disc_phase_type
,
mult_cont_phase_type
, mult_disc_phase_type
, which represent the
different phase-type distributions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | PH(subint_mat = NULL, init_probs = NULL, round_zero = NULL)
DPH(subint_mat = NULL, init_probs = NULL, round_zero = NULL)
MPH(subint_mat = NULL, init_probs = NULL,
reward_mat = NULL, round_zero = NULL)
MDPH(subint_mat = NULL, init_probs = NULL,
reward_mat = NULL, round_zero = NULL)
## S3 method for class 'cont_phase_type'
summary(object, ...)
## S3 method for class 'disc_phase_type'
summary(object, ...)
## S3 method for class 'mult_cont_phase_type'
summary(object, ...)
## S3 method for class 'mult_disc_phase_type'
summary(object, ...)
|
subint_mat |
a square matrix containing the transition rates or probabilities between transient states for continuous or discrete phase-type respectively. If the phase-type is continuous, the sub-intensity matrix diagonal should only contain negative values and the row sums should be non-positive. If the phase-type is discrete, the sub-intensity matrix should only contain values between 0 and 1. |
init_probs |
a vector, a one-row matrix or |
round_zero |
an integer or |
reward_mat |
a matrix |
object |
a phase-type object |
... |
other arguments passed to methods |
PH
, DPH
, MPH
and MDPH
are the generator functions
for the four types of phase-type distribution
classes, this is, the continuous univariate, the discrete univariate, the continuous multivariate
and the discrete multivariate respectively.
The class is generated by supplying a sub-intensity matrix and an optional
initial probability vector plus a reward matrix in the case of multivariate
phase-type.
If the initial probabilities are not specified, then the initial probability
will be init_probs = c(1, 0, 0, ...)
with the same length as the
number of transient states.
A phase-type object of class cont_phase_type
for PH
, disc_phase_type
for DPH
,
mult_cont_phase_type
for MPH
, and mult_disc_phase_type
for MDPH
.
All these classes inherit from list
.
summary.cont_phase_type
: pretty summary of the cont_phase_type
class.
summary.disc_phase_type
: pretty summary of the disc_phase_type
class.
summary.mult_cont_phase_type
: pretty summary of the mult_cont_phase_type
class.
summary.mult_disc_phase_type
: pretty summary of the mult_dist_phase_type
class.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | ##===========================##
## For continuous univariate ##
##===========================##
subintensity_matrix <- matrix(c(-1.5, 1.5, 0,
0, -1, 1,
0, 0, -0.5),
ncol = 3,
byrow = TRUE)
PH(subintensity_matrix)
#---
subintensity_matrix <- matrix(c(-1.5, 1.5, 0,
0, -1, 1,
0, 0, -0.5),
ncol = 3,
byrow = TRUE)
initial_probabilities <- c(0.9, 0.1, 0)
PH(subintensity_matrix, initial_probabilities)
##=========================##
## For discrete univariate ##
##=========================##
subintensity_matrix <- matrix(c(0.4, 0.24, 0.12,
0, 0.4, 0.2,
0, 0, 0.5),
ncol = 3,
byrow = TRUE)
DPH(subintensity_matrix)
#---
subintensity_matrix <- matrix(c(0.4, 0.24, 0.12,
0, 0.4, 0.2,
0, 0, 0.5),
ncol = 3,
byrow = TRUE)
initial_probabilities <- c(0.9, 0.1, 0)
DPH(subintensity_matrix, initial_probabilities)
##=============================##
## For continuous multivariate ##
##=============================##
subintensity_matrix <- matrix(c(-3, 2, 0,
0, -2, 1,
0, 0, -1),
nrow = 3,
byrow = TRUE)
reward_matrix = matrix(sample(seq(0, 10, 0.1), 6), nrow = 3, ncol = 2)
initial_probabilities = c(1, 0, 0)
MPH(subintensity_matrix,
initial_probabilities,
reward_matrix)
##===========================##
## For discrete multivariate ##
##===========================##
subintensity_matrix <- matrix(c(0.4, 0.24, 0.12,
0, 0.4, 0.2,
0, 0, 0.5),
ncol = 3,
byrow = TRUE)
reward_matrix <- matrix(sample(seq(0, 10), 6), nrow = 3, ncol = 2)
initial_probabilities = c(1, 0, 0)
MDPH(subintensity_matrix,
initial_probabilities,
reward_mat = reward_matrix)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.