figure;
%hold on;
%plot(log2(rankvariation(1:100)),'bs-');
%plot(log2(rankvariations(1:100)),'rs-');
semilogy([1:100],(rankvariation(1:100)),'bs-',[1:100],(rankvariations(1:100)),'rs-');
grid;
legend('Stanford-Berkeley Web','Stanford Web');
xlabel('Percentage of whole page set');
ylabel('PageRank value averaged variation');
title('PageRank Value Stability (Tolerance = 10^-^8)');
%hold off;

rankvariationmatrix = rank_array./(rank_array(1:6834,100)*ones(1,100));
e1 = std(rankvariationmatrix);
rankvariation = sum(rankvariationmatrix,1)/6834;
e1_up = rankvariation + e1;
e1_low = rankvariation - e1;

rankvariationmatrixs = rank_arrays./(rank_arrays(1:2819,100)*ones(1,100));
e2 = std(rankvariationmatrixs);
rankvariations = sum(rankvariationmatrixs,1)/2819;
e2_up = rankvariations + e1;
e2_low = rankvariations - e1;

figure;
%hold on;
subplot(2,1,1);
errorbar([5:5:99],log10(rankvariation(5:5:99)),log10(e1_low(5:5:99)),log10(e1_up(5:5:99)),'bs-');
grid;
legend('Stanford-Berkeley Web');
xlabel('Percent of whole page set used');
ylabel('PageRank averaged variation');
subplot(2,1,2);
errorbar([5:5:99],log10(rankvariations(5:5:99)),log10(e2_low(5:5:99)),log10(e2_up(5:5:99)),'rs-');
grid;
legend('Stanford Web');
xlabel('Percent of whole page set used');
ylabel('PageRank averaged variation');
%hold off;

