|
21 | 21 | #' Graph diffusion using a Markov random walk |
22 | 22 | #' |
23 | 23 | #' @description |
24 | | -#' A Markov Random Walk takes an inital distribution \code{p0} |
| 24 | +#' A Markov Random Walk takes an inital distribution \eqn{p_0} |
25 | 25 | #' and calculates the stationary distribution of that. |
26 | | -#' The diffusion process is regulated by a restart probability \code{r} which |
| 26 | +#' The diffusion process is regulated by a restart probability \eqn{r} which |
27 | 27 | #' controls how often the MRW jumps back to the initial values. |
28 | 28 | #' |
29 | | -#' @param p0 an \code{n x p}-dimensional numeric non-negative vector/matrix |
| 29 | +#' @param p0 an \eqn{n \times p}-dimensional numeric non-negative vector/matrix |
30 | 30 | #' representing the starting distribution of the Markov chain |
31 | 31 | #' (does not need to sum to one). |
32 | 32 | #' |
33 | | -#' @param graph an (\code{n x n})-dimensional numeric non-negative adjacence |
| 33 | +#' @param graph an \eqn{n \times p}-dimensional numeric non-negative adjacence |
34 | 34 | #' \code{\link[base]{matrix}} (or |
35 | 35 | #' \code{\link[Matrix:dgCMatrix-class]{dgCMatrix}}) representing the graph |
36 | 36 | #' |
37 | | -#' @param r a scalar between (0, 1). restart probability if a Markov random |
38 | | -#' walk with restart is desired |
| 37 | +#' @param r a scalar between \eqn{(0, 1)}. restart probability if a Markov |
| 38 | +#' random walk with restart is desired |
39 | 39 | #' |
40 | 40 | #' @param thresh threshold for breaking the iterative computation of the |
41 | 41 | #' stationary distribution. If the absolute difference of the distribution at |
|
53 | 53 | #' @param correct.for.hubs if \code{TRUE} multiplies a correction factor to the |
54 | 54 | #' nodes, such that the random walk gets not biased to nodes with high |
55 | 55 | #' degree. In that case the original input matrix will be normalized as: |
56 | | -#' \deqn{ P(j | i) = 1 /degree(i) * min(1, degree(j)/degree(j))} |
| 56 | +#' \deqn{ P(j | i) = \dfrac{1}{\text{degree}(i)} \times |
| 57 | +#' \min \left(1, \dfrac{\text{degree}(j)}{\text{degree}(i)}\right)} |
57 | 58 | #' \emph{Note that this will not consider edge weights.} |
58 | 59 | #' |
59 | 60 | #' @param allow.ergodic Allow multiple components in a graph. |
|
62 | 63 | #' |
63 | 64 | #' @return returns a list with the following elements |
64 | 65 | #' \itemize{ |
65 | | -#' \item p.inf the stationary distribution as numeric vector |
66 | | -#' \item transition.matrix the column normalized transition matrix used for |
67 | | -#' the random walk |
| 66 | +#' \item \code{p.inf} the stationary distribution as numeric vector |
| 67 | +#' \item \code{transition.matrix} the column normalized transition matrix used |
| 68 | +#' for the random walk |
68 | 69 | #' } |
69 | 70 | #' |
70 | 71 | #' @references |
|
0 commit comments