MUPkLo: Calculations of one discrete model in several time steps

Description Usage Arguments Details Value Author(s) Examples

Description

M[i + 1] = (I + Q) * M[i] process in several selected steps.
Q = P * U, matrix multiplication.
The calculation is performed in steps determined by integer
vectors k and n. The sections defined by integers
k and n are applied as follows:

k[i] == 1 ... M[n] = sum(i=0,n-1)(Q^i)*A , for n = 0, 1, 2, ...
k[i] == 0 ... M[2n] = (I + Q^n)*M[n] , for n = r*2^i, i=1,2,3,..

where r is the last step before section with k[i] == 0

Usage

1
MUPkLo(A, P, U, n, k, sta)

Arguments

A

an initial square matrix a process at time 0

P

a basic transition matrix chain

U

a correction matrix chain

n

An integer vector cumulative number of individual process steps.
n[1] > 0, n[i] > n[i-1].

k

A vector of 0 and 1 identifying the mode of calculation in the stretch step.
k[i] = 1 for rn[j] = rn[j-1]+1,
k[i] = 0 for rn[j] = 2*rn[j-1],
where rn[j] is the j-th row name of the output value matrix.

sta

Vector of indices of the columns of the matrix M. The matrix M contains the cumulative number of inputs mij from the state of the i to the state j.

Details

Relationship between k and n:
length(k) == lentgh(n).
It is recommended to determine the value of well vectors n and k.

Value

An array (r x slp x sta) where

r r = n[length(n)]
slp Vector of column indices of the matrix P
sta Vector of column indices of the matrix M

Row of the output matrix (array) is the column in the matrix M and whose number is specified in the sta. The matrix M contains the cumulative number of inputs mij from the state of the i to the state j.

Author(s)

Josef Brejcha

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
A = array(c(-2, -3, 1, 4, -2, 1, 3, -1, -2), c(3, 3))
P <- array(c(0.9, 0.6, 0.8, 0.05, 0.2, 0.05, 0.05, 0.2, 0.15), c(3, 3))
U <- array(c(0.8, 0.8, 0.7, 0.06, 0.02, 0.2, 0.14, 0.18, 0.1), c(3, 3))
sta <- 3
Ao <- A
k <- c(1, 0, 1, 0)
n <- c(5, 7, 12, 17)
# Steps, in which will compute the value of the Mx:
# 1, 2, 3, 4, 5, 10, 20, 21,  22, 23, 24, 25, 50, 100, 200, 400, 800
Mx <- MUPkLo(A, P, U, n, k, sta)
print(Mx)
A <- Ao
Mb <- MUPkLo(A, P, U, n = 100, k = 1, sta)
Mb[100,,]

MPkn documentation built on May 2, 2019, 2:36 a.m.