pageRank: PageRank of a Network Matrix

View source: R/PageRank.R

pageRankR Documentation

PageRank of a Network Matrix

Description

Calculates the PageRank for a network matrix.

Usage

pageRank(A, alpha = 0.85, epsilon = 1e-08, pr0, v)

Arguments

A

network adjacency matrix

alpha

scaling parameter in PageRank model. It must be numeric between 0 and 1 inclusive. Default = 0.85.

epsilon

convergence tolerance. Default = 1e-8.

pr0

starting vector at iteration 0 (a row vector). Usually set to rep(1/n,n).

v

personalization vector. sum(v) = 1.

Details

This function uses the power method to calculate the PageRank of a network matrix [1].

Value

Numeric vector with nodes' PageRank

References

[1] Langville AN, Meyer CD (2006). "Google's PageRank and Beyond: The Science of Search Engine Rankings." Princeton University Press, Princeton.

Examples

# Generate an arbitrary 100 by 100 adjacency matrix with zeros and ones
# Remove loops
A <- matrix(rbinom(100 * 100, 1, 0.2), ncol = 100, nrow = 100)
diag(A) <- 0

# Calculates PageRank
pageRank(A)

leb-fmvz-usp/epinemo documentation built on Nov. 27, 2022, 10:58 p.m.