Statistical Analysis of the Slashdot
Statistical Analysis of the Slashdot
Use the Wolfram Language's strong probability and statistical capabilities to analyze the social network emerging from Slashdot, a technology-related news website known for its specific user community.
data = Import["http://snap.stanford.edu/data/soc-Slashdot0902.txt.gz",
"Table"];graph = Graph[DirectedEdge@@@data[[5 ;; ]]];
wcc = Subgraph[graph, First[WeaklyConnectedComponents[graph]]];
scc = Subgraph[graph, Last[SortBy[ConnectedComponents[graph], Length]]];{VertexCount[graph], EdgeCount[graph]}{VertexCount[wcc], EdgeCount[wcc]}{VertexCount[scc], EdgeCount[scc]}N[MeanClusteringCoefficient[graph]]indegree = VertexInDegree[graph];
lndist = EstimatedDistribution[indegree, LogNormalDistribution[mu, si]];
pdist = EstimatedDistribution[indegree, ParetoDistribution[k, al]];
emdist = EmpiricalDistribution[indegree];pstyle = Directive[Thick, #]& /@ {Red, Blue, Green};
plots = LogLinearPlot[{CDF[lndist, x], CDF[pdist, x]}//Evaluate, {x, 5, 1500}, PlotStyle -> pstyle[[2 ;; 3]]];
listplot = ListLogLinearPlot[{Table[{x, CDF[emdist, x]}, {x, DistributionDomain[emdist]}]}, PlotStyle -> First@pstyle];
Legended[Show[{plots, listplot}, ImageSize -> 400, Frame -> True], Placed[SwatchLegend[pstyle, {"data", "log-normal", "pareto"}, LegendFunction -> "Frame"], {{.98, .03}, {1, 0}}]]