Skip to content

Commit

Permalink
inverse transform sampling method for making discrete powelaw samples.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziaeemehr committed Aug 3, 2024
1 parent 2d16c10 commit 1e2766d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions netsci/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,15 @@ def generate_power_law_discrete_its(alpha:float, k_min:int, k_max:int, size:int=
np.array:
Array of generated power law discrete distributions.
Examples
---------
>>> gamma = 2.5 # Power-law exponent
>>> k_min = 1 # Minimum value of k
>>> k_max = 1000 # Maximum value of k
>>> size = 10000 # Number of samples
>>> samples = power_law_discrete(gamma, k_min, k_max, size)
"""


Expand Down

0 comments on commit 1e2766d

Please sign in to comment.