View source: R/matrixConvolution.R
| matrixConvolution | R Documentation |
Computes the discrete-time convolution product A * B of
two matrix-valued functions A and B defined on
\mathbb{N} (Barbu and Limnios, 2008, Definition 3.5, p. 48):
(A * B)(k) = \sum_{l = 0}^{k} A(k - l)\, B(l), \quad k \in \mathbb{N},
where A(k - l) B(l) is the usual matrix product.
matrixConvolution(a, b)
a |
A numeric array of dimension |
b |
A numeric array of dimension |
Notation (see smmR-package for the complete description of the
models): s = \textrm{card}(E) is the number of states, and
a matrix-valued function on \{0, \dots, k\} is an array of
dimension (s, s, k + 1) whose slice l + 1 is its value at time
l.
The slice l + 1 of a (or b) is the matrix A(l) (or
B(l)), for l = 0, \dots, k. This is the format of the kernel
returned by get.kernel and of the outputs of get.H, get.psi and
get.P.
The matrix convolution product is associative but not commutative. Its
neutral element is \delta I, i.e. the identity matrix at
time 0 and the null matrix at times k > 0 (Lemma 3.1, p. 48). The
n-fold convolution of the semi-Markov kernel, q^{(n)}
(Definition 3.6, p. 48), is obtained by applying this function
n - 1 times (see get.psi).
A numeric array of dimension (s, s, k + 1) whose slice
l + 1 is the matrix (A * B)(l), for
l = 0, \dots, k.
V. S. Barbu, N. Limnios. (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.
convolution, get.kernel, get.psi, get.P
states <- c("a", "b", "c")
ptrans <- matrix(c(0, 0.6, 0.4,
0.5, 0, 0.5,
0.7, 0.3, 0), nrow = 3, byrow = TRUE)
param <- matrix(c(0.3, 2, 0.6,
NA, NA, 0.8), nrow = 3)
x <- smmparametric(states = states, init = c(1/3, 1/3, 1/3),
ptrans = ptrans, type.sojourn = "fi",
distr = c("geom", "pois", "dweibull"), param = param)
q <- get.kernel(x, k = 10)
q2 <- matrixConvolution(q, q) # q^(2): two jumps
q2[, , 4] # probabilities of two jumps at time 3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.