Skip to content

docs: update REPL namespace documentation #2427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/node_modules/@stdlib/repl/help/data/data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -5178,7 +5178,7 @@ trythenAsync,"\ntrythenAsync( x, y, done )\n If a function does not return an
ttest,"\nttest( x[, y][, options] )\n Computes a one-sample or paired Student's t test.\n\n When no `y` is supplied, the function performs a one-sample t-test for the\n null hypothesis that the data in array or typed array `x` is drawn from a\n normal distribution with mean zero and unknown variance.\n\n When array or typed array `y` is supplied, the function tests whether the\n differences `x - y` come from a normal distribution with mean zero and\n unknown variance via the paired t-test.\n\n The returned object comes with a `.print()` method which when invoked will\n print a formatted output of the results of the hypothesis test.\n\n Parameters\n ----------\n x: Array<number>\n Data array.\n\n y: Array<number> (optional)\n Paired data array.\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.alternative: string (optional)\n Indicates whether the alternative hypothesis is that the mean of `x` is\n larger than `mu` (`greater`), smaller than `mu` (`less`) or equal to\n `mu` (`two-sided`). Default: `'two-sided'`.\n\n options.mu: number (optional)\n Hypothesized true mean under the null hypothesis. Set this option to\n test whether the data comes from a distribution with the specified `mu`.\n Default: `0`.\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.ci: Array<number>\n 1-alpha confidence interval for the mean.\n\n out.nullValue: number\n Assumed mean under H0 (or difference in means when `y` is supplied).\n\n out.alternative: string\n Alternative hypothesis (`two-sided`, `less` or `greater`).\n\n out.df: number\n Degrees of freedom.\n\n out.mean: number\n Sample mean of `x` or `x - y`, respectively.\n\n out.sd: number\n Standard error of the mean.\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 // One-sample t-test:\n > var rnorm = base.random.normal.factory( 0.0, 2.0, { 'seed': 5776 } );\n > var x = new Array( 100 );\n > for ( var i = 0; i < x.length; i++ ) {\n ... x[ i ] = rnorm();\n ... }\n > var out = ttest( x )\n {\n rejected: false,\n pValue: ~0.722,\n statistic: ~0.357,\n ci: [~-0.333,~0.479],\n // ...\n }\n\n // Paired t-test:\n > rnorm = base.random.normal.factory( 1.0, 2.0, { 'seed': 786 } );\n > x = new Array( 100 );\n > var y = new Array( 100 );\n > for ( i = 0; i < x.length; i++ ) {\n ... x[ i ] = rnorm();\n ... y[ i ] = rnorm();\n ... }\n > out = ttest( x, y )\n {\n rejected: false,\n pValue: ~0.191,\n statistic: ~1.315,\n ci: [ ~-0.196, ~0.964 ],\n // ...\n }\n\n // Print formatted output:\n > var table = out.print()\n Paired t-test\n\n Alternative hypothesis: True difference in means is not equal to 0\n\n pValue: 0.1916\n statistic: 1.3148\n df: 99\n 95% confidence interval: [-0.1955,0.9635]\n\n Test Decision: Fail to reject null in favor of alternative at 5%\n significance level\n\n // Choose custom significance level:\n > arr = [ 2, 4, 3, 1, 0 ];\n > out = ttest( arr, { 'alpha': 0.01 } );\n > table = out.print()\n One-sample t-test\n\n Alternative hypothesis: True mean is not equal to 0\n\n pValue: 0.0474\n statistic: 2.8284\n df: 4\n 99% confidence interval: [-1.2556,5.2556]\n\n Test Decision: Fail to reject null in favor of alternative at 1%\n significance level\n\n // Test for a mean equal to five:\n > var arr = [ 4, 4, 6, 6, 5 ];\n > out = ttest( arr, { 'mu': 5 } )\n {\n rejected: false,\n pValue: 1,\n statistic: 0,\n ci: [ ~3.758, ~6.242 ],\n // ...\n }\n\n // Perform one-sided tests:\n > arr = [ 4, 4, 6, 6, 5 ];\n > out = ttest( arr, { 'alternative': 'less' } );\n > table = out.print()\n One-sample t-test\n\n Alternative hypothesis: True mean is less than 0\n\n pValue: 0.9998\n statistic: 11.1803\n df: 4\n 95% confidence interval: [-Infinity,5.9534]\n\n Test Decision: Fail to reject null in favor of alternative at 5%\n significance level\n\n > out = ttest( arr, { 'alternative': 'greater' } );\n > table = out.print()\n One-sample t-test\n\n Alternative hypothesis: True mean is greater than 0\n\n pValue: 0.0002\n statistic: 11.1803\n df: 4\n 95% confidence interval: [4.0466,Infinity]\n\n Test Decision: Reject null in favor of alternative at 5% significance level\n\n See Also\n --------\n ttest2\n"
ttest2,"\nttest2( x, y[, options] )\n Computes a two-sample Student's t test.\n\n By default, the function performs a two-sample t-test for the null\n hypothesis that the data in arrays or typed arrays `x` and `y` is\n independently drawn from normal distributions with equal means.\n\n The returned object comes with a `.print()` method which when invoked will\n print a formatted output of the results of the hypothesis test.\n\n Parameters\n ----------\n x: Array<number>\n First data array.\n\n y: Array<number>\n Second data array.\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.alternative: string (optional)\n Either `two-sided`, `less` or `greater`. Indicates whether the\n alternative hypothesis is that `x` has a larger mean than `y`\n (`greater`), `x` has a smaller mean than `y` (`less`) or the means are\n the same (`two-sided`). Default: `'two-sided'`.\n\n options.difference: number (optional)\n Number denoting the difference in means under the null hypothesis.\n Default: `0`.\n\n options.variance: string (optional)\n String indicating if the test should be conducted under the assumption\n that the unknown variances of the normal distributions are `equal` or\n `unequal`. As a default choice, the function carries out the Welch test\n (using the Satterthwaite approximation for the degrees of freedom),\n which does not have the requirement that the variances of the underlying\n distributions are equal. If the equal variances assumption seems\n warranted, set the option to `equal`. Default: `unequal`.\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.ci: Array<number>\n 1-alpha confidence interval for the mean.\n\n out.nullValue: number\n Assumed difference in means under H0.\n\n out.xmean: number\n Sample mean of `x`.\n\n out.ymean: number\n Sample mean of `y`.\n\n out.alternative: string\n Alternative hypothesis (`two-sided`, `less` or `greater`).\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 // Student's sleep data:\n > var x = [ 0.7, -1.6, -0.2, -1.2, -0.1, 3.4, 3.7, 0.8, 0.0, 2.0 ];\n > var y = [ 1.9, 0.8, 1.1, 0.1, -0.1, 4.4, 5.5, 1.6, 4.6, 3.4 ];\n > var out = ttest2( x, y )\n {\n rejected: false,\n pValue: ~0.079,\n statistic: ~-1.861,\n ci: [ ~-3.365, ~0.205 ],\n // ...\n }\n\n // Print table output:\n > var table = out.print()\n Welch two-sample t-test\n\n Alternative hypothesis: True difference in means is not equal to 0\n\n pValue: 0.0794\n statistic: -1.8608\n 95% confidence interval: [-3.3655,0.2055]\n\n Test Decision: Fail to reject null in favor of alternative at 5%\n significance level\n\n // Choose a different significance level than `0.05`:\n > out = ttest2( x, y, { 'alpha': 0.1 } );\n > table = out.print()\n Welch two-sample t-test\n\n Alternative hypothesis: True difference in means is not equal to 0\n\n pValue: 0.0794\n statistic: -1.8608\n 90% confidence interval: [-3.0534,-0.1066]\n\n Test Decision: Reject null in favor of alternative at 10% significance level\n\n // Perform one-sided tests:\n > out = ttest2( x, y, { 'alternative': 'less' } );\n > table = out.print()\n Welch two-sample t-test\n\n Alternative hypothesis: True difference in means is less than 0\n\n pValue: 0.0397\n statistic: -1.8608\n df: 17.7765\n 95% confidence interval: [-Infinity,-0.1066]\n\n Test Decision: Reject null in favor of alternative at 5% significance level\n\n > out = ttest2( x, y, { 'alternative': 'greater' } );\n > table = out.print()\n Welch two-sample t-test\n\n Alternative hypothesis: True difference in means is greater than 0\n\n pValue: 0.9603\n statistic: -1.8608\n df: 17.7765\n 95% confidence interval: [-3.0534,Infinity]\n\n Test Decision: Fail to reject null in favor of alternative at 5%\n significance level\n\n // Run tests with equal variances assumption:\n > x = [ 2, 3, 1, 4 ];\n > y = [ 1, 2, 3, 1, 2, 5, 3, 4 ];\n > out = ttest2( x, y, { 'variance': 'equal' } );\n > table = out.print()\n Two-sample t-test\n\n Alternative hypothesis: True difference in means is not equal to 0\n\n pValue: 0.8848\n statistic: -0.1486\n df: 10\n 95% confidence interval: [-1.9996,1.7496]\n\n Test Decision: Fail to reject null in favor of alternative at 5%\n significance level\n\n // Test for a difference in means besides zero:\n > var rnorm = base.random.normal.factory({ 'seed': 372 } );\n > x = new Array( 100 );\n > for ( i = 0; i < x.length; i++ ) {\n ... x[ i ] = rnorm( 2.0, 3.0 );\n ... }\n > y = new Array( 100 );\n > for ( i = 0; i < x.length; i++ ) {\n ... y[ i ] = rnorm( 1.0, 3.0 );\n ... }\n > out = ttest2( x, y, { 'difference': 1.0, 'variance': 'equal' } )\n {\n rejected: false,\n pValue: ~0.642,\n statistic: ~-0.466,\n ci: [ ~-0.0455, ~1.646 ],\n // ...\n }\n\n See Also\n --------\n ttest\n"
TWO_PI,"\nTWO_PI\n The mathematical constant `π` times `2`.\n\n Examples\n --------\n > TWO_PI\n 6.283185307179586\n\n See Also\n --------\n PI\n"
typedarray,"\ntypedarray( [dtype] )\n Creates a typed array.\n\n The function supports the following data types:\n\n - float64: double-precision floating-point numbers (IEEE 754)\n - float32: single-precision floating-point numbers (IEEE 754)\n - complex128: double-precision complex floating-point numbers\n - complex64: single-precision complex floating-point numbers\n - int32: 32-bit two's complement signed integers\n - uint32: 32-bit unsigned integers\n - int16: 16-bit two's complement signed integers\n - uint16: 16-bit unsigned integers\n - int8: 8-bit two's complement signed integers\n - uint8: 8-bit unsigned integers\n - uint8c: 8-bit unsigned integers clamped to 0-255\n\n The default typed array data type is `float64`.\n\n Parameters\n ----------\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray\n A typed array.\n\n Examples\n --------\n > var arr = typedarray()\n <Float64Array>\n > arr = typedarray( 'float32' )\n <Float32Array>\n\n\ntypedarray( length[, dtype] )\n Returns a typed array having a specified length.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray\n A typed array.\n\n Examples\n --------\n > var arr = typedarray( 5 )\n <Float64Array>[ 0.0, 0.0, 0.0, 0.0, 0.0 ]\n > arr = typedarray( 5, 'int32' )\n <Int32Array>[ 0, 0, 0, 0, 0 ]\n\n\ntypedarray( typedarray[, dtype] )\n Creates a typed array from another typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate another typed array.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray\n A typed array.\n\n Examples\n --------\n > var arr1 = typedarray( [ 0.5, 0.5, 0.5 ] );\n > var arr2 = typedarray( arr1, 'float32' )\n <Float32Array>[ 0.5, 0.5, 0.5 ]\n\n\ntypedarray( obj[, dtype] )\n Creates a typed array from an array-like object or iterable.\n\n Parameters\n ----------\n obj: Object\n Array-like object or iterable from which to generate a typed array.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray\n A typed array.\n\n Examples\n --------\n > var arr1 = [ 0.5, 0.5, 0.5 ];\n > var arr2 = typedarray( arr1, 'float32' )\n <Float32Array>[ 0.5, 0.5, 0.5 ]\n\n\ntypedarray( buffer[, byteOffset[, length]][, dtype] )\n Returns a typed array view of an ArrayBuffer.\n\n Parameters\n ----------\n buffer: ArrayBuffer\n Underlying ArrayBuffer.\n\n byteOffset: integer (optional)\n Integer byte offset specifying the location of the first typed array\n element. Default: 0.\n\n length: integer (optional)\n View length. If not provided, the view spans from the byteOffset to\n the end of the underlying ArrayBuffer.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray\n A typed array.\n\n Examples\n --------\n > var buf = new ArrayBuffer( 16 );\n > var arr = typedarray( buf, 0, 4, 'float32' )\n <Float32Array>[ 0.0, 0.0, 0.0, 0.0 ]\n\n See Also\n --------\n Complex128Array, Complex64Array, Float64Array, Float32Array, Int32Array, Uint32Array, Int16Array, Uint16Array, Int8Array, Uint8Array, Uint8ClampedArray\n"
typedarray,"\ntypedarray( [dtype] )\n Creates a typed array.\n\n Parameters\n ----------\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray\n A typed array.\n\n Examples\n --------\n > var arr = typedarray()\n <Float64Array>\n > arr = typedarray( 'float32' )\n <Float32Array>\n\n\ntypedarray( length[, dtype] )\n Returns a typed array having a specified length.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray\n A typed array.\n\n Examples\n --------\n > var arr = typedarray( 5 )\n <Float64Array>[ 0.0, 0.0, 0.0, 0.0, 0.0 ]\n > arr = typedarray( 5, 'int32' )\n <Int32Array>[ 0, 0, 0, 0, 0 ]\n\n\ntypedarray( typedarray[, dtype] )\n Creates a typed array from another typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate another typed array.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray\n A typed array.\n\n Examples\n --------\n > var arr1 = typedarray( [ 0.5, 0.5, 0.5 ] );\n > var arr2 = typedarray( arr1, 'float32' )\n <Float32Array>[ 0.5, 0.5, 0.5 ]\n\n\ntypedarray( obj[, dtype] )\n Creates a typed array from an array-like object or iterable.\n\n Parameters\n ----------\n obj: Object\n Array-like object or iterable from which to generate a typed array.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray\n A typed array.\n\n Examples\n --------\n > var arr1 = [ 0.5, 0.5, 0.5 ];\n > var arr2 = typedarray( arr1, 'float32' )\n <Float32Array>[ 0.5, 0.5, 0.5 ]\n\n\ntypedarray( buffer[, byteOffset[, length]][, dtype] )\n Returns a typed array view of an ArrayBuffer.\n\n Parameters\n ----------\n buffer: ArrayBuffer\n Underlying ArrayBuffer.\n\n byteOffset: integer (optional)\n Integer byte offset specifying the location of the first typed array\n element. Default: 0.\n\n length: integer (optional)\n View length. If not provided, the view spans from the byteOffset to\n the end of the underlying ArrayBuffer.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray\n A typed array.\n\n Examples\n --------\n > var buf = new ArrayBuffer( 16 );\n > var arr = typedarray( buf, 0, 4, 'float32' )\n <Float32Array>[ 0.0, 0.0, 0.0, 0.0 ]\n\n See Also\n --------\n Complex128Array, Complex64Array, Float64Array, Float32Array, Int32Array, Uint32Array, Int16Array, Uint16Array, Int8Array, Uint8Array, Uint8ClampedArray\n"
typedarray2json,"\ntypedarray2json( arr )\n Returns a JSON representation of a typed array.\n\n The following typed array types are supported:\n\n - Float64Array\n - Float32Array\n - Int32Array\n - Uint32Array\n - Int16Array\n - Uint16Array\n - Int8Array\n - Uint8Array\n - Uint8ClampedArray\n - Complex64Array\n - Complex128Array\n - BooleanArray\n\n The returned JSON object has the following properties:\n\n - type: typed array type\n - data: typed array data as a generic array\n\n The implementation supports custom typed arrays and sets the `type` field to\n the closest known typed array type.\n\n Parameters\n ----------\n arr: TypedArray\n Typed array to serialize.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var arr = new Float64Array( 2 );\n > arr[ 0 ] = 5.0;\n > arr[ 1 ] = 3.0;\n > var json = typedarray2json( arr )\n { 'type': 'Float64Array', 'data': [ 5.0, 3.0 ] }\n\n See Also\n --------\n reviveTypedArray\n"
typedarrayCtors,"\ntypedarrayCtors( dtype )\n Returns a typed array constructor.\n\n The function returns constructors for the following data types:\n\n - float32: single-precision floating-point numbers.\n - float64: double-precision floating-point numbers.\n - complex64: single-precision complex floating-point numbers.\n - complex128: double-precision complex floating-point numbers.\n - bool: boolean values.\n - int16: signed 16-bit integers.\n - int32: signed 32-bit integers.\n - int8: signed 8-bit integers.\n - uint16: unsigned 16-bit integers.\n - uint32: unsigned 32-bit integers.\n - uint8: unsigned 8-bit integers.\n - uint8c: unsigned clamped 8-bit integers.\n\n Parameters\n ----------\n dtype: string\n Data type.\n\n Returns\n -------\n out: Function|null\n Typed array constructor.\n\n Examples\n --------\n > var ctor = typedarrayCtors( 'float64' )\n <Function>\n > ctor = typedarrayCtors( 'float' )\n null\n\n See Also\n --------\n arrayCtors\n"
typedarrayDataTypes,"\ntypedarrayDataTypes()\n Returns a list of typed array data types.\n\n Returns\n -------\n out: Array<string>\n List of typed array data types.\n\n Examples\n --------\n > var out = typedarrayDataTypes()\n <Array>\n\n See Also\n --------\n arrayDataTypes, ndarrayDataTypes\n"
Expand Down
2 changes: 1 addition & 1 deletion lib/node_modules/@stdlib/repl/help/data/data.json

Large diffs are not rendered by default.

Loading