dsmmR-package {dsmmR} | R Documentation |
dsmmR : Estimation and Simulation of Drifting Semi-Markov Models
Description
Performs parametric and non-parametric estimation and simulation of drifting semi-Markov processes. The definition of parametric and non-parametric model specifications is also possible. Furthermore, three different types of drifting semi-Markov models are considered. These models differ in the number of transition matrices and sojourn time distributions used for the computation of a number of semi-Markov kernels, which in turn characterize the drifting semi-Markov kernel.
Details
Introduction
The difference between the Markov models and the semi-Markov models
concerns the modelling of the sojourn time distributions.
The Markov models (in discrete time) are modelled by a sojourn time
following the Geometric distribution. The semi-Markov models
are able to have a sojourn time distribution of arbitrary shape.
The further difference with a drifting semi-Markov model,
is that we have (arbitrary) sojourn time distributions
and
transition matrices (Model 1),
where
is defined as the polynomial degree.
Through them, we compute
semi-Markov kernels.
In this work, we also consider the possibility for obtaining these
semi-Markov kernels with
transition matrices and
sojourn time distribution (Model 2) or
sojourn time
distributions and
transition matrix (Model 3).
Definition
Drifting semi-Markov processes are particular non-homogeneous semi-Markov
chains for which the drifting semi-Markov kernel
is defined as
the probability that, given at the instance
the previous state is
, the next state state
will be
reached with a sojourn time of
:
where is the model size, defined as the length of the
embedded Markov chain
minus the
last state, where
is the state at the instant
and
is the sojourn time of the state
.
The drifting semi-Markov kernel
is a linear combination of the product of
semi-Markov kernels
, where every semi-Markov kernel is the product of
a transition matrix
and a sojourn time distribution
. We define the situation when both
and
are "drifting" between
fixed points of the model
as Model 1, and thus we will use the exponential
as a way to
refer to the drifting semi-Markov kernel
and corresponding
semi-Markov kernels
in this case.
For Model 2, we allow the transition matrix
to drift
but not the sojourn time distributions
, and for Model 3 we allow
the sojourn time distributions
to drift but not the transition
matrix
.
The exponential
or
will be used for signifying
Model 2 or Model 3, respectively.
In the general case an exponential will not be used.
Model 1
Both and
are drifting in this case.
Thus, the drifting semi-Markov kernel
is a
linear combination of the product of
semi-Markov kernels
, which are given by:
where for we have
Markov transition matrices
of the embedded Markov chain
,
and
sojourn time distributions
. Therefore, the drifting semi-Markov kernel
is described as:
where are
polynomials with degree
, which satisfy the conditions:
where the indicator function ,
if
,
otherwise.
Model 2
In this case, is drifting and
is not drifting.
Therefore, the drifting semi-Markov kernel is now described as:
Model 3
In this case, is drifting and
is not drifting.
Therefore, the drifting semi-Markov Kernel is now described as:
Parametric and non-parametric model specifications
In this package, we can define parametric and non-parametric drifting semi-Markov models.
For the parametric case, several discrete distributions are
considered for the modelling of the sojourn times:
Uniform, Geometric, Poisson, Discrete Weibull and Negative Binomial.
This is done from the function
parametric_dsmm
which returns an object of the
S3 class (dsmm_parametric
, dsmm
).
The non-parametric model specification concerns the sojourn
time distributions when no assumptions are done about the
shape of the distributions. This is done through the function called
nonparametric_dsmm()
, that returns an object of class
(dsmm_nonparametric
, dsmm
).
It is also possible to proceed with a parametric or non-parametric
estimation for a model on an existing sequence through the function
fit_dsmm()
, which returns an object with the S3 class
(dsmm_fit_parametric
, dsmm
) or
(dsmm_fit_nonparametric
, dsmm
) respectively, depending
on the given argument estimation = "parametric"
or
estimation = "nonparametric"
.
Therefore, the dsmm
class acts like a wrapper class
for drifting semi-Markov model specifications, while the classes
dsmm_fit_parametric
, dsmm_fit_nonparametric
,
dsmm_parametric
and dsmm_nonparametric
are exclusive to the functions that create the corresponding models,
and inherit methods from the dsmm
class.
In summary, based on an dsmm
object
it is possible to use the following methods:
Simulate a sequence through the function
simulate.dsmm()
.Get the drifting semi-Markov kernel
, for any choice of
or
, through the function
get_kernel()
.
Restrictions
The following restrictions must be satisfied for every drifting semi-Markov model:
The drifting semi-Markov kernel
, for every
and
, has its sums over
and
, equal to
:
Therefore, we also get that for every
and
, the semi-Markov kernel
has its sums over
and
equal to
:
Lastly, like in semi-Markov models, we do not allow sojourn times equal to
or passing into the same state:
Model specification restrictions
When we define a drifting semi-Markov model specification through the
functions parametric_dsmm
or nonparametric_dsmm
,
the following restrictions need to be satisfied.
Model 1
The semi-Markov kernels are equal to
. Therefore,
the sums
of
over
and the sums of
over
must be
equal to 1:
Model 2
The semi-Markov kernels are equal to . Therefore,
the sums of
over
and
the sums of
over
must be equal to 1:
Model 3
The semi-Markov kernels are equal to . Therefore,
the sums
of
over
and the sums of
over
must be
equal to 1:
Community Guidelines
For third parties wishing to contribute to the software, or to report issues or problems about the software, they can do so directly through the development github page of the package.
Notes
Automated tests are in place in order to aid the user with any false input made
and, furthermore, to ensure that the functions used return the expected output.
Moreover, through strict automated tests, it is made possible for the user to
properly define their own dsmm
objects and make use of them with the generic
functions of the package.
Author(s)
Maintainer: Ioannis Mavrogiannis mavrogiannis.ioa@gmail.com
Authors:
Vlad Stefan Barbu
Ioannis Mavrogiannis
Nicolas Vergne
References
Barbu, V. S., Limnios, N. (2008). Semi-Markov Chains and Hidden Semi-Markov Models Toward Applications - Their Use in Reliability and DNA Analysis. New York: Lecture Notes in Statistics, vol. 191, Springer.
Vergne, N. (2008). Drifting Markov models with Polynomial Drift and Applications to DNA Sequences. Statistical Applications in Genetics Molecular Biology 7 (1).
Barbu V. S., Vergne, N. (2019). Reliability and survival analysis for drifting Markov models: modelling and estimation. Methodology and Computing in Applied Probability, 21(4), 1407-1429.
T. Nakagawa and S. Osaki. (1975). The discrete Weibull distribution. IEEE Transactions on Reliability, R-24, 300-301.
Sanger, F., Coulson, A. R., Hong, G. F., Hill, D. F., & Petersen, G. B.
(1982). Nucleotide sequence of bacteriophage DNA.
Journal of molecular biology, 162(4), 729-773.
See Also
For the estimation of a drifting semi-Markov model given a sequence: fit_dsmm.
For drifting semi-Markov model specifications: parametric_dsmm, nonparametric_dsmm.
For the simulation of sequences: simulate.dsmm, create_sequence.
For the retrieval of the drifting semi-Markov kernel through a
dsmm
object: get_kernel.