GibbsSteps_kcycle {systemicrisk} | R Documentation |
Gibbs sampling step of a matrix in the ERE model
Description
The sampling is conditional on row and column sums and uses k-cycle steps. Then dimensions of L, lambda and p must match.
Usage
GibbsSteps_kcycle(L, lambda, p, it = 1000L, eps = 1e-10, debug = 0L)
Arguments
L |
Starting matrix - will be modified to contain the results. |
lambda |
Matrix of intensities |
p |
Matrix of probabilities (must be in [0,1]) |
it |
Number of iterations (default=1000) |
eps |
Threshold for values to be interpreted as equal to 0 (default = 1e-10) |
debug |
Should addtional debug information be printed? (0 no output, 1 output debug information) |
Value
no return value
Examples
L <- matrix(c(1,2,3,4,5,6,7,8,9),nrow=3)
diag(L) <- 0
lambda <- matrix(0.5,nrow=3,ncol=3)
p <- matrix(0.7, nrow=3,ncol=3)
diag(p) <- 0
GibbsSteps_kcycle(L=L,lambda=lambda,p=p)
L
L <- matrix(1:16,nrow=4)
diag(L) <- 0
lambda <- matrix(0.5,nrow=4,ncol=4)
p <- matrix(0.25, nrow=4,ncol=4)
diag(p) <- 0
GibbsSteps_kcycle(L=L,lambda=lambda,p=p)
L
[Package systemicrisk version 0.4.3 Index]