reward_phase_type: Transformation of Phase-Type Distributions via Rewards

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

View source: R/reward_phase_type.R

Description

Transform a variable following a phase-type distribution according to a non-negative reward vector.

Usage

1
reward_phase_type(phase_type, reward, round_zero = NULL)

Arguments

phase_type

an object of class cont_phase_type or disc_phase_type.

reward

a vector of the same length as the number of states. The vector should contains non negative values and only integer for discrete phase-type class. For disc_phase_type object, it could also be a matrix with as many rows as states and as many columns as the maximum values of reward plus one. Also in this case, each cell of the matrix should be probabilities and the sum of the rows should sum up to one.

round_zero

is a positive integer or NULL, if it is a positive integer, all the values in the subintensity matrix and initial probabilities will be truncate at the corresponding decimal. It can be useful if the computational approximation of some values leads the row sums of the subintensity matrix to be higher than 1 or smaller than 0 for discrete cases, or higher than 0 for continuous cases.

Details

For the reward transformation for continuous phase-type distribution, the transformation will be performed as presented in the book of Bladt and Nielsen (2017).

For the discrete phase_type distribution is based on the PhD of Navarro (2018) and Hobolth, Bladt and Andersen (2021).

Every state of the subintensity matrix should have a reward, in the case of continuous phase-type, this reward should be a vector with non negative values of a size equal to the number of states.

For the discrete phase-type, the reward could be also a vector but containing only non-negatives integer. Also it can be me a matrix, in that case the matrix should have as many rows as the number of states, and the column 1 to j+1 corresponds to reward of 0 to j. Each cell corresponding that entering in the state i, the probability that we attribute to this state a reward j corresponds to the value of the matrix in row i and column j+1.

Value

An object of class disc_phase_type or cont_phase_type. Be aware that if the input is a multivariate phase_type the output will be univariate.

Author(s)

C. Guetemme, A. Hobolth

References

Bladt, M., & Nielsen, B. F. (2017). *Matrix-exponential distributions in applied probability* (Vol. 81). New York: Springer. Campillo Navarro, A. (2018). *Order statistics and multivariate discrete phase-type distributions*. DTU Compute. DTU Compute PHD-2018, Vol.. 492 Hobolth, A., Bladt, M. & Andersen, L.A. (2021). *Multivariate phase-type theory for the site frequency spectrum*. ArXiv.

See Also

phase_type

Examples

 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
##===========================##
## For continuous phase-type ##
##===========================##

subint_mat <- matrix(c(-3, 1, 1,
                      2, -3, 0,
                      1, 1, -3), ncol = 3)
init_probs <- c(0.9, 0.1, 0)
ph <- PH(subint_mat, init_probs)
reward <- c(0.5, 0, 4)

reward_phase_type(ph, reward)

##=========================##
## For discrete phase-type ##
##=========================##

subint_mat <- matrix(c(0.4, 0, 0,
                      0.24, 0.4, 0,
                      0.12, 0.2, 0.5), ncol = 3)
init_probs <- c(0.9, 0.1, 0)
ph <- DPH(subint_mat, init_probs)

reward <- c(1, 0, 4)

reward_phase_type(ph, reward)

#---

subint_mat <- matrix(c(0.4, 0, 0.5,
                      0.2, 0.24, 0,
                      0.4, 0.6, 0.2), ncol = 3)
init_probs <- c(0.9, 0.1, 0)

ph <- DPH(subint_mat, init_probs)

reward <- matrix(c(0, 0.2, 1,
                   0.5, 0, 0,
                   0.5, 0.6, 0,
                   0, 0, 0,
                   0, 0.2, 0), ncol = 5)

reward_phase_type(ph, reward)

rivasiker/phasty documentation built on June 15, 2021, 9:18 p.m.