선정목록으로
A shiny app for modeling the lifetime in primary breast cancer patients through phase-type distributions
필름·전자재료 · (16) CPI(투명 폴리이미드)
기본 정보
- 저자
- DOI
- 10.48550/arxiv.2412.03975
- 저널
- arXiv (Cornell University)
- 발행년도
- 2024
- 발행기관
- Cornell University
- 피인용수
- 0
- 라이선스
- 0
- 논문 유형
- –
- 언어
- –
- 원문 페이지
- https://doi.org/10.48550/arxiv.2412.03975
- 토픽
- Electron and X-Ray Spectroscopy Techniques
- OpenAlex ID
- W6929083507
평가 내용
- 관련도
- 사업분야
- 필름·전자재료 · (16) CPI(투명 폴리이미드)
- 부 분야
- –
- R&D 측면
- –
- 확신도
- –
- 근거 용어
- –
- 판단 근거
- 임베딩 유사도 기반 평가로 '필름·전자재료 > CPI(투명 폴리이미드)' 분야에 선정된 논문입니다.
- R&D 활용 포인트
- –
- 평가 입력
- –
초록
Phase-type distributions (PHDs), which are defined as the distribution of the lifetime up to the absorption in an absorbent Markov chain, are an appropriate candidate to model the lifetime of any system, since any non-negative probability distribution can be approximated by a PHD with sufficient precision. Despite PHD potential, friendly statistical programs do not have a module implemented in their interfaces to handle PHD. Thus, researchers must consider others statistical software such as R, Matlab or Python that work with the compilation of code chunks and functions. This fact might be an important handicap for those researchers who do not have sufficient knowledge in programming environments. In this paper, a new interactive web application developed with shiny is introduced in order to adjust PHD to an experimental dataset. This open access app does not require any kind of knowledge about programming or major mathematical concepts. Users can easily compare the graphic fit of several PHDs while estimating their parameters and assess the goodness of fit with just several clicks. All these functionalities are exhibited by means of a numerical simulation and modeling the time to live since the diagnostic in primary breast cancer patients.
본문 46,959자
본문 펼치기
MBE, 21 (1): 1508–1526.
DOI: 10.3934/mbe.2024065
Received: 21 November 2023
Revised: 13 December 2023
Accepted: 19 December 2023
Published: 29 December 2023
http://www.aimspress.com/journal/MBE
_Research article_
# A shiny app for modeling the lifetime in primary breast cancer patients through phase-type distributions
Christian Acal <sup>1</sup> , Elena Contreras <sup>2</sup> , Ismael Montero <sup>3</sup> and Juan Eloy Ruiz-Castro <sup>1,</sup> *
1 Department of Statistics and O.R. and IMAG, University of Granada, 18071 Granada, Spain
2 University of Granada, 18071 Granada, Spain
3 Department of Statistics and O.R., University of Cádiz, 11510 Cádiz, Spain
* Correspondence: Email: jeloy@ugr.es; Tel: +34-958-246-306.
Abstract: Phase-type distributions (PHDs), which are defined as the distribution of the lifetime up to
the absorption in an absorbent Markov chain, are an appropriate candidate to model the lifetime of any
system, since any non-negative probability distribution can be approximated by a PHD with sufficient
precision. Despite PHD potential, friendly statistical programs do not have a module implemented in
their interfaces to handle PHD. Thus, researchers must consider others statistical software such as R,
Matlab or Python that work with the compilation of code chunks and functions. This fact might be an
important handicap for those researchers who do not have sufficient knowledge in programming
environments. In this paper, a new interactive web application developed with shiny is introduced in
order to adjust PHD to an experimental dataset. This open access app does not require any kind of
knowledge about programming or major mathematical concepts. Users can easily compare the graphic
fit of several PHDs while estimating their parameters and assess the goodness of fit with just several
clicks. All these functionalities are exhibited by means of a numerical simulation and modeling the
time to live since the diagnostic in primary breast cancer patients.
Keywords: phase-type distributions; modelling; lifetime; shiny; interactive app; breast cancer
1. Introduction
In a wide sense, reliability analysis is a branch of statistics in charge of measuring the probability
that a system performs correctly during a specific time duration, usually called ‘lifetime’ (or failure
<u>1509</u>
time). These systems have undergone continuous wear by uncontrollable variables, so that each of
them is going to fail (randomly) at different instants of time. In this context, the Probability Theory
plays a fundamental role in the field of reliability analysis, since identifying the probability distribution
of the lifetime might shed light on the existing variability behind the systems operation. Many of the
traditional probability distributions such as Exponential, Weibull or Gamma have been employed for
these purposes [1,2], even for modeling count data by constructing their discrete analogues [3].
However, due to the apparition of increasingly complex systems, these probability distributions display
a pretty poor fit in many occasions. To solve this problem, a solution might be considering some kind
of transformation for the data (see, for example, [4]) or applying a probability distributions mixture
(see, for instance, [5,6]). Another suitable option is to consider an approach based on Phase-type
distributions (PHD) [7,8].
PHDs are defined as the distribution of the lifetime up to the absorption in an absorbent Markov
chain with finite state space (for more information about Markov processes, see, for example, [9,10]).
Its matrix-algebraic form makes it possible to model complex systems with well-structured results,
which facilitates the posterior interpretation. The main characteristics of PHD are reviewed in depth
in [11]. An interesting result is that any non-negative probability distribution may be approximated
arbitrarily closely by a PHD, since this class of distributions is dense in the set of probability
distributions on the non-negative half-line [12,13]. Thanks to these characteristics, PHDs are highly
considered in many areas of knowledge. Among other many contributions, PHDs have shown better
behavior than Weibull or Exponential distributions to model data associated with non-volatile
memories [14,15]; in [16], PHDs are used to predict the length of stay in hospital for elderly
patients; in [17], PHDs are applied in the sector of risk theory; and a new class of distributions called
Linear PHDs was introduced to model the functional principal component analysis in [18].
The inherent problem that many researchers face when they are using PHD is that most friendly
statistical software such as SPSS or Statgraphics do not have a module available to handle PHD. Then,
researchers must resort to programs such as R, Matlab or Python, in which it is necessary to run code
chunks and collections of functions to obtain the outcomes. This fact may cause an important rejection
due to the lack of knowledge in programming concepts and researchers would look for other
alternatives, although the results are not good enough. Hence, there is a great need to develop new
tools in which no kind of knowledge about programming or mathematical concepts are required to use
them. In this way, researchers could apply complex statistical analysis, no matter their area of research
and education.
In this regard, many friendly and interactive applications are being built in recent years on R
package shiny [19], which significantly reduces the barriers to produce webpage-style representations
of analysis results in R. The interfaces produced by the shiny framework are rendered locally by a web
browser. These apps can be hosted publicly and might be incorporated as important parts of reports
and scientific papers [20]. In the literature, there are already a wide variety of shiny apps for different
purposes. In [21], an interactive graphics for functional data analyses is introduced, while the app
called _shinyMethyl_ is aimed at the visualization of high-dimensional genomic data [22]. [23] built a
shiny application that produced daily updates about the evolution of the SARS-CoV-2 epidemic
worldwide. Within the field of reliability analysis, _shinystan_ is developed for exploring Bayesian
models fit using Markov Chain Monte Carlo [24]; and a new methodology is presented in [25] to
compare Kaplan-Meier curves by means of a shiny app. Likewise, multiple shiny apps have been
developed for purely practical purposes. For instance, [26,27] for applications in the food field and [28,29]
_Mathematical Biosciences and Engineering_ Volume 21, Issue 1, 1508–1526.
<u>1510</u>
for applications in the industrial sector.
A new open access shiny app for modeling lifetimes through PHD is proposed in the current paper,
with no programming skills required to use it. This interactive web application is composed by two
blocks: An introductory part where the major features of PHD are explained graphically when different
structures are considered for the transition matrix; and a module where the user can estimate the best
PHD for a dataset using multiple estimation options available in the R package _mapfit_ [30]. Here, the
user can compare the graphic fit of several PHD while estimating their parameters and assess the
goodness of fit. This same methodology is extended in the developed shiny app for the case of one cutpoint PHD [31]. This new class of distributions aims to reduce the number of parameters to be
estimated and to improve the quality of the fit, especially in the tails of heavy distributions where the
classical PHD might provoke an inaccurate fit. Note that for fitting classical probability distributions,
R contains a package called _rriskDistributions_ [32], in which users can also choose the most
appropriate distribution without any knowledge of the R syntax.
Apart from this introduction, the rest of the manuscript is organized as follows: The major
theoretical concepts related to PHD and one cut-point PHD are described in Section 2. Section 3
contains a detailed explanation of the developed shiny app. An illustrative example about how to use
the app from a users’ perspective is displayed in Section 4. Besides, a real dataset that contains the
survival time since the diagnostic in primary breast cancers patients has been modeled in Section 5.
Section 6 contains a brief discussion about future improvements on the app and the possibilities of
using PHD on Matlab and Python. Conclusions are given in Section 7.
2. Materials and methods
In this Section, the major theoretical concepts related with Phase-type distributions and one cutpoint Phase-type distributions are detailed.
_2.1._ _Phase-type distributions_
As it was stated in the introduction, PHD are defined as the distribution of the lifetime up to the
absorption in an absorbent Markov chain with finite state space. Intuitively, this means that the process
is initially found in some of the states (not necessarily in the first one) in which it stays a certain time
up to jumping towards another state. This process is repeated a number of times up to reaching the
absorbent state in which the process dies.
Formally, a non-negative random variable _X_ is phase-type distributed with representation (?, ?)
if its cumulative distribution function is given by the following expression
?(?) = ?[?≤?] = 1 −?exp(??) ?, ?≥0,
where ? is a column vector of ones with appropriate order, ?= (?1, …, ??) is the vector that
represent the initial distribution of the process with ?? being the probability of being initially in the
state ? and ? is the matrix (sub-generator of order _m_ ) that contains the transition intensities among
the transient states.
From this definition, other interesting functions employed in the field of reliability analysis can
be obtained:
_Mathematical Biosciences and Engineering_ Volume 21, Issue 1, 1508–1526.
<u>1511</u>
- _Density probability function_ _:_
?(?) = ?exp(??)? <sup>0</sup>, ?≥0,
with ? <sup>0</sup> = −?? being the vector that encloses the transition intensities from a transient state
up to the absorbent state. Note that ?(?)??= ?(?+ ??) −?(?) is the probability of the
event occurs in the infinitesimal interval (?, ?+ ??).
- _Survival function (_ also called _reliability function):_
?(?) = 1 −?(?) = ?exp(??) ?, ?≥0.
This measure represents the probability that the system does not fail in the interval (0, ?).
- _Hazard rate:_
?(?) <sup>?(?)</sup> <sup>= ?exp(??)?</sup> ?exp(??) ? <sup>0</sup>
ℎ(?) = ?(?) <sup>?(?)</sup>
<sup>= ?exp(??)?</sup> ?exp(??) ? <sup>0</sup> <sup>, ?≥0.</sup>
This function is the instantaneous rate of failure and its evolution determines the tendency to
the failure in each instant. It is usual that this measure is not decreasing in certain periods of
time, since as time goes by the failure tends to increase.
- _Cumulative hazard rate:_
?(?) = −ln(1 −?(?)) = −ln(?exp(??) ?), ?≥0.
It can also be computed as the integral of hazard rate. Then, if ?(?) evolves in a linear way,
the hazard rate is constant (constant failure rate); if the growth is quicker than linear, the
function is convex and the hazard rate is increasing (increasing failure rate); if the growth
is slower than linear, the function is concave and the hazard rate is decreasing (decreasing
failure rate).
- _Mean and variance:_
E[?] = −?? <sup>−1</sup> ?;
VAR[?] = 2?? <sup>−2</sup> ?−(−?? <sup>−1</sup> ?) <sup>2</sup> .
The real form of all these functions will depend on the structure of the transition intensities matrix,
since PHDs do not have a unique representation. In fact, PHDs characterize a large number of wellknown distributions. Some of these are detailed with the corresponding PHD representation:
1. Exponential distribution:
?(?) = 1 −exp(−??), ?≥0: ?= 1, ?= −? and ?= 1.
2. Erlang distribution: ?(?) = 1 −∑?−1?=0 exp(−??)(??) <sup>?</sup> /?! for ?≥0, ?≥1 and ?> 0,
_Mathematical Biosciences and Engineering_ Volume 21, Issue 1, 1508–1526.
<u>1512</u>
−? ?
−? ⋱
?= (1, …,0); ?= (
⋱ ?
−?
) .
?×?
?
?=1
?≠?
??
??−??
??=0 ∑??=1 ?? exp(−???) (∏??=1 ?? ) for ?≥
??−??
3. Hypo-exponential distribution: ?(?) = 1 −∑??=0 ∑??=1 ?? exp(−???) (∏
0 and ?? ≠?? for ?≠? with ??, ?? - 0,
) .
?×?
?= (1, …,0); ?= (
−?1 ?1
−?2 ⋱
⋱ ??−1
−??
4. Hyper-exponential distribution: ?(?) = 1 −∑??=1 ??(1 −exp(−???)) for ?≥0 and ?? 0,
−?1
?= (?1, …, ??); ?=
−?2
⋱
.
?×?
(
−??)
5. Coxian distribution: for ?? - 0 with ?= 1, …, ? and 0 < ?? ≤1 with ?= 1, …, ?−1,
−?1 ?1?1
?= (1, …,0); ?=
.
(
−?2 ⋱
⋱ ??−1??−1
−?? )?×?
6. Generalized Coxian distribution: for ?? - 0 with ?= 1, …, ? and 0 < ?? ≤1 with ?=
1, …, ?−1,
−?1 ?1?1
?= (?1, …, ??); ?=
.
(
−?2 ⋱
⋱ ??−1??−1
−?? )?×?
The estimation of the parameters is not a simple issue because PHD representation is not unique,
which complicates the problem of optimization. In the field of reliability analysis, it is very common
to employ a graphical analysis when the estimation process of the parameters by maximum likelihood
method presents serious problems of calculus. This parametric graphical technique is based on the
principle of least squares and enables a first graphical idea of the fit [33]. However, this method cannot
be used in the context of PHD, because PHDs cannot be linearized. Consequently, an iterative method
called EM-algorithm must be used to estimate the PHD parameters by maximum likelihood [34, 35].
This algorithm is already implemented in most statistical software. An interesting adaption of this
method was proposed in [36], in which a partial imputation EM-algorithm was developed for time-to
_Mathematical Biosciences and Engineering_ Volume 21, Issue 1, 1508–1526.
<u>1513</u>
event modeling of survival data .
_2.2._ _One cut-point phase-type distributions_
This class of distributions was introduced to improve the quality of the fit and to reduce the
number of parameters to be estimated in comparison with the classical PHD, especially in those
situations where the distribution presents heavy tails or has two modes [31]. The underlying idea is to
determine a suitable cut-point that delimits properly the distribution. Once both zones are defined, two
transition intensities matrices are defined to control the behavior in each interval. Given that the
transition intensities are different in each zone, the internal performance of the states is not the same
over time (non-homogeneous Phase-type distributions).
Formally, a non-negative random variable _Y_ is one cut-point phase-type distributed with
representation (?, ??, ??, ?) if its density probability function adopts the following expression
<sup>?exp (???)??</sup> ? ; ?≤?
?exp (???)exp (??(?−?))??? ; ?> ?
?(?) = { <sup>?exp (???)??</sup> ?
?? ; ?> ? <sup>,</sup>
with ? being the cut-point, ?? and ?? the transition intensities matrix of order ? for each zone
and ? the vector of order ? that contains the probabilities of being initially in any state. Note that
?1 and ?2 can have different internal structures.
In a similar way than the classical PHD, the survival function, the hazard rate, the cumulative
hazard rate as well as the mean and variance can be derived from the definition.
- _Survival function:_
?(?) = {
?exp (???)? ; ?≤?
?exp(???) exp(??(?−?)) ? ; ?> ? <sup>.</sup>
- _Hazard rate:_
ℎ(?) = <sup>?(?)</sup>
?(?) <sup>=</sup>
- _Cumulative hazard rate:_
?
<sup>?exp (???)??</sup> ?
?exp (???)?
; ?≤?
<sup>?exp (???)??</sup>
?exp (???)?
.
{
?exp (???)exp (??(?−?))???
?
; ?> ?
?exp(???) exp(??(?−?)) ?
?(?) = −ln(1 −?(?)) = { <sup>−ln(?exp(???) ?)</sup> ; ?≤?
−ln (?exp(???) exp(??(?−?)) ?) ; ?> ?
- _Mean and variance:_
1−1?+ ?exp(???) (?1
2−1)?;
E[?] = −??1
1−1 −?2
_Mathematical Biosciences and Engineering_ Volume 21, Issue 1, 1508–1526.
<u>1514</u>
1−2?−2?exp(???)[?2
2−1) −?1
1−1(??−?1
1−1)]?;
E[? <sup>2</sup> ] = 2??1
2−1(??−?2
VAR[?] = ?[? <sup>2</sup> ] −(?[?]) <sup>2</sup>
with ? being the identity matrix of appropriate order.
The probability density function and the hazard rate are discontinuous at point ?, but the rest of
functions do present continuity at this point.
Finally, an interesting result associated with this new class of distributions is that the one cutpoint PHD inherits the features of classical PHD. The details about the estimation of parameters can
be checked in [31].
3. Shiny app
The developed Shiny App aims to provide a new tool to use Phase-type distributions in a friendly
environment for those researchers who do not have enough skills of programming and whose area of
interest covers survival and reliability analysis. This open access app is placed at a storage cloud
belonging to the authors. The instructions to access the app are described in the Supplementary
materials.
The Shiny App is composed by four modules at present. Next, these modules are described.
_3.1._ _Module 1: Phase-type distributions (PHD)_
This part contains the definition for a random variable with Phase-type distribution. Furthermore,
the expressions that the transition intensities matrix and the initial distribution vector adopt for different
internal structures appear (i.e. Exponential distribution, Erlang distribution, Coxian distribution, etc.).
Finally, once the distribution is chosen, the user can see how ?(?), ?(?), ℎ(?) and ?(?) change
graphically when the number of states and the values belonging to ? and ? are modified. Figure 1
displays a screenshot of this first module, in which a general distribution with two phases is taken as
an example. Note that “maximum time of domain” represents the X-axis longitude, that is, the period
of observation.
_3.2._ _Module 2: Estimation using Phase-type distributions (PHD)_
This module is aimed at modeling an experimental dataset through PHD. First, the user must load
the file that contains the experimental observations. The app admits files in txt or csv format, while
observations must be registered in a single column with the first row being the header. The second step
would be selecting the estimation method. The following methods are available in the app:
- _Point data_ (recommended): Estimation of the parameters by maximum likelihood from point
and weighted point data.
- _Pooled data:_ Estimation of the parameters by maximum likelihood from grouped and truncated
data [37–39].
- _Density function:_ Estimation of the parameters from a density function defined on the nonnegative half-line. This option calls the estimation of _point data_ after making weighted point
data, which are generated by numerical quadrature.
_Mathematical Biosciences and Engineering_ Volume 21, Issue 1, 1508–1526.
<u>1515</u>
Finally, once the user chooses the number of states, the app obtains the results automatically (see
Figure 2). In particular, the estimation of the parameters for different PHD together with the p-value
related to the Anderson-Darling goodness-of-fit test are shown. In addition, both the experimental
mean and variance and the associated one with each of these distributions are also computed. The
quality of the fitting can be checked graphically by means of the density function, the survival function,
the hazard rate and the cumulative hazard rate.
Figure 1. Window of shiny app for the first module.
Figure 2. Window of shiny app for the second module.
_Mathematical Biosciences and Engineering_ Volume 21, Issue 1, 1508–1526.
<u>1516</u>
_3.3._ _Module 3: One cut-point Phase-type distribution_
The definition and the link for the paper where the one cut-point Phase-type distribution was
introduced can be seen in this node. Just like in the first module, once the internal structure is selected,
the user can see how ?(?), ?(?), ℎ(?) and ?(?) change graphically when the number of states
and the values belonging to tuple (?, ??, ??, ?) are modified (see Figure 3). Note that in the app
current version, ?? and ?? are designed with the same internal structure, although it is not a
necessary condition from a theoretical viewpoint.
Figure 3. Window of shiny app for the third module.
_3.4._ _Module 4: Estimation using the one cut-point Phase-type distribution_
This node aims to model an experimental dataset through one cut-point PHD. The user must only
load the file (in txt or csv format, with the observations registered in a single column with the first row
being the header) and select the number of states and introduce the cut-point value (by default, the
number of state is two and the cut-point value is the mean of the experimental data with two decimals).
Subsequently, the Shiny App obtains the outcomes automatically (see Figure 4). Besides, the fitting
obtained by the one cut-point PHD is compared with the adjustment reached by the classical PHD.
This comparison is made both via goodness-of-fit test and graphically.
To reduce the computational cost in the estimation process, and due to the Erlang distribution,
has shown good behavior in the one cut-point PHD, ?, ?? and ?? have Erlang structure in the app
current version.
_Mathematical Biosciences and Engineering_ Volume 21, Issue 1, 1508–1526.
<u>1517</u>
Figure 4. Window of shiny app for the fourth module.
4. Numerical example with the app
In this Section, a practical example is carried out to improve the description of app and explain
how to obtain the results from users’ perspective. Given that Module 1 and Module 3 aims to introduce
theoretically the classical and one cut-point Phase-type distributions, these modules will not be used
hereinafter. In fact, these distributions have already been defined in Section 2.
_4.1._ _Preparing the dataset_
A dataset with 500 sample points has been simulated from a Weibull distribution with values 3
and 0.5 for shape and scale parameters, respectively. Data has been simulated through the R software,
fixing the seed in 5. As it was reported in Section 3, the file that contains the observations must be
recorded in .txt or .csv format with header and in a single column (see Figure 5). Note that the decimal
separator must be set with points and the header name should be simple and written between quotes.
_4.2._ _Obtaining the results_
Let us suppose that a dataset contains the information about the lifetime of some system. The first
step is to test if some classical PHD can be considered to model the dataset. This analysis is done in
Module 2. Once the file is loaded and the estimation method is selected (here, the best one is the _point_
_data_ method because data are not truncated or grouped), results are obtained automatically for a
transition matrix with two internal states (value defined by default). Although the app shows multiple
measures, users must first pay attention to goodness-of-fit tests and the cumulative hazard rate plot.
Goodness-of-fit tests are useful to check if the corresponding distribution is suitable to model the
_Mathematical Biosciences and Engineering_ Volume 21, Issue 1, 1508–1526.
<u>1518</u>
dataset, while cumulative hazard rate is highly used in reliability and survival analysis because of its
interpretation. Then, the procedure would consist of increasing the number of states up to reach a
good fitting. Table 1 and Figure 6 contains the results by considering different internal phases for
a transition matrix.
Figure 5. Simulated data saved in .txt format with header and in a single column.
Table 1. Results of Anderson-Darling goodness-of-fit test for different number
of states for each distribution considered.
<u>Number of states</u> <u>Distribution</u> <u>Anderson Darling test (p-value)</u>
PH (general structure) <0.00001
4 CF1 (canonical structure) <0.00001
HErlang (Hyper-Erlang structure) <0.00001
PH (general structure) 0.0292
6 CF1 (canonical structure) 0.0292
HErlang (Hyper-Erlang structure) 0.0257
PH (general structure) 0.2044
8 CF1 (canonical structure) 0.1988
<u>HErlang (Hyper-Erlang structure)</u> <u>0.0291</u>
_Mathematical Biosciences and Engineering_ Volume 21, Issue 1, 1508–1526.
<u>1519</u>
Figure 6. Experimental cumulative hazard rate and the corresponding fits. The fit with
four states is in the top panel, with six states in the central panel and eight states in the
bottom panel.
As it was expected, the quality of the fit is better as the number of states increases. In fact, all
distributions are rejected when four internal states are considered but they are accepted for the case of
six phases whether the significance level is established in 0.01 (all p-values are greater than the
significance level). Oppositely, if the significance level is 0.05 (a common choice for statistical tests),
eight phases are required for the case of a distribution with canonical structure or general structure
(distribution with hyper-Erlang structure would need more states to be accepted). However, as it is
reported in the cumulative hazard rate plots, the improvement with eight phases is not significant in
comparison with the fit through six states. Therefore, six internal states is the optimum to avoid
increasing the number of parameters to be estimated in the optimization process unnecessarily.
Next, one cut-point PHD is adjusted in order to overcome the fits obtained in Module 2. This
analysis is carried out in Module 4, in which data must be loaded again. Again, the app shows the
results systematically (by default the cut-point is the mean of experimental data and the number of
internal states for the transition matrices is two). Remember that the fit via one cut-point PHD is
compared with the adjustment reached by a classical PHD with the Erlang structure in this Module.
An advisable practice is to start the analysis fixing the number of states obtained in Module 2, as the
number of phases required in the one cut-point PHD is always less or equal. Once the number of phases
is established, detecting a change trend in the cumulative hazard rate helps to enclose the range of
values for the cut-point (users must follow a trial-and-error policy in the current version of app). In
particular, the cut-point is settled in 0.58 for this numerical example. As it can be seen in Table 2 and
Figure 7, the quality of the fit improves significantly when one cut-point PHD is considered.
_Mathematical Biosciences and Engineering_ Volume 21, Issue 1, 1508–1526.
<u>1520</u>
Table 2. Results of Anderson-Darling goodness-of-fit test for each distribution considered.
<u>Number of states</u> <u>Distribution</u> <u>Anderson Darling test (p-value)</u>
PHD (Erlang structure) 0.0257
6
<u>One cut-point PHD</u> <u>0.2442</u>
Figure 7. Experimental cumulative hazard rate and the corresponding fits.
Finally, several attempts might be done by reducing the number of states with the purpose of
finding a more parsimonious model. However, the value of cut-point may be altered slightly as
consequence of modifying the dimension of transition intensities matrices.
5. Breast cancer dataset
This public dataset contains the information of 2982 primary breast cancer patients whose records
were incorporated in the Rotterdam tumor bank [40]. This dataset can be found in the R package
_survival._ In the current paper, the time elapsed (in days) since the diagnostic up to the death in those
patients who had a recurrence of the illness is analyzed, with a final sample size of 1077.
First, different classical probability distributions such as Lognormal, Weibull or Cauchy, among
others, were considered without success (p-value associated with the Anderson-Darling goodness-offit test is less than 0.05 in all cases). Then, an approach based on PHD is suggested. On the one hand,
a Phase-type distribution with general structure was estimated. After the analysis, the optimum value
is reached for 3 state with the following representation
?= (0,0,1); ?= (
−0.001254913 0 0
0.006190975 −0.007093341 0.0009023664
0 0.001480004 −0.001483781
).
_Mathematical Biosciences and Engineering_ Volume 21, Issue 1, 1508–1526.
<u>1521</u>
On the other hand, a Phase-type distribution with Erlang structure was considered. In this case,
the optimum number of phases is two with ?̂ = 0.00116. Finally, a one cut-point PHD was adjusted,
in which an Erlang structure was also assumed for the transition intensities matrices. In particular, a
one cut-point PHD with the following representation (?, ??, ??, ?) is estimated
?= (1,0); ?1 = ( <sup>−0.00113</sup> 0.00113 0.00175
0 −0.00113 <sup>) ; ?2</sup> <sup>= (−0.00175</sup> 0 −0.00175 <sup>) ; ?= 3250.</sup>
Table 3 contains the goodness-of-fit of each of these distributions. Only the PHD with general
structure and the one cut-point PHD must not be rejected (p-values greater than 0.05). However, the
best option is the one cut-point PHD (see Figure 8 and the Akaike Information Criterion (AIC) value
in Table 3). This choice is supported by the fact that the general PHD does not have a good behavior
in the distribution tail (the fitting is not enough accurate in this region). Consequently, relying on the
general PHD might lead to ignoring information from patients who lived more than ten years
(approximately), as the classical PHD shows a poor fitting around 3600 days.
In particular, a distinct internal behavior in the illness is observed. That is, there is a nonhomogeneity in the performance of the illness before and after the cut-point. In both cases, the illness
goes through two evolutionary internal states, where it stays around 894 days (on average) in the first
phase and approximately 571 days in the second phase. Therefore, the mean time is reduced roughly
35.43% in the second part. This means that the evolution of the illness up to the death is hastened from
3250 days. In conclusion, the model detects two hidden internal states in the behavior of the illness
evolution, and the velocity of change in the illness is accelerated from the cut-point, so that the sojourn
mean time decreases in each state.
Figure 8. Experimental cumulative hazard rate and the corresponding fits.
_Mathematical Biosciences and Engineering_ Volume 21, Issue 1, 1508–1526.
<u>1522</u>
Table 3. Summary for the PH and one cut-point adjustments for dataset.
<u>Distribution</u> <u>Anderson Darling test (p-value)</u> <u>logL</u> <u>AIC value</u>
General PHD 0.3439 -8912.38 17846.75
Erlang PHD 0.02395 -8925.59 17857.17
<u>One cut-point PHD</u> <u>0.1131</u> <u>-8915.34</u> <u>17834.67</u>
6. Discussion
The current app contains a brief introduction, in a theoretical way, where users can graphically
see how the major functions (density function, survival function, etc.) associated with a random
variable phase-type distributed change when its parameters are modified. On the other hand, users can
model the lifetime of any system by adjusting some Phase-type distribution. In this panel, users can
choose multiple estimation methodologies and compare the quality of the fit both via goodness-of-fit
tests and graphically. All these options are extended for the case of one cut-point PHD.
While it is true that this app can already carry out complex statistical analysis, authors aim to
introduce some improvements in the following versions. Some of the most pressing would be including
a module where different classical probability distributions might be adjusted and adding the multiple
cut-points Phase-type distributions [41]. In the background, inserting more options for the transition
intensities matrices of one cut-point PHD or incorporating an estimation method based on moments
(see, for example, [42,43]) would be interesting. Likewise, reducing the computational cost in the
estimation process of parameters is a big challenge for the future as well.
Finally, as complementary material for those readers who are familiarized with multiple
programming environments, some packages available on R, Matlab and Python associated with Phasetype distributions are listed below:
Table 4. Options available on R, Matlab and Python to handle PHD.
<u>R</u> <u>Matlab</u> <u>Python</u>
- Package _mapfit_ - Package _BuTools_ [44]
- Package _PhaseTypeR_ - <sup>1</sup> Github: mochamadnurq/ - Package _pyphase_
- Function _PhaseType_ reliability-basicsystem- - Package _BuTools_
from Package _actuar_ phasetype
- Package _BuTools_ [44]
- <sup>1</sup> Github: mochamadnurq/
reliability-basicsystemphasetype
- Package _pyphase_ [46]
- Package _BuTools_ [44]
1 <u>This folder contains MATLAB scripts related to the results obtained in [45].</u>
7. Conclusions
A new interactive shiny app is presented in the current manuscript to offer the possibility of fitting
Phase-type distributions to an experimental dataset with just some clicks. This open access app has
been developed as an installable and standalone local desktop application, making our shiny app
accessible to users from all technical levels. In particular, the app has been used to model a simulated
dataset and the time to live since the diagnostic in primary breast cancer patients. This app is not only
functional in biomedicine and with other types of cancer but also for any kind of illness, as well as in
other fields such as survival, reliability, engineering and electronics, where the goal is to model the
lifetime of some systems (lifetime of tires, supplied voltage in which a device breaks, sojourn time as
_Mathematical Biosciences and Engineering_ Volume 21, Issue 1, 1508–1526.
<u>1523</u>
unemployed, etc.). As far as we know, it is the first web application available to deal with Phase-type
distributions, so we look forward to its use in any area of science.
Use of AI tools declaration
The authors declare that they have not used Artificial Intelligence (AI) tools in the creation of this article.
Acknowledgments
<mark>Research supported by the project PID2020-113961GB-I00 funded by</mark> MCIN/ AEI
/10.13039/501100011033 <mark>of the Spanish Ministry of Science and Innovation (also supported by the</mark>
<mark>FEDER programme), the "María de Maeztu" Excellence Unit IMAG reference CEX2020-001105-M,</mark>
<mark>funded by MCIN/AEI/10.13039/501100011033/ and by the project FQM-307 of the Government of</mark>
<mark>Andalusia (Spain).</mark>
Conflict of interest
The authors declare that there are no conflicts of interest.
References
1. F. P. Coolen, Parametric probability distributions in reliability, in _Encyclopedia of Quantitative_
_Risk Analysis and Assessment_, John Wiley & Sons: Chichester, (2008), 1255–1260.
2. J. W. McPherson, _Reliability physics and engineering: Time-to-failure modelling_, Springer:
Heidelberg, 2013.
3. <mark>A. D. Hutson, An accelerated life model analog for discrete survival and count data,</mark> _<mark>Comput.</mark>_
_<mark>Meth. Prog. Bio.</mark>_ <mark>,</mark> <mark>210</mark> <mark>(2021), 106337.</mark> [https://doi.org/10.1016/j.cmpb.2021.106337](https://doi.org/10.1016/j.cmpb.2021.106337)
4. <mark>M. C. Aguilera-Morillo, A. M. Aguilera, F. Jiménez-Molinos, J. B. Roldán, Stochastic modeling</mark>
<mark>of random access memories reset transitions,</mark> _<mark>Math. Comput. Simulat.</mark>_ <mark>,</mark> <mark>159</mark> <mark>(2019), 197</mark> - <mark>209.</mark>
[https://doi.org/10.1016/j.matcom.2018.11.016](https://doi.org/10.1016/j.matcom.2018.11.016)
5. R. Kollu, S. R. Rayapudi, S. Narasimham, K. M. Pakkurthi, Mixture probability distribution
functions to model wind speed distributions, _Int._ _J. Energ. Environ. Eng._, 3 (2012), 27.
[https://doi.org/10.1186/2251-6832-3-27](https://doi.org/10.1186/2251-6832-3-27)
6. F. J. Marques, C. A. Coelho, M. de Carvalho, On the distribution of linear combinations of
independent Gumbel random variables, _Stat._ _Comput._, 25 (2015), 683–701.
[https://doi.org/10.1007/s11222-014-9453-5](https://doi.org/10.1007/s11222-014-9453-5)
7. M. F. Neuts, _Probability distributions of phase type_, Liber Amicorum Prof. Emeritus H. Florin,
1975.
8. M. F. Neuts, _Matrix-Geometric Solutions in Stochastic Models: An Algorithmic Approach_, John
Hopkins University Press: Baltimore, 1981.
9. M. Kijima, _Markov processes for stochastic modelling_, Springer: New York, 2013.
10. V. G. Kulkarni, _Modeling and analysis of stochastic systems_, Crc Press, 2016.
11. Q. M. He, _Fundamentals of matrix-analytic methods_, Springer: New York, 2014.
12. S. Asmussen, _Ruin probabilities_, World Scientific, 2000.
_Mathematical Biosciences and Engineering_ Volume 21, Issue 1, 1508–1526.
<u>1524</u>
13. <mark>S. Mahmoodi, S. H. Ranjkesh, Y. Q. Zhao, Condition-based maintenance policies for a multi-unit</mark>
<mark>deteriorating system subject to shocks in a semi-Markov operating environment,</mark> _<mark>Qual. Eng.,</mark>_ <mark>32</mark>
<mark>(2020), 286–297. h</mark> [ttps://doi.org/10.1080/08982112.2020.1731754](https://doi.org/10.1080/08982112.2020.1731754)
14. <mark>E. Pérez, D</mark> . Maldonado, C. Acal, J. E. Ruiz-Castro, A. M. Aguilera, F. Jiménez-Molinos, <mark>et al.,</mark>
<mark>Advanced temperature dependent statistical analysis of forming voltage distributions for three</mark>
<mark>different HfO2-based RRAM technologies,</mark> _<mark>Solid</mark>_ _<mark>State</mark>_ _<mark>Electron.</mark>_ <mark>, 176</mark> <mark>(2021)</mark> <mark>, 107961.</mark>
[https://doi.org/10.1016/j.sse.2021.107961](https://doi.org/10.1016/j.sse.2021.107961)
15. <mark>J. E. Ruiz-Castro, C. Acal, A. M. Aguilera, J. B. Roldán, A complex model via phase-type</mark>
<mark>distributions to study random telegraph noise in resistive memories,</mark> _<mark>Mathematics</mark>_ <mark>,</mark> <mark>9</mark> <mark>(2021), 390.</mark>
[https://doi.org/10.3390/math9040390](https://doi.org/10.3390/math9040390)
16. S. Gordon, A.H. Marshall, M. Zenga, Predicting elderly patient length of stay in hospital and
community care using a series of conditional coxian phase-type distributions, further conditioned
on a survival tree, _Health Care Manag. Sc._, 21 (2018), 269–280. https://doi.org/10.1007/s10729017-9411-9
17. <mark>M. Bladt, A review on phase-type distributions and their use in risk theory,</mark> _<mark>ASTIN Bull. J. IAA</mark>_ <mark>,</mark> <mark>35</mark>
<mark>(2005), 145–161.</mark> https://doi.org/10.1017/s0515036100014100
18. <mark>J. E. Ruiz-Castro, C. Acal, A. M. Aguilera, M. C. Aguilera-Morillo, J. B. Roldán, Linear-phase-</mark>
<mark>type probability modelling of functional PCA with applications to resistive memories,</mark> _<mark>Math.</mark>_
_<mark>Comput. Simulat.</mark>_ <mark>,</mark> <mark>186</mark> <mark>(2021), 71</mark> - <mark>79.</mark> [https://doi.org/10.1016/j.matcom.2020.07.006](https://doi.org/10.1016/j.matcom.2020.07.006)
19. W. Chang, Joe Cheng, J. J. Allaire, C. Sievert, B. Schloerke, Y. H. Xie, et al., R package shiny
[(2022). Available from: https://CRAN.R-project.org/package=shiny](https://cran.r-project.org/package=shiny)
20. [M. G. Genton, S. Castruccio, P. Crippa, S. Dutta, R. Huser, Y. Sun, et al., Visuanimation in](https://onlinelibrary.wiley.com/authored-by/Castruccio/Stefano)
statistics, _Stat_, 4 [(2015), 81–96. https://doi.org/10.1002/sta4.77](https://doi.org/10.1002/sta4.77)
21. J. Wrobel, S. Y. Park, A. M. Staicu, J. Goldsmith, Interactive graphics for functional data analyses,
_Stat_, 5 (2016), 108–118. https://doi.org/10.1002/sta4.109
22. J. P. Fortin, E. Fertig, K. Hansen, shinyMethyl: Interactive quality control of Illumina 450k DNA
methylation arrays in R, _F1000research_, 3 (2014) 175.
https://doi.org/10.12688/f1000research.4680.2
23. <mark>C. Tebé, J. Valls, P. Satorra, A. Tobías, COVID19-world: A shiny application to perform</mark>
<mark>comprehensive country-specific data visualization for SARS-CoV-2 epidemic,</mark> _<mark>BMC Med. Res.</mark>_
_<mark>Methodol.,</mark>_ <mark>20</mark> <mark>(2020), 235.</mark> https://doi.org/10.1186/s12874-020-01121-9
24. <mark>J. Gabry et al., R package</mark> shinystan: Interactive visual and numerical diagnostics and posterior
analysis for Bayesian models, (2015). Available from: https://CRAN.Rproject.org/package=shinystan
25. <mark>N. T. Stevens, L. Lu, Comparing Kaplan-Meier curves with the probability of agreement,</mark> _<mark>Stat.</mark>_
_<mark>Med.,</mark>_ <mark>39</mark> <mark>(2020), 4621</mark> - <mark>4635.</mark> <mark>h</mark> [ttps://doi.org/10.1002/sim.8744](https://doi.org/10.1002/sim.8744)
26. T. C. Wang, Developing a flexible and efficient dual sampling system for food quality and safety
validation, _Food Control,_ 145 [(2023), 109483. https://doi.org/10.1016/j.foodcont.2022.109483](https://doi.org/10.1016/j.foodcont.2022.109483)
27. T. C. Wang, Generalized variable quick-switch sampling as a novel method for improving
sampling efficiency of food products, _Food_ _Control,_ 135 (2022), 108841.
[https://doi.org/10.1016/j.foodcont.2022.108841](https://doi.org/10.1016/j.foodcont.2022.108841)
28. M. H. Shu, T. C. Wang, B. M. Hsu, Integrated green-and-quality inspection schemes for green
product quality with six-sigma yield assurance and risk management, _Qual. Reliab. Eng. Int.,_ 39
[(2023), 2720–2735. https://doi.org/10.1002/qre.3381](https://doi.org/10.1002/qre.3381)
_Mathematical Biosciences and Engineering_ Volume 21, Issue 1, 1508–1526.
<u>1525</u>
29. T. C. Wang, B. M. Hsu, M. H. Shu, Quick-switch inspection scheme based on the overall process
capability index for modern industrial web-based processing environment, _Appl. Stoch. Model._
_Bus.,_ 38 [(2022), 847–861. https://doi.org/10.1002/asmb.2667](https://doi.org/10.1002/asmb.2667)
30. <mark>H. Okamura, T. Dohi, mapfit: An R-based Tool for PH/MAP parameter estimation, in</mark> _<mark>Quantitative</mark>_
_<mark>Evaluation of Systems</mark>_ <mark>, QEST 2015, Lecture Notes in Computer Science (vol. 9259), Springer,</mark>
<mark>(2015), 105–112. h</mark> [ttps://doi.org/10.1007/978-3-319-22264-6_7](https://doi.org/10.1007/978-3-319-22264-6_7)
31. <mark>C. Acal, J. E. Ruiz-Castro, D. Maldonado, J. B. Roldán, One cut-point phase-type distributions in</mark>
<mark>reliability, an application to resistive random access memories,</mark> _<mark>Mathematics</mark>_ <mark>,</mark> <mark>9</mark> <mark>(2021), 2734.</mark>
<mark>[https://doi.org/10.3390/math9212734](https://doi.org/10.3390/math9212734)</mark>
32. N. Belgorodski, M. Greiner, K. Tolksdorf, K. Schueller, R package risk distributions: Fitting
[distributions to given data or known quantiles, R package version, (2017). https://CRAN.R-](https://cran.r-project.org/package=rriskDistributions)
[project.org/package=rriskDistributions](https://cran.r-project.org/package=rriskDistributions)
33. J. F. Lawless, _Statistical models and methods for lifetime data_ (2º ed.), John Wiley & Sons, 2003.
34. S. Asmussen, O. Nerman, M. Olsson, Fitting phase-type distributions via the EM algorithm, _Scand._
_J. Stat._, 23 [(1996), 419–441. http://www.jstor.org/stable/4616418](http://www.jstor.org/stable/4616418)
35. P. Buchholz, J. Kriege, I. Felko, _Input Modeling with Phase-Type Distributions and Markov_
_Models, Theory and Applications_ [, Cham: Springer, 2014. https://doi.org/10.1007/978-3-319-](https://doi.org/10.1007/978-3-319-06674-5)
[06674-5](https://doi.org/10.1007/978-3-319-06674-5)
36. <mark>K. Choi, S. M. Park, S. Han, D. S. Yim, A partial imputation EM-algorithm to adjust the</mark>
<mark>overestimated shape parameter of the Weibull distribution fitted to the clinical time-to-event</mark>
<mark>data,</mark> _<mark>Comput. Meth. Prog. Bio.</mark>_ <mark>,</mark> <mark>197</mark> <mark>(2020), 105697. h</mark> [ttps://doi.org/10.1016/j.cmpb.2020.105697](https://doi.org/10.1016/j.cmpb.2020.105697)
37. A. Thummler, P. Buchholz, M. Telek, A novel approach for phase-type fitting with the EM
algorithm, _IEEE T. Depend. Secure,_ 3 (2006), 245–258.
38. A. Panchenko, A. Thummler, Efficient phase-type fitting with aggregated traffic traces, _Perform._
_Evaluat._, 64 [(2007), 629–645. https://doi.org/10.1016/j.peva.2006.09.002](https://doi.org/10.1016/j.peva.2006.09.002)
39. H. Okamura, T. Dohi, K. S. Trivedi, Improvement of EM algorithm for phase-type distributions
with grouped and truncated data, _Appl. Stoch. Model. Bus._, 29 (2013), 141–156.
[https://doi.org/10.1002/asmb.1919](https://doi.org/10.1002/asmb.1919)
40. <mark>P. Royston, D. G. Altman, External validation of a Cox prognostic model: Principles and</mark>
<mark>methods,</mark> _<mark>BMC Med. Res. Methodol.</mark>_ <mark>,</mark> <mark>13</mark> <mark>(2013), 1–15. h</mark> ttps://doi.org/10.1186/1471-2288-13-33
41. J. E. Ruiz-Castro, C. Acal, J. B. Roldán, An approach to non-homogenous phase-type distributions
through multiple cut-points, _<mark>Qual. Eng.,</mark>_ 35 (2023), 619–638 _._
42. A. Bobbio, A. Horvath, M. Telek, Matching three moments with minimal acyclic phase type
distributions, _Stoch. Models_, 21 [(2005), 303–326. https://doi.org/10.1081/STM-200056210](https://doi.org/10.1081/STM-200056210)
43. T. Osogami, M. Harchol-Balter, Closed form solutions for mapping general distributions to
minimal PH distributions, _Perform._ _Evaluat._, 63 (2006), 524–552.
[https://doi.org/10.1016/j.peva.2005.06.002](https://doi.org/10.1016/j.peva.2005.06.002)
44. <mark>G. Horváth, M. Telek, Markovian performance evaluation with BuTools, in</mark> _<mark>Systems Modeling:</mark>_
_<mark>Methodologies and Tools</mark>_ <mark>, Springer, Cham, 2019. h</mark> [ttps://doi.org/10.1007/978-3-319-92378-9_16](https://doi.org/10.1007/978-3-319-92378-9_16)
45. <mark>A. Alkaff, M. N. Qomarudin, Modeling and analysis of system reliability using phase‐type</mark>
<mark>distribution</mark> <mark>closure</mark> <mark>properties,</mark> _<mark>Appl.</mark>_ _<mark>Stoch.</mark>_ _<mark>Model.</mark>_ _<mark>Bus.</mark>_ <mark>,</mark> <mark>36</mark> <mark>(2020),</mark> <mark>548</mark> - <mark>569.</mark>
[https://doi.org/10.1002/asmb.2509](https://doi.org/10.1002/asmb.2509)
_Mathematical Biosciences and Engineering_ Volume 21, Issue 1, 1508–1526.
<u>1526</u>
46. <mark>M. Langer, Y</mark> . Zhang, D. Figueirinhas, J.-B. Forien, K. Mom, C. Mouton, <mark>et al., PyPhase—A</mark>
<mark>Python package for X-ray phase imaging,</mark> _<mark>J. Synchrotron Radiat.</mark>_ <mark>,</mark> 28 (2021), 1261–1266.
[https://doi.org/10.1107/S1600577521004951](https://doi.org/10.1107/S1600577521004951)
Supplementary
To open the shiny app, the following steps are required:
1. Download the PHD-Desktop-APP.zip hosted at the following URL:
https://www.ugr.es/local/jeloy/PHD-Desktop-App.zip
2. Once the file is downloaded, the zip must be decompressed. Users must run the file called “phd.bat”
in the unzipped folder. After this step, the shiny app will be open in the browser.
©2024 the Author(s), licensee AIMS Press. This is an open access
article distributed under the terms of the Creative Commons
Attribution License (http://creativecommons.org/licenses/by/4.0)
_Mathematical Biosciences and Engineering_ Volume 21, Issue 1, 1508–1526.
섹션 본문
섹션 본문이 없습니다.
참고문헌
참고문헌 정보가 없습니다.