Skip to content

Commit e9f4eaa

Browse files
committed
Update REPL help
1 parent a90c07a commit e9f4eaa

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

lib/node_modules/@stdlib/repl/lib/docs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,8 +588,8 @@ module.exports = {
588588
"capitalize": "\ncapitalize( str )\n Capitalizes the first character in a `string`.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n Capitalized string.\n\n Examples\n --------\n > var out = capitalize( 'beep' )\n 'Beep'\n > out = capitalize( 'Boop' )\n 'Boop'\n\n See Also\n --------\n uncapitalize, uppercase\n",
589589
"CATALAN": "\nCATALAN\n Catalan's constant.\n\n Examples\n --------\n > CATALAN\n 0.915965594177219\n\n",
590590
"chi2gof": "\nchi2gof( x, y[, ...params][, opts] )\n Performs a chi-square goodness-of-fit test.\n\n For an array or typed array of integers `x`, a chi-square goodness-of-fit is\n computed for the null hypothesis that the values of `x` come from the\n discrete distribution specified by `y`. `y` can be an `array` of expected\n frequencies, an `array` of population probabilities that sum to one, or a\n string with the name of the discrete distribution to test against. In the\n latter case, the parameters of the distribution must be supplied as\n additional arguments after `y`. The function returns an object holding the\n calculated test statistic, the p-value of the test, as well as the test\n decision.\n\n By default, the p-value is computed using a chi-square distribution with\n `k - 1` degrees of freedom, where `k` is the number of levels of `x`. In\n case distribution parameters were estimated for the calculation of `y`, the\n degrees of freedom have to be corrected. The `ddof` option can be set to use\n `n - ddof - 1` degrees of freedom.\n\n The chi-square approximation may be incorrect if the observed or expected\n frequencies in each category are too small. It is common to require\n frequencies greater than five.\n\n Instead of relying on the chi-square approximation when calculating the\n p-value, Monte Carlo simulation can be used. To do so, set the `simulate`\n option. The simulation is carried out by resampling from the discrete\n distribution given by `y`. By default, `500` iterations are used for the\n simulation. To set a custom number of iterations, use the `iterations`\n option.\n\n Parameters\n ----------\n x: Array<number>\n Observation frequencies.\n\n y: Array<number>|string\n Array of expected values or probabilities or a string denoting the name\n of a distribution.\n\n params: ...number (optional)\n Distribution parameters passed to mean function.\n\n options: Object (optional)\n Options.\n\n options.alpha: number (optional)\n Number in the interval `[0,1]` giving the significance level of the\n hypothesis test. Default: `0.05`.\n\n options.ddof: number (optional)\n Nonnegative integer giving the \"delta degrees of freedom\" adjustment.\n Default: `0`.\n\n options.simulate: boolean (optional)\n Boolean indicating whether to compute p-values by Monte Carlo\n simulation. The simulation is carried out by resampling from the\n discrete distribution given by `p`. Default: `false`.\n\n options.iterations: number (optional)\n Positive integer specifying the number of Monte Carlo iterations.\n Default: `500`.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Used significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n P-value of the test.\n\n out.statistic: number\n Value of test statistic.\n\n out.df: number\n Degrees of freedom.\n\n out.method: string\n Name of test.\n\n out.print: function\n Function to print formatted output.\n\n Examples\n --------\n // Use probabilities for `y`:\n > var x = [ 89, 37, 30, 28, 2 ];\n > var p = [ 0.40, 0.20, 0.20, 0.15, 0.05 ];\n > var out = chi2gof( x, p )\n { 'pValue': ~0.0406, 'statistic': ~9.9901, ... }\n > var table = out.print()\n Null hypothesis: population probabilities are equal to those in p\n pValue: 0.0406\n statistic: 9.9901\n degrees of freedom: 4\n Test Decision: Reject null in favor of alternative at 5% significance level\n\n // Set significance level:\n > out = chi2gof( x, p, { 'alpha': 0.01 });\n > table = out.print()\n Chi-square goodness-of-fit test\n\n Null hypothesis: population probabilities are equal to those in p\n\n pValue: 0.0406\n statistic: 9.9901\n degrees of freedom: 4\n\n Test Decision: Fail to reject null in favor of alternative at 1%\n significance level\n\n // Calculate the p-value via Monte Carlo simulation:\n > var x = [ 89, 37, 30, 28, 2 ];\n > var p = [ 0.40, 0.20, 0.20, 0.15, 0.05 ];\n > var out = chi2gof( x, p, { 'simulate': true, 'iterations': 1000 })\n {...}\n\n // Verify that data comes from Poisson distribution:\n > var lambda = 3.0;\n > var rpois = base.random.poisson.factory( lambda );\n > var len = 400;\n > x = new Array( len );\n > for ( var i = 0; i < len; i++ ) { x[ i ] = rpois(); }\n // Generate frequency table:\n > var freqs = [];\n > for ( i = 0; i < len; i++ ) {\n ... val = x[ i ];\n ... freqs[ val ] === void 0 ? freqs[ val ] = 1 : freqs[ val ] += 1;\n ... }\n // Fill holes in array:\n > for ( i = 0; i < freqs.length; i++ ) {\n ... if ( freqs[ i ] === void 0 ) { freqs[ i ] = 0; }\n ... }\n > out = chi2gof( freqs, 'poisson', lambda );\n {...}\n\n",
591-
"Complex64": "\nComplex64( real, imag )\n 64-bit complex number constructor.\n\n Both the real and imaginary components are stored as single-precision\n floating-point numbers.\n\n Parameters\n ----------\n real: number\n Real component.\n\n imag: number\n Imaginary component.\n\n Returns\n -------\n z: Complex64\n 64-bit complex number.\n\n z.real: number\n Read-only property returning the real component.\n\n z.imag: number\n Read-only property returning the imaginary component.\n\n Examples\n --------\n > var z = Complex64( 5.0, 3.0 )\n <Complex64>\n > z.real\n 5.0\n > z.imag\n 3.0\n\n See Also\n --------\n Complex128\n",
592-
"Complex128": "\nComplex128( real, imag )\n 128-bit complex number constructor.\n\n Both the real and imaginary components are stored as double-precision\n floating-point numbers.\n\n Parameters\n ----------\n real: number\n Real component.\n\n imag: number\n Imaginary component.\n\n Returns\n -------\n z: Complex128\n 128-bit complex number.\n\n z.real: number\n Read-only property returning the real component.\n\n z.imag: number\n Read-only property returning the imaginary component.\n\n Examples\n --------\n > var z = Complex128( 5.0, 3.0 )\n <Complex128>\n > z.real\n 5.0\n > z.imag\n 3.0\n\n See Also\n --------\n Complex64\n",
591+
"Complex64": "\nComplex64( real, imag )\n 64-bit complex number constructor.\n\n Both the real and imaginary components are stored as single-precision\n floating-point numbers.\n\n Parameters\n ----------\n real: number\n Real component.\n\n imag: number\n Imaginary component.\n\n Returns\n -------\n z: Complex64\n 64-bit complex number.\n\n z.re: number\n Read-only property returning the real component.\n\n z.im: number\n Read-only property returning the imaginary component.\n\n z.BYTES_PER_ELEMENT\n Size (in bytes) of each component. Value: 4.\n\n z.byteLength\n Length (in bytes) of a complex number. Value: 8.\n\n Examples\n --------\n > var z = Complex64( 5.0, 3.0 )\n <Complex64>\n > z.re\n 5.0\n > z.im\n 3.0\n\n See Also\n --------\n Complex128\n",
592+
"Complex128": "\nComplex128( real, imag )\n 128-bit complex number constructor.\n\n Both the real and imaginary components are stored as double-precision\n floating-point numbers.\n\n Parameters\n ----------\n real: number\n Real component.\n\n imag: number\n Imaginary component.\n\n Returns\n -------\n z: Complex128\n 128-bit complex number.\n\n z.re: number\n Read-only property returning the real component.\n\n z.im: number\n Read-only property returning the imaginary component.\n\n z.BYTES_PER_ELEMENT\n Size (in bytes) of each component. Value: 8.\n\n z.byteLength\n Length (in bytes) of a complex number. Value: 16.\n\n Examples\n --------\n > var z = Complex128( 5.0, 3.0 )\n <Complex128>\n > z.re\n 5.0\n > z.im\n 3.0\n\n See Also\n --------\n Complex64\n",
593593
"compose": "\ncompose( ...f )\n Function composition.\n\n Returns a composite function. Starting from the right, the composite\n function evaluates each function and passes the result as an argument\n to the next function. The result of the leftmost function is the result\n of the whole.\n\n Notes:\n\n - Only the rightmost function is explicitly permitted to accept multiple\n arguments. All other functions are evaluated as unary functions.\n - The function will throw if provided fewer than two input arguments.\n\n Parameters\n ----------\n f: ...Function\n Functions to compose.\n\n Returns\n -------\n out: Function\n Composite function.\n\n Examples\n --------\n > function a( x ) {\n ... return 2 * x;\n ... }\n > function b( x ) {\n ... return x + 3;\n ... }\n > function c( x ) {\n ... return x / 5;\n ... }\n > var f = compose( c, b, a );\n > var z = f( 6 )\n 3\n\n See Also\n --------\n composeAsync\n",
594594
"composeAsync": "\ncomposeAsync( ...f )\n Function composition.\n\n Returns a composite function. Starting from the right, the composite\n function evaluates each function and passes the result as the first argument\n of the next function. The result of the leftmost function is the result\n of the whole.\n\n The last argument for each provided function is a `next` callback which\n should be invoked upon function completion. The callback accepts two\n arguments:\n\n - `error`: error argument\n - `result`: function result\n\n If a composed function calls the `next` callback with a truthy `error`\n argument, the composite function suspends execution and immediately calls\n the `done` callback for subsequent `error` handling.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n Only the rightmost function is explicitly permitted to accept multiple\n arguments. All other functions are evaluated as binary functions.\n\n The function will throw if provided fewer than two input arguments.\n\n Parameters\n ----------\n f: ...Function\n Functions to compose.\n\n Returns\n -------\n out: Function\n Composite function.\n\n Examples\n --------\n > function a( x, next ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... next( null, 2*x );\n ... }\n ... };\n > function b( x, next ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... next( null, x+3 );\n ... }\n ... };\n > function c( x, next ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... next( null, x/5 );\n ... }\n ... };\n > var f = composeAsync( c, b, a );\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > f( 6, done )\n 3\n\n See Also\n --------\n compose\n",
595595
"constantFunction": "\nconstantFunction( val )\n Creates a function which always returns the same value.\n\n Notes:\n\n - When provided an object reference, the returned `function` always returns\n the same reference.\n\n Parameters\n ----------\n val: any\n Value to always return.\n\n Returns\n -------\n out: Function\n Constant function.\n\n Examples\n --------\n > var fcn = constantFunction( 3.14 );\n > var v = fcn()\n 3.14\n > v = fcn()\n 3.14\n > v = fcn()\n 3.14\n\n See Also\n --------\n identity\n",

lib/node_modules/@stdlib/repl/lib/examples.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,8 +588,8 @@ module.exports = {
588588
"capitalize": "out = capitalize( 'beep' )\nout = capitalize( 'Boop' )\n",
589589
"CATALAN": "CATALAN\n",
590590
"chi2gof": "\n// Use probabilities for `y`:\nx = [ 89, 37, 30, 28, 2 ];\np = [ 0.40, 0.20, 0.20, 0.15, 0.05 ];\nout = chi2gof( x, p )\ntable = out.print()\n\n// Set significance level:\nout = chi2gof( x, p, { 'alpha': 0.01 });\ntable = out.print()\n\n// Calculate the p-value via Monte Carlo simulation:\nx = [ 89, 37, 30, 28, 2 ];\np = [ 0.40, 0.20, 0.20, 0.15, 0.05 ];\nout = chi2gof( x, p, { 'simulate': true, 'iterations': 1000 })\n\n// Verify that data comes from Poisson distribution:\nlambda = 3.0;\nrpois = base.random.poisson.factory( lambda );\nlen = 400;\nx = new Array( len );\nfor ( var i = 0; i < len; i++ ) { x[ i ] = rpois(); }\n\n// Generate frequency table:\nfreqs = [];\nfor ( i = 0; i < len; i++ ) {\n val = x[ i ];\n freqs[ val ] === void 0 ? freqs[ val ] = 1 : freqs[ val ] += 1;\n}\n\n// Fill holes in array:\nfor ( i = 0; i < freqs.length; i++ ) {\n if ( freqs[ i ] === void 0 ) { freqs[ i ] = 0; }\n}\nout = chi2gof( freqs, 'poisson', lambda );\n",
591-
"Complex64": "z = Complex64( 5.0, 3.0 )\nz.real\nz.imag\n",
592-
"Complex128": "z = Complex128( 5.0, 3.0 )\nz.real\nz.imag\n",
591+
"Complex64": "z = Complex64( 5.0, 3.0 )\nz.re\nz.im\n",
592+
"Complex128": "z = Complex128( 5.0, 3.0 )\nz.re\nz.im\n",
593593
"compose": "function a( x ) {\n return 2 * x;\n}\nfunction b( x ) {\n return x + 3;\n}\nfunction c( x ) {\n return x / 5;\n}\nf = compose( c, b, a );\nz = f( 6 )\n",
594594
"composeAsync": "function a( x, next ) {\n setTimeout( onTimeout, 0 );\n function onTimeout() {\n next( null, 2*x );\n }\n};\nfunction b( x, next ) {\n setTimeout( onTimeout, 0 );\n function onTimeout() {\n next( null, x+3 );\n }\n};\nfunction c( x, next ) {\n setTimeout( onTimeout, 0 );\n function onTimeout() {\n next( null, x/5 );\n }\n};\nf = composeAsync( c, b, a );\nfunction done( error, result ) {\n if ( error ) {\n throw error;\n }\n console.log( result );\n};\nf( 6, done )\n",
595595
"constantFunction": "fcn = constantFunction( 3.14 );\nv = fcn()\nv = fcn()\nv = fcn()\n",

0 commit comments

Comments
 (0)