RNG(3pm)
π RNG π
okay bestie, sit down, hydrate, because this is PDL::GSL::RNG β the Perl Data Language's lil doorway into the random-number magic of the GNU Scientific Library, documented in the RNG(3pm) manual (User Contributed Perl Documentation, if we're being β¨officialβ¨ about it).
πΈ NAME πΈ
PDL::GSL::RNG β a PDL interface to the RNG and randist routines in GSL. no cap.
π¦ DESCRIPTION π¦
So basically: this is an interface to the rng and randist packages that live inside the GNU Scientific Library. that's the whole vibe. she's a bridge. she's a connector. she's giving interoperability. π
β¨ SYNOPSIS β¨
here's the lil taste test, the trailer, the first 30 seconds of the pilot:
use PDL;
use PDL::GSL::RNG;
$rng = PDL::GSL::RNG->new('taus');
$rng->set_seed(time());
$x=zeroes(5,5,5)
$rng->get_uniform($x); # inplace
$y=$rng->get_uniform(3,4,5); # creates new pdl
see how she does it? $rng->get_uniform($x); fills the ndarray you already have in place (no new object, she just moves in π ), and $rng->get_uniform(3,4,5); creates a brand new pdl shaped 3,4,5. two moods, one method. iconic.
π NOMENCLATURE π
okay so this part matters, bestie, don't skip it π
Everywhere in this doc, we try to use the same variable names that show up in the original GSL documentation (peep the See Also, it's right there). and a lot of the time, GSL calls those variables "a" and "b".
BUT β and this is the plot twist β good Perl coding practices say do not go around using the Perl variables $a and $b. so here we call Parameters "a" and "b" $pa and $pb respectively, and Limits (of domain or of integration) get called $la and $lb. periodt. π
π FUNCTIONS π
π§ new
The new method initializes a new instance of the RNG. she's born β¨
The available RNGs are:
coveyou cmrg fishman18 fishman20 fishman2x gfsr4 knuthran
knuthran2 knuthran2002 lecuyer21 minstd mrg mt19937 mt19937_1999
mt19937_1998 r250 ran0 ran1 ran2 ran3 rand rand48 random128_bsd
random128_glibc2 random128_libc5 random256_bsd random256_glibc2
random256_libc5 random32_bsd random32_glibc2 random32_libc5
random64_bsd random64_glibc2 random64_libc5 random8_bsd
random8_glibc2 random8_libc5 random_bsd random_glibc2
random_libc5 randu ranf ranlux ranlux389 ranlxd1 ranlxd2 ranlxs0
ranlxs1 ranlxs2 ranmar slatec taus taus2 taus113 transputer tt800
uni uni32 vax waterman14 zuf default
The last one (default) uses the environment variable GSL_RNG_TYPE.
β οΈ heads up bestie: only a few of these rngs are recommended for general use. please check the GSL documentation for more info β she said what she said π
Usage:
$blessed_ref = PDL::GSL::RNG->new($RNG_name);
Example:
$rng = PDL::GSL::RNG->new('taus');
π set_seed
Sets the RNG seed. give her a little origin story π«Ά
Usage:
$rng->set_seed($integer);
# or
$rng = PDL::GSL::RNG->new('taus')->set_seed($integer);
Example:
$rng->set_seed(666);
π min
Return the minimum value generable by this RNG. the floor. the basement. the lowest of the low. π
Usage:
$integer = $rng->min();
Example:
$min = $rng->min(); $max = $rng->max();
β max
Return the maximum value generable by the RNG. the ceiling, the penthouse, the main character energy of numbers. π
Usage:
$integer = $rng->max();
Example:
$min = $rng->min(); $max = $rng->max();
π¦ name
Returns the name of the RNG. she tells you who she is. self-aware queen π
Usage:
$string = $rng->name();
Example:
$name = $rng->name();
π get
This function either creates an ndarray with the dimensions you give it, or accepts an existing ndarray and fills it. get() returns integer values between a minimum and a maximum that's specific to every single RNG β like, every RNG has its own range, no two alike π
Usage:
$ndarray = $rng->get($list_of_integers)
$rng->get($ndarray);
Example:
$x = zeroes 5,6;
$o = $rng->get(10,10); $rng->get($x);
π get_int
This function creates an ndarray with given dimensions, or accepts an existing ndarray and fills it. get_int() returns integer values between 0 and $max.
Usage:
$ndarray = $rng->get($max, $list_of_integers)
$rng->get($max, $ndarray);
Example:
$x = zeroes 5,6; $max=100;
$o = $rng->get(10,10); $rng->get($x);
β¨ get_uniform
This function creates an ndarray with given dimensions or accepts an existing ndarray and fills it. get_uniform() returns values 0<=x<1,
Usage:
$ndarray = $rng->get_uniform($list_of_integers)
$rng->get_uniform($ndarray);
Example:
$x = zeroes 5,6; $max=100;
$o = $rng->get_uniform(10,10); $rng->get_uniform($x);
πΈ get_uniform_pos
This function creates an ndarray with given dimensions or accepts an existing ndarray and fills it. get_uniform_pos() returns values 0<x<1,
Usage:
$ndarray = $rng->get_uniform_pos($list_of_integers)
$rng->get_uniform_pos($ndarray);
Example:
$x = zeroes 5,6;
$o = $rng->get_uniform_pos(10,10); $rng->get_uniform_pos($x);
π₯ ran_shuffle
Shuffles values in ndarray π
Usage:
$rng->ran_shuffle($ndarray);
π ran_shuffle_vec
Shuffles values in ndarray π (yes bestie, same energy, vec edition)
Usage:
$rng->ran_shuffle_vec(@vec);
π ran_choose
Chooses values from $inndarray to $outndarray. she's picky. she's selective. she's got taste β¨
Usage:
$rng->ran_choose($inndarray,$outndarray);
π§ ran_choose_vec
Chooses $n values from @vec.
Usage:
@chosen = $rng->ran_choose_vec($n,@vec);
π ran_gaussian
Fills the output ndarray with random values from a Gaussian distribution with mean zero and standard deviation $sigma. the bell curve. the classic. the moment π
Usage:
$ndarray = $rng->ran_gaussian($sigma,[list of integers = output ndarray dims]);
$rng->ran_gaussian($sigma, $output_ndarray);
Example:
$o = $rng->ran_gaussian($sigma,10,10);
$rng->ran_gaussian($sigma,$o);
π¦ ran_gaussian_var
This method is similar to "ran_gaussian" except that it takes the parameters of the distribution as an ndarray and returns an ndarray of equal dimensions. so like, sigma is now a whole array of sigmas. she's versatile π
Usage:
$ndarray = $rng->ran_gaussian_var($sigma_ndarray);
$rng->ran_gaussian_var($sigma_ndarray, $output_ndarray);
Example:
$sigma_pdl = rvals zeroes 11,11;
$o = $rng->ran_gaussian_var($sigma_pdl);
β ran_additive_gaussian
Add Gaussian noise of given sigma to an ndarray. sprinkle sprinkle β¨
Usage:
$rng->ran_additive_gaussian($sigma,$ndarray);
Example:
$rng->ran_additive_gaussian(1,$image);
πΈ ran_bivariate_gaussian
Generates $n bivariate gaussian random deviates. two variables, one glow-up π«
Usage:
$ndarray = $rng->ran_bivariate_gaussian($sigma_x,$sigma_y,$rho,$n);
Example:
$o = $rng->ran_bivariate_gaussian(1,2,0.5,1000);
π ran_poisson
Fills the output ndarray by with random integer values from the Poisson distribution with mean $mu.
Usage:
$ndarray = $rng->ran_poisson($mu,[list of integers = output ndarray dims]);
$rng->ran_poisson($mu,$output_ndarray);
π ran_poisson_var
Similar to "ran_poisson" except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions.
Usage:
$ndarray = $rng->ran_poisson_var($mu_ndarray);
π ran_additive_poisson
Add Poisson noise of given $mu to a $ndarray.
Usage:
$rng->ran_additive_poisson($mu,$ndarray);
Example:
$rng->ran_additive_poisson(1,$image);
π₯ ran_feed_poisson
This method simulates shot noise, taking the values of ndarray as values for $mu to be fed into the poissonian RNG. she's eating, and we're feeding her π½οΈ
Usage:
$rng->ran_feed_poisson($ndarray);
Example:
$rng->ran_feed_poisson($image);
π§ ran_bernoulli
Fills the output ndarray with random values 0 or 1, the result of a Bernoulli trial with probability $p. coin flip core πͺ
Usage:
$ndarray = $rng->ran_bernoulli($p,[list of integers = output ndarray dims]);
$rng->ran_bernoulli($p,$output_ndarray);
π ran_bernoulli_var
Similar to "ran_bernoulli" except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions.
Usage:
$ndarray = $rng->ran_bernoulli_var($p_ndarray);
π ran_beta
Fills the output ndarray with random variates from the beta distribution with parameters $pa and $pb.
Usage:
$ndarray = $rng->ran_beta($pa,$pb,[list of integers = output ndarray dims]);
$rng->ran_beta($pa,$pb,$output_ndarray);
π¦ ran_beta_var
Similar to "ran_beta" except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions.
Usage:
$ndarray = $rng->ran_beta_var($a_ndarray, $b_ndarray);
β ran_binomial
Fills the output ndarray with random integer values from the binomial distribution β that's the number of successes in $n independent trials with probability $p.
Usage:
$ndarray = $rng->ran_binomial($p,$n,[list of integers = output ndarray dims]);
$rng->ran_binomial($p,$n,$output_ndarray);
πΈ ran_binomial_var
Similar to "ran_binomial" except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions.
Usage:
$ndarray = $rng->ran_binomial_var($p_ndarray, $n_ndarray);
π ran_cauchy
Fills the output ndarray with random variates from the Cauchy distribution with scale parameter $pa.
Usage:
$ndarray = $rng->ran_cauchy($pa,[list of integers = output ndarray dims]);
$rng->ran_cauchy($pa,$output_ndarray);
π ran_cauchy_var
Similar to "ran_cauchy" except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions.
Usage:
$ndarray = $rng->ran_cauchy_var($a_ndarray);
β¨ ran_chisq
Fills the output ndarray with random variates from the chi-squared distribution with $nu degrees of freedom.
Usage:
$ndarray = $rng->ran_chisq($nu,[list of integers = output ndarray dims]);
$rng->ran_chisq($nu,$output_ndarray);
π ran_chisq_var
Similar to "ran_chisq" except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions.
Usage:
$ndarray = $rng->ran_chisq_var($nu_ndarray);
π₯ ran_exponential
Fills the output ndarray with random variates from the exponential distribution with mean $mu.
Usage:
$ndarray = $rng->ran_exponential($mu,[list of integers = output ndarray dims]);
$rng->ran_exponential($mu,$output_ndarray);
π§ ran_exponential_var
Similar to "ran_exponential" except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions.
Usage:
$ndarray = $rng->ran_exponential_var($mu_ndarray);
π ran_exppow
Fills the output ndarray with random variates from the exponential power distribution with scale parameter $pa and exponent $pb.
Usage:
$ndarray = $rng->ran_exppow($pa,$pb,[list of integers = output ndarray dims]);
$rng->ran_exppow($pa,$pb,$output_ndarray);
π ran_exppow_var
Similar to "ran_exppow" except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions.
Usage:
$ndarray = $rng->ran_exppow_var($a_ndarray, $b_ndarray);
β ran_fdist
Fills the output ndarray with random variates from the F-distribution with degrees of freedom $nu1 and $nu2.
Usage:
$ndarray = $rng->ran_fdist($nu1, $nu2,[list of integers = output ndarray dims]);
$rng->ran_fdist($nu1, $nu2,$output_ndarray);
π¦ ran_fdist_var
Similar to "ran_fdist" except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions.
Usage:
$ndarray = $rng->ran_fdist_var($nu1_ndarray, $nu2_ndarray);
π ran_flat
Fills the output ndarray with random variates from the flat (uniform) distribution from $la to $lb. flat like my emotional range when the tests pass on the first try π
Usage:
$ndarray = $rng->ran_flat($la,$lb,[list of integers = output ndarray dims]);
$rng->ran_flat($la,$lb,$output_ndarray);
ran_flat_var π
Okay so this is ran_flat's twin, except the distribution parameters roll in as an ndarray and you get an ndarray back with the exact same dimensions. Shape-matching, as it should be. β¨
Usage:
$ndarray = $rng->ran_flat_var($a_ndarray, $b_ndarray);
ran_gamma πΈ
Fills your output ndarray with random variates from the gamma distribution. Classic.
Usage:
$ndarray = $rng->ran_gamma($pa,$pb,[list of integers = output ndarray dims]);
$rng->ran_gamma($pa,$pb,$output_ndarray);
ran_gamma_var π¦
Same energy as ran_gamma, but the distribution parameters arrive as an ndarray and what you get back is an ndarray of equal dimensions. Bestie behaviour. π
Usage:
$ndarray = $rng->ran_gamma_var($a_ndarray, $b_ndarray);
ran_geometric β
Fills the output ndarray with random integer values from the geometric distribution β that's the number of independent trials with probability $p until you hit the first success. So basically: how many tries until it finally works. π
Usage:
$ndarray = $rng->ran_geometric($p,[list of integers = output ndarray dims]);
$rng->ran_geometric($p,$output_ndarray);
ran_geometric_var π
ran_geometric but the distribution parameter is an ndarray and the return is an ndarray of the same dimensions. Matching, periodt.
Usage:
$ndarray = $rng->ran_geometric_var($p_ndarray);
ran_gumbel1 π
Fills the output ndarray with random variates from the Type-1 Gumbel distribution.
Usage:
$ndarray = $rng->ran_gumbel1($pa,$pb,[list of integers = output ndarray dims]);
$rng->ran_gumbel1($pa,$pb,$output_ndarray);
ran_gumbel1_var π«Ά
Like ran_gumbel1, but the distribution parameters are an ndarray and the return is an ndarray of equal dimensions. Iconic of it.
Usage:
$ndarray = $rng->ran_gumbel1_var($a_ndarray, $b_ndarray);
ran_gumbel2 β¨
Fills the output ndarray with random variates from the Type-2 Gumbel distribution. Yes, there's a sequel. The second one. π¬
Usage:
$ndarray = $rng->ran_gumbel2($pa,$pb,[list of integers = output ndarray dims]);
$rng->ran_gumbel2($pa,$pb,$output_ndarray);
ran_gumbel2_var π
ran_gumbel2, but the distribution parameters come as an ndarray and you get an ndarray of equal dimensions back. Consistent queen. π
Usage:
$ndarray = $rng->ran_gumbel2_var($a_ndarray, $b_ndarray);
ran_hypergeometric π₯
Fills the output ndarray with random integer values from the hypergeometric distribution. Here's the vibe: if a population has $n1 elements of type 1 and $n2 elements of type 2, then the hypergeometric distribution gives you the probability of obtaining $x elements of type 1 in $t samples taken from the population without replacement. Note the no-replacement part, bestie β that's the whole plot twist. π
Usage:
$ndarray = $rng->ran_hypergeometric($n1, $n2, $t,[list of integers = output ndarray dims]);
$rng->ran_hypergeometric($n1, $n2, $t,$output_ndarray);
ran_hypergeometric_var π§
Same as ran_hypergeometric except the distribution parameters show up as an ndarray, and the return is an ndarray of equal dimensions. The pattern is the pattern, iykyk. π«
Usage:
$ndarray = $rng->ran_hypergeometric_var($n1_ndarray, $n2_ndarray, $t_ndarray);
ran_laplace π
Fills the output ndarray with random variates from the Laplace distribution with width $pa.
Usage:
$ndarray = $rng->ran_laplace($pa,[list of integers = output ndarray dims]);
$rng->ran_laplace($pa,$output_ndarray);
ran_laplace_var π
Like ran_laplace, but the distribution parameter is an ndarray and the return is an ndarray of equal dimensions. So demure of it.
Usage:
$ndarray = $rng->ran_laplace_var($a_ndarray);
ran_levy π
Fills the output ndarray with random variates from the Levy symmetric stable distribution with scale $c and exponent $alpha. (The usage below calls them $mu and $x β just roll with it, bestie, that's what the page says. π)
Usage:
$ndarray = $rng->ran_levy($mu,$x,[list of integers = output ndarray dims]);
$rng->ran_levy($mu,$x,$output_ndarray);
ran_levy_var π¦
ran_levy, but the distribution parameters are an ndarray and the return is an ndarray of equal dimensions. Same deal, different shape energy.
Usage:
$ndarray = $rng->ran_levy_var($mu_ndarray, $a_ndarray);
ran_logarithmic π
Fills the output ndarray with random integer values from the logarithmic distribution. Integers only, no decimals invited. π
Usage:
$ndarray = $rng->ran_logarithmic($p,[list of integers = output ndarray dims]);
$rng->ran_logarithmic($p,$output_ndarray);
ran_logarithmic_var β
Like ran_logarithmic except the distribution parameter comes in as an ndarray and you get an ndarray of equal dimensions back. Chef's kiss.
Usage:
$ndarray = $rng->ran_logarithmic_var($p_ndarray);
ran_logistic π
Fills the output ndarray with random random variates from the logistic distribution. (Yes, it really says "random random" β we love a double-confirmed random. π)
Usage:
$ndarray = $rng->ran_logistic($m,[list of integers = output ndarray dims]u)
$rng->ran_logistic($m,$output_ndarray)
ran_logistic_var π
ran_logistic except the distribution parameter is an ndarray and the return is an ndarray of equal dimensions. The var functions stay winning. π
Usage:
$ndarray = $rng->ran_logistic_var($m_ndarray);
ran_lognormal πΈ
Fills the output ndarray with random variates from the lognormal distribution with parameters $mu (location) and $sigma (scale). Two params, both named, both doing their job.
Usage:
$ndarray = $rng->ran_lognormal($mu,$sigma,[list of integers = output ndarray dims]);
$rng->ran_lognormal($mu,$sigma,$output_ndarray);
ran_lognormal_var π«Ά
ran_lognormal, but the distribution parameters are ndarrays and you get an ndarray of equal dimensions. Matching params, matching dims. π―
Usage:
$ndarray = $rng->ran_lognormal_var($mu_ndarray, $sigma_ndarray);
ran_negative_binomial π₯
Fills the output ndarray with random integer values from the negative binomial distribution β that's the number of failures happening before $n successes in independent trials, with probability $p of success. And important: $n is not required to be an integer. Let it be free, let it be a float. ποΈ
Usage:
$ndarray = $rng->ran_negative_binomial($p,$n,[list of integers = output ndarray dims]);
$rng->ran_negative_binomial($p,$n,$output_ndarray);
ran_negative_binomial_var π§
Like ran_negative_binomial, except the distribution parameters are an ndarray and the return is an ndarray of equal dimensions. Slay.
Usage:
$ndarray = $rng->ran_negative_binomial_var($p_ndarray, $n_ndarray);
ran_pareto π
Fills the output ndarray with random variates from the Pareto distribution of order $pa and scale $lb.
Usage:
$ndarray = $rng->ran_pareto($pa,$lb,[list of integers = output ndarray dims]);
$rng->ran_pareto($pa,$lb,$output_ndarray);
ran_pareto_var π
ran_pareto but the distribution parameters arrive as an ndarray and the return is an ndarray of equal dimensions. We love a symmetric little setup. β¨
Usage:
$ndarray = $rng->ran_pareto_var($a_ndarray, $b_ndarray);
ran_pascal π
Fills the output ndarray with random integer values from the Pascal distribution. Plot twist: the Pascal distribution is literally just a negative binomial distribution (see ran_negative_binomial) with an integer value of $n. It's the same girl with a different name. π
Usage:
$ndarray = $rng->ran_pascal($p,$n,[list of integers = output ndarray dims]);
$rng->ran_pascal($p,$n,$output_ndarray);
ran_pascal_var π¦
Like ran_pascal except the distribution parameters are an ndarray and the return is an ndarray of equal dimensions. Keeping the family resemblance strong.
Usage:
$ndarray = $rng->ran_pascal_var($p_ndarray, $n_ndarray);
ran_rayleigh β
Fills the output ndarray with random variates from the Rayleigh distribution with scale parameter $sigma.
Usage:
$ndarray = $rng->ran_rayleigh($sigma,[list of integers = output ndarray dims]);
$rng->ran_rayleigh($sigma,$output_ndarray);
ran_rayleigh_var π
ran_rayleigh, except the distribution parameter is an ndarray and what comes back is an ndarray of equal dimensions. Per usual, and per usual it's perfect. π
Usage:
$ndarray = $rng->ran_rayleigh_var($sigma_ndarray);
ran_rayleigh_tail π
Fills the output ndarray with random variates from the tail of the Rayleigh distribution, with scale parameter $sigma and a lower limit of $la. Yes, we're doing the tail end of it. The tail is the moment. π
Usage:
$ndarray = $rng->ran_rayleigh_tail($la,$sigma,[list of integers = output ndarray dims]);
$rng->ran_rayleigh_tail($x,$sigma,$output_ndarray);
ran_rayleigh_tail_var π
Like ran_rayleigh_tail, except the distribution parameters are an ndarray and the return is an ndarray of equal dimensions. Consistency is the flex. π«
Usage:
$ndarray = $rng->ran_rayleigh_tail_var($a_ndarray, $sigma_ndarray);
ran_tdist π«Ά
Fills the output ndarray with random variates from the t-distribution (AKA Student's t-distribution) with $nu degrees of freedom.
Usage:
$ndarray = $rng->ran_tdist($nu,[list of integers = output ndarray dims]);
$rng->ran_tdist($nu,$output_ndarray);
ran_tdist_var β¨
ran_tdist but the distribution parameter is an ndarray and the return is an ndarray of equal dimensions. No notes.
Usage:
$ndarray = $rng->ran_tdist_var($nu_ndarray);
ran_ugaussian_tail πΈ
Fills the output ndarray with random variates from the upper tail of a Gaussian distribution with standard deviation = 1 (AKA the unit Gaussian distribution). Upper tail only, we're not doing the whole curve today. π
Usage:
$ndarray = $rng->ran_ugaussian_tail($tail,[list of integers = output ndarray dims]);
$rng->ran_ugaussian_tail($tail,$output_ndarray);
ran_ugaussian_tail_var π§
Like ran_ugaussian_tail except the distribution parameter is an ndarray and the return is an ndarray of equal dimensions. Same tail, array-shaped. π¦
Usage:
$ndarray = $rng->ran_ugaussian_tail_var($tail_ndarray);
ran_weibull π
Fills the output ndarray with random variates from the Weibull distribution with scale $pa and exponent $pb. Heads up: some literature uses lambda for $pa and k for $pb, so if you're reading a paper and feel confused, it's them, not you. π
Usage:
$ndarray = $rng->ran_weibull($pa,$pb,[list of integers = output ndarray dims]);
$rng->ran_weibull($pa,$pb,$output_ndarray);
ran_weibull_var π
ran_weibull, except the distribution parameters come as an ndarray and the return is an ndarray of equal dimensions. The var crew never misses. π
Usage:
$ndarray = $rng->ran_weibull_var($a_ndarray, $b_ndarray);
ran_dir π₯
Returns $n random vectors in $ndim dimensions. Directions, generated, done.
Usage:
$ndarray = $rng->ran_dir($ndim,$n);
Example:
$o = $rng->ran_dir($ndim,$n);
ran_discrete_preproc β
This method returns a handle that you then have to use when you call ran_discrete. You're the one who specifies the probability of the integer numbers that get returned by ran_discrete. So like, set it up here, use it there. Two-step process, bestie, don't skip step one. π
Usage:
$discrete_dist_handle = $rng->ran_discrete_preproc($double_ndarray_prob);
Example:
$prob = pdl [0.1,0.3,0.6];
$ddh = $rng->ran_discrete_preproc($prob);
$o = $rng->ran_discrete($discrete_dist_handle,100);
ran_discrete π
This is the one you use to actually get the samples you want, once a proper handle has been established (see ran_discrete_preproc()). No handle, no samples. That's the rule. π
Usage:
$ndarray = $rng->ran_discrete($discrete_dist_handle,$num);
Example:
$prob = pdl [0.1,0.3,0.6];
$ddh = $rng->ran_discrete_preproc($prob);
$o = $rng->ran_discrete($discrete_dist_handle,100);
ran_ver π¦
Returns an ndarray with $n values generated by the Verhulst map, starting from $x0 with parameter $r. Chaos math but make it cute. π
Usage:
$rng->ran_ver($x0, $r, $n);
ran_caos</p>
okay this one is giving chaos theory but make it cute π« it hands you back values from Verhulst's map with $r=4.0 and a randomly chosen $x0. and the values get scaled by $m, bestie, so they're not just tiny little babies anymore.
how you call it:
$rng->ran_caos($m,$n);
π BUGS π
ngl we love feedback here, it's not giving "leave a bad review", it's giving "come gossip with us about what's broken" π if you find a bug, log it in the PDL bug database β and guess what, that database is always linked right from http://pdl.perl.org/ so you can't even miss it. no cap.
π SEE ALSO π
- PDL β the whole reason we're here, the main character π
- the GSL documentation for random number distributions is online at https://www.gnu.org/software/gsl/doc/html/randist.html β go read it, it's lowkey iconic π
π AUTHOR π
this file copyright (C) 1999 Christian Pellegrin <chri@infis.univ.trieste.it>. Docs mangled by C. Soeller. All rights reserved. there is no warranty, like at all, zero, nada π you are allowed to redistribute this software / documentation under certain conditions β for the deets, peep the file COPYING in the PDL distribution. and listen: if this file ever gets separated from the PDL distribution, the copyright notice should be included in the file. keep it together, bestie π«Ά
The GSL RNG and randist modules were written by James Theiler. absolute legend, we stan β
and that's a wrap on the whole page, babe π this one's from perl v5.38.2, dated 2024-04-10, and it's RNG(3pm) β go forth and generate some stunning random numbers, you've got this π
β¨π
π¦ where this page comes from
- ubuntu noble: pdl 1:2.085-1ubuntu1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms