PLGEN(1)

✨ PLGEN β€” the power-law sample generator, bestie ✨

okay so this is a page from the User Commands part of the manual, section 1, and it's all about a little program called plgen. it's giving "I make random numbers and I make them fabulous". let's get into it πŸ’…


🌸 NAME 🌸

plgen β€” generate samples from a power-law distribution πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

plgen [OPTIONS] num_samples gamma [kappa]

like... that's the whole vibe. you hand it a number, a gamma, and maybe a kappa, and it hands you back samples. iconic behavior fr fr.


πŸ’– DESCRIPTION πŸ’–

okay so real talk: plgen generates a given number of samples from a power-law distribution, with an optional exponential cutoff. that's it, that's the job, and it does it gorgeously.

the pdf that's being sampled is, and I quote verbatim because I would never change a single character of math:

P(k) = C * k^(-gamma) * exp(-k/kappa)

where C is an appropriate normalization constant (it's just doing its little normalization thing, no notes).

so where do the values come from? bestie, keep up:

  • gamma is given by the second command line argument. yes, positional. yes, it matters.
  • kappa is given by the -k switch. so if you want that exponential cutoff, that's your girl.
no cap, if you skip kappa you're just getting the plain power-law with no cutoff. that's not a bug, that's a choice, and it's yours to make πŸ’œ

✨ OPTIONS ✨

one bullet per flag, because we are thorough and we are cute:

  • -h β€” shows this help message. your little "what do I do" bestie. zero judgment 🫢
  • -v β€” shows version information. gotta know what era of plgen you're living in ⭐
  • -c β€” generate continuous samples. not discrete, not playing around. continuous πŸ’«
  • -k KAPPA β€” use exponential cutoff with kappa = KAPPA. this is the one that puts the exp in your pdf πŸ”₯
  • -o OFFSET β€” add OFFSET to each generated sample. every single one. shifting the whole squad over 🌈
  • -s SEED β€” use SEED to seed the random number generator. for when you need your randomness to be, um, reproducible. the chaos is deterministic, slay πŸ‘‘
  • -x XMIN β€” generate a power-law distribution that starts at XMIN. sets the floor. nothing below this, periodt πŸŽ€

πŸ¦‹ that's a wrap πŸ¦‹

and that's the whole page, bestie!! this manual was brought to you by plfit, and it's dated July 2021 β€” so it's vintage at this point, honestly, and we respect our elders πŸ™ˆπŸ’– go forth, generate samples, be the main character of your own distribution. mwah πŸ’…βœ¨