Changes in PageRank
The PageRank formula \(\vec{PR}=\alpha \cdot A \cdot \vec{PR} + (1-\alpha)\cdot \vec{e}\) can be solved for \(\vec{PR}\) iteratively. In each iteration, the current value of \(\vec{PR}\) is used to compute a new value that is closer to the true value. This means that the difference between the \(\vec{PR}s\) of every two subsequent iterations becomes smaller and smaller until \(\vec{PR}\) converges to the true value and the difference becomes (almost) zero. In this exercise, you will inspect the PageRank algorithm and how it converges.
Este exercício faz parte do curso
Predictive Analytics using Networked Data in R
Instruções do exercício
- Compute one iteration with the PageRank algorithm using
page.rank()
withnetwork
and indicatingniter=1
. Extract the vector attribute and assign the result toiter1
. - Repeat the last step with
niter=2
. Assign the result toiter2
. - Compute the sum of the absolute difference between the vectors
iter1
anditer2
. - We have computed
iter9
anditer10
in the same way asiter1
anditer2
. Is the difference between these two iterations less than between iterations 1 and 2.
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
# Compute one iteration of PageRank
iter1 <- page.rank(___, algo = 'power', options = list(niter = ___))$vector
# Compute two iterations of PageRank
iter2 <- ___(___, algo = 'power', options = list(niter = ___))$vector
# Inspect the change between one and two iterations
sum(abs(___ - ___))
# Inspect the change between nine and ten iterations
sum(___(___ - ___))