CS 765 Complex Networks
Network Lab 4
Due on Wednesday Nov 1, 2017 at 1 pm
Using any programming language, generate 100,000 random integers from a power law distribution with exponent alpha = 2.1. Note that the slides #90-105 discuss the power law generation and fitting.
Submitting your files
- What is the largest value in your sample?
Is it possible for a node in a network to have a degree this high (assuming you don't allow multiple edges between two nodes)?
- Construct a histogram of the frequency of occurrence of each integer in your sample.
Try both a linear scale plot and a log-log scale plot. (include snapshots)
- What happens to the bins with zero count in the log-log plot?
- Try a simple linear regression on the log transformation of both variables.
(In Matlab, you can plot two data sets together as follows: plot(x1,y1,'r-',x2,y2,'b:').
This will plot y1 vs. x1 as a red solid line, and y2 vs. x2 as a blue dotted line.)
What is your value of the power-law exponent alpha? Include a plot of the data with the fit superimposed.
- Now exponentially bin the data and fit with a line. What is your value of alpha?
- Do a cumulative frequency plot of the original data sample. Fit, plot, and report on the fitted exponent and the corresponding value of alpha.
- Finally, do a maximum likelihood fitting of the data. Plot the results and report the alpha.
- Which method was the most accurate? Which one, in your opinion, gave the best view of the data and the fit?
Submission of your homework is via WebCampus.
You must submit all the required files in a single pdf document containing all the answers.
Acknowledgement: The assignment is modified from Lada Adamic.