Learn R Programming

MPkn (version 0.1.0)

MPkn-package: Calculations of One Discrete Model in Several Time Steps

Description

A matrix discrete model having the form M[i+1] = (I + Q)*M[i]. The calculation of the values of M[i] only for pre-selected values of i. The method of calculation is presented in the vignette 'Fundament' ('Base'). Maybe it`s own idea of the author of the package. A weakness is that the method gives information only in selected steps of the process. It mainly refers to cases with matrices that are not Markov chain. If Q is markov transition matrix, then MUPkL may be used to calculate the steady-state distribution p for \(p = Q*p\). See example bottom. Matrix power of non integer (matrix.powerni) gives the same results as a mpower from package matlib.

Arguments

Details

Package: MPkn
Type: Package
Version: 0.1.0
Date: 2018-05-03
License: GPL (>= 3)

References

Ton van den Boom, "Discrete-time systems analysis" (2006), Additional Lecture Notes for the course SC4090, www.dcsc.tudelft.nl/~sc4060/transp/discreteNOTES.pdf Richard Weber, "Markov Chains" (2011), http://www.statslab.cam.ac.uk/~rrw1/markov/M.pdf "Examples of Markov chains", https://en.wikipedia.org/wiki/Examples_of_Markov_chains "Markov chains", https://en.wikipedia.org/wiki/Markov_chain#Expected_number_of_visits Donald R. Burleson, Ph.D. "ON NON-INTEGER POWERS OF A SQUARE MATRIX", (2005), http://www.blackmesapress.com/Eigenvalues.htm

Examples

Run this code
# NOT RUN {
require(MPkn)
require(markovchain)
options(digits = 14)
n = 12
k = 2
rz = 11
P = array(0, c(rz, rz))
for (i in 1:rz){
  po = runif(rz)
  P[i, ] = po/sum(po)
}
I = diag(1, rz, rz)
Myy = MUPkL(P, P, I, n, k, c(1:rz))
StSy = NULL
for (i in 1:rz) StSy = c(StSy, Myy$Navg[,,i][n])
mrkv = new("markovchain", transitionMatrix = P)
StSx = steadyStates(mrkv)
print("MPkn");  print(StSy)
print("markovchain"); print(StSx)

# }

Run the code above in your browser using DataLab