08-Jan-2022 08:45:49 pagerank_test(): MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Test pagerank(). Test 1 5 node MacCormick example with a cycle A = 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 T = 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 google_rank: Given an NxN incidence matrix A, compute the Google matrix G, Then start with a vector of N values 1/N, and repeatedly compute x <= G*x After many steps, compare last three iterates. If they are close, we are probably at an eigenvector associated with the eigenvalue 1. x, G*x, G*G*x 1: 0.332167 0.332167 0.332167 2: 0.312342 0.312342 0.312342 3: 0.03 0.03 0.03 4: 0.03 0.03 0.03 5: 0.295491 0.295491 0.295491 power_rank: Given an NxN incidence matrix A, compute the transition matrix T, Then start with a vector of N values 1/N, and repeatedly compute x <= T*x After many steps, compare last three iterates. If they are close, we are probably at an eigenvector associated with the eigenvalue 1. x, T*x, T*T*x 1: 0.6 0.2 0.2 2: 0.2 0.6 0.2 3: 0 0 0 4: 0 0 0 5: 0.2 0.2 0.6 surf_rank: Given an NxN incidence matrix A, compute the Google matrix T, and then repeatedly visit nodes, keeping track of how often you visited. 15 per cent of the time, simply take a random jump to a node. The rest of the time, follow a random link from the current node. When done, the node weight is the number of visits normalized by the total number of visits. Node weights: 1: 0.332 2: 0.31304 3: 0.0296 4: 0.03002 5: 0.29534 Test 2 16 node MacCormick example A = Columns 1 through 13 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 Columns 14 through 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 T = Columns 1 through 7 0 0 0 0 0 0 0 0.3333 0 0 0 0 0 0 0.3333 0 0 0 0 0 0 0 1.0000 0.5000 0 0 0 0 0 0 0.5000 1.0000 0 0.5000 0 0.3333 0 0 0 0 0 0 0 0 0 0 0.5000 0.5000 0 0 0 0 0 0.5000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.0000 0 0 0 0 0 0 0 Columns 8 through 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3333 0 0.2000 0 0 0 0 0 0 0 0 0 0 0 0.3333 0 0 0 0 0 0 0.3333 1.0000 0 0 0 0 0 0 0 0.2000 0 0 0 0 0 0 0.2000 0 0 0 0 0 0 0.2000 0 0 0 0 0 0 0.2000 0 0 0 0 0 0 0 1.0000 1.0000 1.0000 1.0000 0 0 0 0 0 0 0 Columns 15 through 16 0 1.0000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.0000 0 google_rank: Given an NxN incidence matrix A, compute the Google matrix G, Then start with a vector of N values 1/N, and repeatedly compute x <= G*x After many steps, compare last three iterates. If they are close, we are probably at an eigenvector associated with the eigenvalue 1. x, G*x, G*G*x 1: 0.124641 0.124641 0.124641 2: 0.0446898 0.0446898 0.0446898 3: 0.0446898 0.0446898 0.0446898 4: 0.0663545 0.0663545 0.0663545 5: 0.103763 0.103763 0.103763 6: 0.0446898 0.0446898 0.0446898 7: 0.0953317 0.0953317 0.0953317 8: 0.0534741 0.0534741 0.0534741 9: 0.024526 0.024526 0.024526 10: 0.0453731 0.0453731 0.0453731 11: 0.0170884 0.0170884 0.0170884 12: 0.0170884 0.0170884 0.0170884 13: 0.0170884 0.0170884 0.0170884 14: 0.0170884 0.0170884 0.0170884 15: 0.148508 0.148508 0.148508 16: 0.135606 0.135606 0.135606 power_rank: Given an NxN incidence matrix A, compute the transition matrix T, Then start with a vector of N values 1/N, and repeatedly compute x <= T*x After many steps, compare last three iterates. If they are close, we are probably at an eigenvector associated with the eigenvalue 1. x, T*x, T*T*x 1: 0.139535 0.139535 0.139535 2: 0.0465117 0.0465117 0.0465117 3: 0.0465117 0.0465117 0.0465117 4: 0.0697674 0.0697675 0.0697675 5: 0.116279 0.116279 0.116279 6: 0.0465117 0.0465117 0.0465117 7: 0.108527 0.108527 0.108527 8: 0.0581394 0.0581395 0.0581396 9: 0.0193798 0.0193798 0.0193798 10: 0.0387597 0.0387596 0.0387596 11: 0.00775194 0.00775193 0.00775193 12: 0.00775194 0.00775193 0.00775193 13: 0.00775194 0.00775193 0.00775193 14: 0.00775194 0.00775193 0.00775193 15: 0.139535 0.139535 0.139535 16: 0.139535 0.139535 0.139535 surf_rank: Given an NxN incidence matrix A, compute the Google matrix T, and then repeatedly visit nodes, keeping track of how often you visited. 15 per cent of the time, simply take a random jump to a node. The rest of the time, follow a random link from the current node. When done, the node weight is the number of visits normalized by the total number of visits. Node weights: 1: 0.12546 2: 0.04586 3: 0.04415 4: 0.06703 5: 0.10313 6: 0.04488 7: 0.09547 8: 0.05282 9: 0.0239 10: 0.0447 11: 0.01736 12: 0.01681 13: 0.01612 14: 0.01712 15: 0.14856 16: 0.13663 Test 3 6 node Moler example A = 0 1 0 0 0 1 0 0 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 T = 0 0 0 1.0000 0 1.0000 0.5000 0 0 0 0 0 0 0.5000 0 0 0 0 0 0.5000 0.3333 0 0 0 0 0 0.3333 0 1.0000 0 0.5000 0 0.3333 0 0 0 google_rank: Given an NxN incidence matrix A, compute the Google matrix G, Then start with a vector of N values 1/N, and repeatedly compute x <= G*x After many steps, compare last three iterates. If they are close, we are probably at an eigenvector associated with the eigenvalue 1. x, G*x, G*G*x 1: 0.235275 0.235275 0.235275 2: 0.124992 0.124992 0.124992 3: 0.0781215 0.0781215 0.0781215 4: 0.100256 0.100256 0.100256 5: 0.31423 0.31423 0.31423 6: 0.147126 0.147126 0.147126 power_rank: Given an NxN incidence matrix A, compute the transition matrix T, Then start with a vector of N values 1/N, and repeatedly compute x <= T*x After many steps, compare last three iterates. If they are close, we are probably at an eigenvector associated with the eigenvalue 1. x, T*x, T*T*x 1: 0.0109619 0.0106074 0.0102642 2: 0.00566419 0.00548097 0.00530368 3: 0.00292677 0.0028321 0.00274049 4: 0.00393497 0.00380768 0.00368452 5: 0.96984 0.970815 0.971759 6: 0.00667239 0.00645656 0.00624771 surf_rank: Given an NxN incidence matrix A, compute the Google matrix T, and then repeatedly visit nodes, keeping track of how often you visited. 15 per cent of the time, simply take a random jump to a node. The rest of the time, follow a random link from the current node. When done, the node weight is the number of visits normalized by the total number of visits. Node weights: 1: 0.23605 2: 0.12451 3: 0.0771 4: 0.10052 5: 0.31441 6: 0.14741 Test 4 6 node example A = 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 T = 0 0 0.5000 1.0000 0 0 1.0000 0 0 0 0.5000 0 0 0.5000 0 0 0 0 0 0 0.5000 0 0 1.0000 0 0.5000 0 0 0 0 0 0 0 0 0.5000 0 google_rank: Given an NxN incidence matrix A, compute the Google matrix G, Then start with a vector of N values 1/N, and repeatedly compute x <= G*x After many steps, compare last three iterates. If they are close, we are probably at an eigenvector associated with the eigenvalue 1. x, G*x, G*G*x 1: 0.215933 0.215933 0.215933 2: 0.267482 0.267482 0.267482 3: 0.13868 0.13868 0.13868 4: 0.155287 0.155287 0.155287 5: 0.13868 0.13868 0.13868 6: 0.0839389 0.0839389 0.0839389 power_rank: Given an NxN incidence matrix A, compute the transition matrix T, Then start with a vector of N values 1/N, and repeatedly compute x <= T*x After many steps, compare last three iterates. If they are close, we are probably at an eigenvector associated with the eigenvalue 1. x, T*x, T*T*x 1: 0.214286 0.214286 0.214286 2: 0.285714 0.285714 0.285714 3: 0.142857 0.142857 0.142857 4: 0.142857 0.142857 0.142857 5: 0.142857 0.142857 0.142857 6: 0.0714286 0.0714286 0.0714286 surf_rank: Given an NxN incidence matrix A, compute the Google matrix T, and then repeatedly visit nodes, keeping track of how often you visited. 15 per cent of the time, simply take a random jump to a node. The rest of the time, follow a random link from the current node. When done, the node weight is the number of visits normalized by the total number of visits. Node weights: 1: 0.21544 2: 0.26744 3: 0.13887 4: 0.1547 5: 0.13934 6: 0.08421 Test 5 15 node Sauer example A = Columns 1 through 13 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 Columns 14 through 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 1 0 T = Columns 1 through 7 0 0 0 0 0.5000 0 0 0.5000 0 0.3333 0 0 0 0 0 0.3333 0 0.5000 0 0 0 0 0 0 0 0 0 0 0 0.3333 0 0 0 0 0 0 0 0.3333 0 0 0 0 0 0.3333 0 0 0 0 0 0 0 0.3333 0 0 0 0 0.5000 0 0 0 0 0 0 0 0 0 0 0.5000 0.5000 0.5000 0 0 0 0 0 0.5000 0.5000 0 0 0 0.5000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 8 through 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5000 0 0 0 0 0 0 0 0.3333 0 0 0 0 0 0 0.3333 0 0 0 0 0 0 0 0 0 0.3333 0 0 0 0 0 0 0.3333 0 0 0 0 0 0 0 0.5000 0 0 0.3333 0 0 0 0 0.2500 0.5000 0 0 0 0.3333 0 0.2500 0 0 0 0 0 0 0 0 0 1.0000 0 0 0 0.2500 0 0 0 0 0 0.5000 0 0 0 0 1.0000 0 0 0.2500 Column 15 0 0 0 0 0 0 0 0 0 0 0 0.5000 0 0.5000 0 google_rank: Given an NxN incidence matrix A, compute the Google matrix G, Then start with a vector of N values 1/N, and repeatedly compute x <= G*x After many steps, compare last three iterates. If they are close, we are probably at an eigenvector associated with the eigenvalue 1. x, G*x, G*G*x 1: 0.0268246 0.0268246 0.0268246 2: 0.0298611 0.0298611 0.0298611 3: 0.0298611 0.0298611 0.0298611 4: 0.0268246 0.0268246 0.0268246 5: 0.0395872 0.0395872 0.0395872 6: 0.0395872 0.0395872 0.0395872 7: 0.0395872 0.0395872 0.0395872 8: 0.0395872 0.0395872 0.0395872 9: 0.0745644 0.0745644 0.0745644 10: 0.10632 0.10632 0.10632 11: 0.10632 0.10632 0.10632 12: 0.0745644 0.0745644 0.0745644 13: 0.125092 0.125092 0.125092 14: 0.116328 0.116328 0.116328 15: 0.125092 0.125092 0.125092 power_rank: Given an NxN incidence matrix A, compute the transition matrix T, Then start with a vector of N values 1/N, and repeatedly compute x <= T*x After many steps, compare last three iterates. If they are close, we are probably at an eigenvector associated with the eigenvalue 1. x, T*x, T*T*x 1: 0.015444 0.015444 0.015444 2: 0.011583 0.011583 0.011583 3: 0.011583 0.011583 0.011583 4: 0.015444 0.015444 0.015444 5: 0.030888 0.030888 0.030888 6: 0.030888 0.030888 0.030888 7: 0.030888 0.030888 0.030888 8: 0.030888 0.030888 0.030888 9: 0.0810811 0.0810811 0.0810811 10: 0.110039 0.110039 0.110039 11: 0.110039 0.110039 0.110039 12: 0.0810811 0.0810811 0.0810811 13: 0.146718 0.146718 0.146718 14: 0.146718 0.146718 0.146718 15: 0.146718 0.146718 0.146718 surf_rank: Given an NxN incidence matrix A, compute the Google matrix T, and then repeatedly visit nodes, keeping track of how often you visited. 15 per cent of the time, simply take a random jump to a node. The rest of the time, follow a random link from the current node. When done, the node weight is the number of visits normalized by the total number of visits. Node weights: 1: 0.02591 2: 0.03033 3: 0.03019 4: 0.02707 5: 0.03919 6: 0.03955 7: 0.03908 8: 0.04026 9: 0.07377 10: 0.10558 11: 0.10699 12: 0.07453 13: 0.1247 14: 0.11638 15: 0.12647 pagerank_test(): Normal end of execution. 08-Jan-2022 08:45:56