Type: | Package |
Title: | Modeling and Analysis of Stochastic Systems |
Version: | 0.1.4 |
Author: | Carlos Alberto Cardozo Delgado |
Maintainer: | Carlos Alberto Cardozo Delgado <cardozorpackages@gmail.com> |
Description: | Compute important quantities when we consider stochastic systems that are observed continuously. Such as, Cost model, Limiting distribution, Transition matrix, Transition distribution and Occupancy matrix. The methods are described, for example, Ross S. (2014), Introduction to Probability Models. Eleven Edition. Academic Press. |
License: | GPL-3 |
Encoding: | UTF-8 |
NeedsCompilation: | yes |
RoxygenNote: | 7.1.2 |
Suggests: | testthat |
Imports: | methods, markovchain, Rcpp |
LinkingTo: | Rcpp |
Packaged: | 2022-05-31 00:49:11 UTC; CARLOS |
Repository: | CRAN |
Date/Publication: | 2022-05-31 22:50:04 UTC |
Tool to computate the Expected Total Cost vector for a Continuous Time Markov Chain, CTMC.
Description
ETCt
is used to obtain the Expected Total Cost vector up to t of a homogeneous continuous time Markov chain.
Usage
ETCt(R, c, t, epsilon = 0.001)
Arguments
R |
numeric, represents the rate matrix of a CTMC. |
c |
vector, represents the costs of the states of a CTMC. |
t |
numeric, represents the length of time. |
epsilon |
numeric, represents the error bound of the approximation of M(t). Default value is 0.001. |
Author(s)
Carlos Alberto Cardozo Delgado <cardozorpackages@gmail.com>.
References
Ross, S, Introduction to Probability Models, Eleven Edition. Academic Press, 2014.
Kulkarni V, Introduction to modeling and analysis of stochastic systems. Second Edition. Springer-Verlag, 2011.
Examples
library(modesto)
# A four states CTMC example
R <- matrix(c(0,1,0,0,0, 1/72,0,1,0,0, 0,2/72,0,1,0, 0,0,3/72,0,1/2, 0,0,0,4/72,0),5,5,byrow=TRUE)
ETCt(R,c(-80,-15,50,125,200),t=24,epsilon=0.001)
Tool to computate the Long-Run Cost Rate for a Continuous Time Markov Chain, CTMC.
Description
LRC
is used to obtain the Long-Run Cost Rate of a homogeneous continuous time Markov chain.
Usage
LRC(X, costs)
Arguments
X |
matrix, represents the rate matrix of a CTMC. |
costs |
vector, represents the costs of the states of a CTMC. |
Author(s)
Carlos Alberto Cardozo Delgado <cardozorpackages@gmail.com>.
References
Ross, S, Introduction to Probability Models, Eleven Edition. Academic Press, 2014.
Kulkarni V, Introduction to modeling and analysis of stochastic systems. Second Edition. Springer-Verlag, 2011.
Examples
## Not run: library(modesto)
# A five states CTMC example
R <- matrix(c(0,1,0,0,0, 1/72,0,1,0,0, 0,2/72,0,1,0, 0,0,3/72,0,1/2, 0,0,0,4/72,0),5,5,byrow=TRUE)
LRC(X=R,costs=c(-80,-15,50,125,200))
## End(Not run)
Tool to computate the limiting distribution for a Continuous Time Markov Chain, CTMC.
Description
LimDist
is used to obtain the limiting distribution of a homogeneous continuous time Markov chain.
Usage
LimDist(X, rate, epsilon = 0.01, iter)
Arguments
X |
matrix, represents a rate matrix of a CTMC or the transition probability matrix of the DTMC associated to the CTMC. |
rate |
boolean, if rate is equal to TRUE then the argument X represents the rate matrix of the CTMC. If rate is equal to FALSE then the argument X represents the probability transition matrix of the CTMC. |
epsilon |
numeric, represents the error of approximation. |
iter |
integer, represents the maximum of iterations. |
Author(s)
Carlos Alberto Cardozo Delgado <cardozorpackages@gmail.com>.
References
Ross, S, Introduction to Probability Models, Eleven Edition. Academic Press, 2014.
Kulkarni V, Introduction to modeling and analysis of stochastic systems. Second Edition. Springer-Verlag, 2011.
Tool to computate the Occupancy Matrix for a Continuous Time Markov Chain, CTMC.
Description
Mt
is used to obtain the Occupancy matrix of a homogeneous continuous time Markov chain for a period of time [0,t].
Usage
Mt(R, t, epsilon = 0.001)
Arguments
R |
numeric, represents the rate matrix of a CTMC. |
t |
numeric, represents the length of time. |
epsilon |
numeric, represents the error bound of the approximation of M(t). Default value is 0.001. |
Author(s)
Carlos Alberto Cardozo Delgado <cardozorpackages@gmail.com>.
References
Ross, S, Introduction to Probability Models, Eleven Edition. Academic Press, 2014.
Kulkarni V, Introduction to modeling and analysis of stochastic systems. Second Edition. Springer-Verlag, 2011.
Examples
library(modesto)
# A five states CTMC example
R <- matrix(c(0,1,0,0,0, 1/72,0,1,0,0, 0,2/72,0,1,0, 0,0,3/72,0,1/2, 0,0,0,4/72,0),5,5,byrow=TRUE)
Mt(R,t=24,epsilon=0.005)
Tool to computate the transient probability distribution for a Continuous Time Markov Chain, CTMC.
Description
Pt
is used to obtain the transient probability distribution of a homogeneous continuous time Markov chain at a point of time t.
Usage
PXt(X0, R, t, epsilon = 0.001)
Arguments
X0 |
numeric vector, represents the probability distribution of the initial state. |
R |
numeric, represents the rate matrix of a CTMC. |
t |
numeric, represents the length of time. |
epsilon |
numeric, represents the error bound of the approximation of P(t). Default values is 0.001. |
Author(s)
Carlos Alberto Cardozo Delgado <cardozorpackages@gmail.com>.
References
Ross, S, Introduction to Probability Models, Eleven Edition. Academic Press, 2014.
Kulkarni V, Introduction to modeling and analysis of stochastic systems. Second Edition. Springer-Verlag, 2011.
Examples
library(modesto)
# A three states CTMC example
R <- matrix(c(0,2,0,3,0,1,0,6,0),3,3,byrow=TRUE)
X0 <- c(1,0,0)
PXt(X0,R,t=0.5,epsilon=0.005)
X0 <- c(0,0,1)
PXt(X0,R,t=0.5,epsilon=0.005)
Tool to computate the transition matrix for a Continuous Time Markov Chain, CTMC.
Description
Pt2
is used to obtain the transition matrix of a homogeneous continuous time Markov chain for a period of time of t.
Usage
Pt2(R, t, epsilon = 0.001)
Arguments
R |
numeric, represents the rate matrix of a CTMC. |
t |
numeric, represents the length of time. |
epsilon |
numeric, represents the error bound of the approximation of P(t). Default values is 0.001. |
Author(s)
Carlos Alberto Cardozo Delgado <cardozorpackages@gmail.com>.
References
Ross, S, Introduction to Probability Models, Eleven Edition. Academic Press, 2014.
Kulkarni V, Introduction to modeling and analysis of stochastic systems. Second Edition. Springer-Verlag, 2011.
Examples
library(modesto)
# A two states CTMC example
Pt2(matrix(c(0,2,3,0),2,2,byrow=TRUE),t=0.7,epsilon=0.005)
# A four states CTMC example
R <- matrix(c(0,2,3,0,4,0,2,0,0,2,0,2,1,0,3,0),4,4,byrow=TRUE)
Pt2(R,t=0.7,epsilon=0.005)
# require(microbenchmark)
# microbenchmark(Pt(R,t=0.7,epsilon=0.005),Pt2(R,t=0.7,epsilon=0.005),times=1000L)
summary.modesto
Description
summary.modesto displays the summary of calculated quantities from an object of class 'modesto'.
Usage
## S3 method for class 'modesto'
summary(object, ...)
Arguments
object |
an object of the class 'modesto'. This object is returned from the call to LimDist() function. |
... |
other arguments. |
Examples
# A two states CTMC example
model <-LimDist(matrix(c(0,2,3,0),2,2,byrow=TRUE),rate=TRUE,epsilon=0.005)
summary(model)