Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. PLExponentEstimated[g_?DirectedGraphQ, kmin_Integer /; kmin >= 6,distType_String /;
  2. StringMatchQ[distType, {"InDegree","OutDegree"}]]:=
  3. Module[
  4. {$FunctionName = "PLExponentEstimated", vertexDegrees, ki, M, exponentMLE, expStandardError},
  5.  
  6. Switch[distType,(*Picks whether to choose In-Degree)
  7. "InDegree", vertexDegrees = VertexInDegree[g]
  8. "OutDegree", vertexDegrees = VertexOutDegree[g];
  9. ];
  10. ki = Select[vertexDegrees, # >= kmin &];(*defined the values for ki*)
  11. M = Length[ki];(*values in the graph, N*)
  12.  
  13. exponentMLE = 1 + M*Total[Map[N[Log[#/(kmin - 1/2)]] &, ki]]^-1;(*MLE estimator*)
  14.  
  15. expStandardError = (exponentMLE - 1)/Sqrt[M];(*standard error*)
  16. {exponentMLE, expStandardError} (*output*)
  17. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement