Description Usage Arguments Details Value Source See Also Examples
View source: R/DocumentationSum.R
The sum of two independent discrete or continuous
phase-type distributed variables with initial distributions
initDist1
and initDist2
as well as sub-transition/sub-intensity
matrices equal to P_Mat1
/T_Mat1
and P_Mat2
/T_Mat2
.
1 | phsum(object1, object2)
|
object1, object2 |
two objects of class |
In the discrete case, the sum of two phase-type distributed variables tau1 ~ DPH_p(α,S) and tau2 ~ DPH_q(β,T) is again discrete phase-type distributed in the following way
tau1 + tau2 ~ DPH_{p+q}((α,0),cbind((S, s β),(0,T)) ).
In the continuous case, the sum of two phase-type distributed variables X ~ PH_p(α,S) and Y ~ PH_q(β,T) is again continuous and phase-type distributed in the following way
X + Y ~ PH_{p+q}((α,0),cbind((S, s β),(0,T)) ).
The function phsum
returns an object of type discphasetype
or contphasetype
(depending on the input) holding the phase-type representation
of the sum of the input objects.
Mogens Bladt and Bo Friis Nielsen (2017): Matrix-Exponential Distributions in Applied Probability. Probability Theory and Stochastic Modelling (Springer), Volume 81.
sum
.
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 | ## A simple example
phsum(T_MRCA$n5,T_Total$n5)
## For n=4, the total length of branches giving rise to
## singletons is phase-type distributed with initial distribution
initDist1 <- c(1,0,0)
## and sub-intensity rate matrix
T_Mat1 <- matrix(c(-1.5, 1.5, 0,
0, -1.5, 1,
0, 0, -1), nrow = 3, byrow = TRUE)
## The total length of branches giving rise to
## double-tons is phase-type distributed with initial distribution
initDist2 <- c(1,0)
## and sub-intensity rate matrix
T_Mat2 <- matrix(c(-3, 1,
0, -0.5), nrow = 2, byrow = TRUE)
## Defining two objects of type "contphasetype"
T1 <- contphasetype(initDist1, T_Mat1)
T2 <- contphasetype(initDist2, T_Mat2)
## Hence, the total length of branches giving rise to
## singletons and doubletons is phase-type distributed
## in the following way
phsum(T1,T2)
## (Please compare this distribution with the distribution
## obtained directly from the reward transformation)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.