Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PLExponentEstimated[g_?DirectedGraphQ, kmin_Integer /; kmin >= 6,distType_String /;
- StringMatchQ[distType, {"InDegree","OutDegree"}]]:=
- Module[
- {$FunctionName = "PLExponentEstimated", vertexDegrees, ki, M, exponentMLE, expStandardError},
- Switch[distType,(*Picks whether to choose In-Degree)
- "InDegree", vertexDegrees = VertexInDegree[g]
- "OutDegree", vertexDegrees = VertexOutDegree[g];
- ];
- ki = Select[vertexDegrees, # >= kmin &];(*defined the values for ki*)
- M = Length[ki];(*values in the graph, N*)
- exponentMLE = 1 + M*Total[Map[N[Log[#/(kmin - 1/2)]] &, ki]]^-1;(*MLE estimator*)
- expStandardError = (exponentMLE - 1)/Sqrt[M];(*standard error*)
- {exponentMLE, expStandardError} (*output*)
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement