stoch-modifiers {comperank} | R Documentation |
Stochastic matrix modifiers
Description
Functions for stochastic matrix modifications.
Usage
teleport(teleport_prob = 0.15)
vote_equal(stoch)
vote_self(stoch)
Arguments
teleport_prob |
Probability of 'teleportation'. |
stoch |
Input stochastic matrix. |
Details
Modification logic behind teleport()
assumes that at each step
of Markov chain (described by column-stochastic matrix) the decision is made
whether to change state according to stochastic matrix or to 'teleport' to
any state with equal probability. Probability of 'teleport' is
teleport_prob
. This modification is useful because it ensures
irreducibility of stochastic matrix (with teleport_prob
in (0; 1)).
Note that in order to obtain modifier one should call function
teleport()
with some parameter.
vote_equal()
and vote_self()
modify columns with elements only equal to
0. The former fills them with 1/nrow(stoch)
and the latter changes only the
respective diagonal element to 1. This is equivalent to jump to any state
with equal probability and to stay in the current state respectively.
Value
teleport()
returns a modifier function.
vote_equal()
and vote_self()
are modifier functions and return modified
version of input stochastic matrix.
Examples
input_stoch <- matrix(c(0, 0.3,
0, 0.7),
ncol = 2, byrow = TRUE)
teleport(0.15)(input_stoch)
vote_equal(input_stoch)
vote_self(input_stoch)