Skip to content

Commit 87d1b62

Browse files
committed
feat: update random TypeScript declarations
Signed-off-by: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com>
1 parent 54dedc8 commit 87d1b62

1 file changed

Lines changed: 238 additions & 0 deletions

File tree

  • lib/node_modules/@stdlib/random/docs/types

lib/node_modules/@stdlib/random/docs/types/index.d.ts

Lines changed: 238 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,20 @@
2323
import arcsine = require( '@stdlib/random/arcsine' );
2424
import array = require( '@stdlib/random/array' );
2525
import base = require( '@stdlib/random/base' );
26+
import bernoulli = require( '@stdlib/random/bernoulli' );
2627
import beta = require( '@stdlib/random/beta' );
2728
import betaprime = require( '@stdlib/random/betaprime' );
2829
import binomial = require( '@stdlib/random/binomial' );
2930
import cauchy = require( '@stdlib/random/cauchy' );
31+
import chi = require( '@stdlib/random/chi' );
32+
import chisquare = require( '@stdlib/random/chisquare' );
3033
import cosine = require( '@stdlib/random/cosine' );
3134
import discreteUniform = require( '@stdlib/random/discrete-uniform' );
3235
import erlang = require( '@stdlib/random/erlang' );
3336
import exponential = require( '@stdlib/random/exponential' );
3437
import f = require( '@stdlib/random/f' );
3538
import gamma = require( '@stdlib/random/gamma' );
39+
import geometric = require( '@stdlib/random/geometric' );
3640
import gumbel = require( '@stdlib/random/gumbel' );
3741
import invgamma = require( '@stdlib/random/invgamma' );
3842
import iterators = require( '@stdlib/random/iter' );
@@ -44,10 +48,13 @@ import lognormal = require( '@stdlib/random/lognormal' );
4448
import negativeBinomial = require( '@stdlib/random/negative-binomial' );
4549
import normal = require( '@stdlib/random/normal' );
4650
import pareto1 = require( '@stdlib/random/pareto-type1' );
51+
import poisson = require( '@stdlib/random/poisson' );
52+
import rayleigh = require( '@stdlib/random/rayleigh' );
4753
import sample = require( '@stdlib/random/sample' );
4854
import shuffle = require( '@stdlib/random/shuffle' );
4955
import streams = require( '@stdlib/random/streams' );
5056
import strided = require( '@stdlib/random/strided' );
57+
import t = require( '@stdlib/random/t' );
5158
import tools = require( '@stdlib/random/tools' );
5259
import uniform = require( '@stdlib/random/uniform' );
5360
import weibull = require( '@stdlib/random/weibull' );
@@ -100,6 +107,39 @@ interface Namespace {
100107
*/
101108
base: typeof base;
102109

110+
/**
111+
* Generates pseudorandom numbers drawn from a Bernoulli distribution.
112+
*
113+
* @param shape - output shape
114+
* @param p - success probability
115+
* @param options - function options
116+
* @throws distribution parameters and the output shape must be broadcast compatible
117+
* @returns output ndarray
118+
*
119+
* @example
120+
* var out = ns.bernoulli( [ 3, 3 ], 0.5 );
121+
* // returns <ndarray>
122+
*
123+
* @example
124+
* var zeros = require( '@stdlib/ndarray/zeros' );
125+
*
126+
* var out = zeros( [ 3, 3 ] );
127+
* // returns <ndarray>
128+
*
129+
* var v = ns.bernoulli.assign( 0.5, out );
130+
* // returns <ndarray>
131+
*
132+
* var bool = ( v === out );
133+
* // returns true
134+
*
135+
* @example
136+
* var random = ns.bernoulli.factory();
137+
*
138+
* var out = random( [ 3, 3 ], 0.5 );
139+
* // returns <ndarray>
140+
*/
141+
bernoulli: typeof bernoulli;
142+
103143
/**
104144
* Generates pseudorandom numbers drawn from a beta distribution.
105145
*
@@ -236,6 +276,72 @@ interface Namespace {
236276
*/
237277
cauchy: typeof cauchy;
238278

279+
/**
280+
* Generates pseudorandom numbers drawn from a chi distribution.
281+
*
282+
* @param shape - output shape
283+
* @param k - degrees of freedom
284+
* @param options - function options
285+
* @throws distribution parameters and the output shape must be broadcast compatible
286+
* @returns output ndarray
287+
*
288+
* @example
289+
* var out = ns.chi( [ 3, 3 ], 2.0 );
290+
* // returns <ndarray>
291+
*
292+
* @example
293+
* var zeros = require( '@stdlib/ndarray/zeros' );
294+
*
295+
* var out = zeros( [ 3, 3 ] );
296+
* // returns <ndarray>
297+
*
298+
* var v = ns.chi.assign( 2.0, out );
299+
* // returns <ndarray>
300+
*
301+
* var bool = ( v === out );
302+
* // returns true
303+
*
304+
* @example
305+
* var random = ns.chi.factory();
306+
*
307+
* var out = random( [ 3, 3 ], 2.0 );
308+
* // returns <ndarray>
309+
*/
310+
chi: typeof chi;
311+
312+
/**
313+
* Generates pseudorandom numbers drawn from a chi-square distribution.
314+
*
315+
* @param shape - output shape
316+
* @param k - degrees of freedom
317+
* @param options - function options
318+
* @throws distribution parameters and the output shape must be broadcast compatible
319+
* @returns output ndarray
320+
*
321+
* @example
322+
* var out = ns.chisquare( [ 3, 3 ], 2.0 );
323+
* // returns <ndarray>
324+
*
325+
* @example
326+
* var zeros = require( '@stdlib/ndarray/zeros' );
327+
*
328+
* var out = zeros( [ 3, 3 ] );
329+
* // returns <ndarray>
330+
*
331+
* var v = ns.chisquare.assign( 2.0, out );
332+
* // returns <ndarray>
333+
*
334+
* var bool = ( v === out );
335+
* // returns true
336+
*
337+
* @example
338+
* var random = ns.chisquare.factory();
339+
*
340+
* var out = random( [ 3, 3 ], 2.0 );
341+
* // returns <ndarray>
342+
*/
343+
chisquare: typeof chisquare;
344+
239345
/**
240346
* Generates pseudorandom numbers drawn from a raised cosine distribution.
241347
*
@@ -439,6 +545,39 @@ interface Namespace {
439545
*/
440546
gamma: typeof gamma;
441547

548+
/**
549+
* Generates pseudorandom numbers drawn from a geometric distribution.
550+
*
551+
* @param shape - output shape
552+
* @param p - success probability
553+
* @param options - function options
554+
* @throws distribution parameters and the output shape must be broadcast compatible
555+
* @returns output ndarray
556+
*
557+
* @example
558+
* var out = ns.geometric( [ 3, 3 ], 0.01 );
559+
* // returns <ndarray>
560+
*
561+
* @example
562+
* var zeros = require( '@stdlib/ndarray/zeros' );
563+
*
564+
* var out = zeros( [ 3, 3 ] );
565+
* // returns <ndarray>
566+
*
567+
* var v = ns.geometric.assign( 0.01, out );
568+
* // returns <ndarray>
569+
*
570+
* var bool = ( v === out );
571+
* // returns true
572+
*
573+
* @example
574+
* var random = ns.geometric.factory();
575+
*
576+
* var out = random( [ 3, 3 ], 0.01 );
577+
* // returns <ndarray>
578+
*/
579+
geometric: typeof geometric;
580+
442581
/**
443582
* Generates pseudorandom numbers drawn from a Gumbel distribution.
444583
*
@@ -784,6 +923,72 @@ interface Namespace {
784923
*/
785924
pareto1: typeof pareto1;
786925

926+
/**
927+
* Generates pseudorandom numbers drawn from a Poisson distribution.
928+
*
929+
* @param shape - output shape
930+
* @param lambda - mean parameter
931+
* @param options - function options
932+
* @throws distribution parameters and the output shape must be broadcast compatible
933+
* @returns output ndarray
934+
*
935+
* @example
936+
* var out = ns.poisson( [ 3, 3 ], 2.0 );
937+
* // returns <ndarray>
938+
*
939+
* @example
940+
* var zeros = require( '@stdlib/ndarray/zeros' );
941+
*
942+
* var out = zeros( [ 3, 3 ] );
943+
* // returns <ndarray>
944+
*
945+
* var v = ns.poisson.assign( 2.0, out );
946+
* // returns <ndarray>
947+
*
948+
* var bool = ( v === out );
949+
* // returns true
950+
*
951+
* @example
952+
* var random = ns.poisson.factory();
953+
*
954+
* var out = random( [ 3, 3 ], 2.0 );
955+
* // returns <ndarray>
956+
*/
957+
poisson: typeof poisson;
958+
959+
/**
960+
* Generates pseudorandom numbers drawn from a Rayleigh distribution.
961+
*
962+
* @param shape - output shape
963+
* @param sigma - scale parameter
964+
* @param options - function options
965+
* @throws distribution parameters and the output shape must be broadcast compatible
966+
* @returns output ndarray
967+
*
968+
* @example
969+
* var out = ns.rayleigh( [ 3, 3 ], 2.0 );
970+
* // returns <ndarray>
971+
*
972+
* @example
973+
* var zeros = require( '@stdlib/ndarray/zeros' );
974+
*
975+
* var out = zeros( [ 3, 3 ] );
976+
* // returns <ndarray>
977+
*
978+
* var v = ns.rayleigh.assign( 2.0, out );
979+
* // returns <ndarray>
980+
*
981+
* var bool = ( v === out );
982+
* // returns true
983+
*
984+
* @example
985+
* var random = ns.rayleigh.factory();
986+
*
987+
* var out = random( [ 3, 3 ], 2.0 );
988+
* // returns <ndarray>
989+
*/
990+
rayleigh: typeof rayleigh;
991+
787992
/**
788993
* Samples elements from an array-like object.
789994
*
@@ -836,6 +1041,39 @@ interface Namespace {
8361041
*/
8371042
strided: typeof strided;
8381043

1044+
/**
1045+
* Generates pseudorandom numbers drawn from a Student's t-distribution.
1046+
*
1047+
* @param shape - output shape
1048+
* @param v - degrees of freedom
1049+
* @param options - function options
1050+
* @throws distribution parameters and the output shape must be broadcast compatible
1051+
* @returns output ndarray
1052+
*
1053+
* @example
1054+
* var out = ns.t( [ 3, 3 ], 2.0 );
1055+
* // returns <ndarray>
1056+
*
1057+
* @example
1058+
* var zeros = require( '@stdlib/ndarray/zeros' );
1059+
*
1060+
* var out = zeros( [ 3, 3 ] );
1061+
* // returns <ndarray>
1062+
*
1063+
* var v = ns.t.assign( 2.0, out );
1064+
* // returns <ndarray>
1065+
*
1066+
* var bool = ( v === out );
1067+
* // returns true
1068+
*
1069+
* @example
1070+
* var random = ns.t.factory();
1071+
*
1072+
* var out = random( [ 3, 3 ], 2.0 );
1073+
* // returns <ndarray>
1074+
*/
1075+
t: typeof t;
1076+
8391077
/**
8401078
* Pseudorandom number generator ndarray creation function tools.
8411079
*/

0 commit comments

Comments
 (0)