Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/reward_phase_type.R
Transform a variable following a phase-type distribution according to a non-negative reward vector.
1 | reward_phase_type(phase_type, reward, round_zero = NULL)
|
phase_type |
an object of class |
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 |
round_zero |
is a positive integer or |
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.
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.
C. Guetemme, A. Hobolth
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.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.