-
-
Notifications
You must be signed in to change notification settings - Fork 856
feat: add stats/base/ndarray/dcovarmtk
#7692
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
base: develop
Are you sure you want to change the base?
feat: add stats/base/ndarray/dcovarmtk
#7692
Conversation
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: passed - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
Coverage Report
The above coverage report was generated for the changes in this PR. |
Signed-off-by: Gururaj Gurram <143020143+gururaj1512@users.noreply.github.com>
Signed-off-by: Gururaj Gurram <143020143+gururaj1512@users.noreply.github.com>
Signed-off-by: Gururaj Gurram <143020143+gururaj1512@users.noreply.github.com>
lib/node_modules/@stdlib/stats/base/ndarray/dcovarmtk/README.md
Outdated
Show resolved
Hide resolved
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
4. a zero-dimensional ndarray specifying mean of the first one-dimensional ndarray. | ||
5. a zero-dimensional ndarray specifying mean of the second one-dimensional ndarray. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4. a zero-dimensional ndarray specifying mean of the first one-dimensional ndarray. | |
5. a zero-dimensional ndarray specifying mean of the second one-dimensional ndarray. | |
4. a zero-dimensional ndarray specifying the mean of the first one-dimensional ndarray. | |
5. a zero-dimensional ndarray specifying the mean of the second one-dimensional ndarray. |
|
||
1. first one-dimensional input ndarray. | ||
2. second one-dimensional input ndarray. | ||
3. a zero-dimensional ndarray specifying degrees of freedom adjustment. Setting this parameter to a value other than `0` has the effect of adjusting the divisor during the calculation of the [covariance][covariance] according to `N-c` where `c` corresponds to the provided degrees of freedom adjustment. When computing the population [covariance][covariance], setting this parameter to `0` is the standard choice (i.e., the provided arrays contain data constituting entire populations). When computing the unbiased sample [covariance][covariance], setting this parameter to `1` is the standard choice (i.e., the provided arrays contain data sampled from larger populations; this is commonly referred to as Bessel's correction). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3. a zero-dimensional ndarray specifying degrees of freedom adjustment. Setting this parameter to a value other than `0` has the effect of adjusting the divisor during the calculation of the [covariance][covariance] according to `N-c` where `c` corresponds to the provided degrees of freedom adjustment. When computing the population [covariance][covariance], setting this parameter to `0` is the standard choice (i.e., the provided arrays contain data constituting entire populations). When computing the unbiased sample [covariance][covariance], setting this parameter to `1` is the standard choice (i.e., the provided arrays contain data sampled from larger populations; this is commonly referred to as Bessel's correction). | |
3. a zero-dimensional ndarray specifying the degrees of freedom adjustment. Setting this parameter to a value other than `0` has the effect of adjusting the divisor during the calculation of the [covariance][covariance] according to `N-c` where `c` corresponds to the provided degrees of freedom adjustment and `N` corresponds to the number of elements in each input ndarray. When computing the population [covariance][covariance], setting this parameter to `0` is the standard choice (i.e., the provided arrays contain data constituting entire populations). When computing the unbiased sample [covariance][covariance], setting this parameter to `1` is the standard choice (i.e., the provided arrays contain data sampled from larger populations; this is commonly referred to as Bessel's correction). |
|
||
- If provided an empty one-dimensional ndarray, the function returns `NaN`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- If provided an empty one-dimensional ndarray, the function returns `NaN`. | |
- Both input ndarrays should have the same number of elements. | |
- If provided empty one-dimensional ndarrays, the function returns `NaN`. |
// Create first one-dimensional ndarray containing pseudorandom integers drawn from a discrete uniform distribution: | ||
var xbuf = discreteUniform( 10, -50, 50, opts ); | ||
var x = new ndarray( opts.dtype, xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' ); | ||
console.log( ndarray2array( x ) ); | ||
|
||
// Create second one-dimensional ndarray containing pseudorandom integers drawn from a discrete uniform distribution: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Create first one-dimensional ndarray containing pseudorandom integers drawn from a discrete uniform distribution: | |
var xbuf = discreteUniform( 10, -50, 50, opts ); | |
var x = new ndarray( opts.dtype, xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' ); | |
console.log( ndarray2array( x ) ); | |
// Create second one-dimensional ndarray containing pseudorandom integers drawn from a discrete uniform distribution: | |
// Create one-dimensional ndarrays containing pseudorandom numbers: | |
var xbuf = discreteUniform( 10, -50, 50, opts ); | |
var x = new ndarray( opts.dtype, xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' ); | |
console.log( ndarray2array( x ) ); | |
Computes the covariance of two one-dimensional double-precision | ||
floating-point ndarrays provided known means and using a one-pass textbook | ||
algorithm. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Computes the covariance of two one-dimensional double-precision | |
floating-point ndarrays provided known means and using a one-pass textbook | |
algorithm. | |
Computes the covariance of two one-dimensional double-precision floating- | |
point ndarrays provided known means and using a one-pass textbook algorithm. |
floating-point ndarrays provided known means and using a one-pass textbook | ||
algorithm. | ||
|
||
If provided an empty ndarray, the function returns `NaN`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should update to match README notes.
- a zero-dimensional ndarray specifying degrees of freedom | ||
adjustment. Setting this parameter to a value other than `0` has the | ||
effect of adjusting the divisor during the calculation of the | ||
covariance according to `N-c` where `c` corresponds to the provided |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be updated to match README suggestion.
- a zero-dimensional ndarray specifying mean of the first | ||
one-dimensional ndarray. | ||
- a zero-dimensional ndarray specifying mean of the second | ||
one-dimensional ndarray. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- a zero-dimensional ndarray specifying mean of the first | |
one-dimensional ndarray. | |
- a zero-dimensional ndarray specifying mean of the second | |
one-dimensional ndarray. | |
- a zero-dimensional ndarray specifying the mean of the first one- | |
dimensional ndarray. | |
- a zero-dimensional ndarray specifying the mean of the second one- | |
dimensional ndarray. |
* | ||
* - first one-dimensional input ndarray. | ||
* - second one-dimensional input ndarray. | ||
* - a zero-dimensional ndarray specifying degrees of freedom adjustment. Setting this parameter to a value other than `0` has the effect of adjusting the divisor during the calculation of the covariance according to `N-c` where `c` corresponds to the provided degrees of freedom adjustment. When computing the population covariance, setting this parameter to `0` is the standard choice (i.e., the provided arrays contain data constituting entire populations). When computing the unbiased sample covariance, setting this parameter to `1` is the standard choice (i.e., the provided arrays contain data sampled from larger populations; this is commonly referred to as Bessel's correction). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should update to match README suggestion.
* - a zero-dimensional ndarray specifying mean of the first one-dimensional ndarray. | ||
* - a zero-dimensional ndarray specifying mean of the second one-dimensional ndarray. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* - a zero-dimensional ndarray specifying mean of the first one-dimensional ndarray. | |
* - a zero-dimensional ndarray specifying mean of the second one-dimensional ndarray. | |
* - a zero-dimensional ndarray specifying the mean of the first one-dimensional ndarray. | |
* - a zero-dimensional ndarray specifying the mean of the second one-dimensional ndarray. |
'dtype': 'float64' | ||
}; | ||
|
||
// Create first one-dimensional ndarray containing pseudorandom integers drawn from a discrete uniform distribution: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same changes as README.
* | ||
* - first one-dimensional input ndarray. | ||
* - second one-dimensional input ndarray. | ||
* - a zero-dimensional ndarray specifying degrees of freedom adjustment. Setting this parameter to a value other than `0` has the effect of adjusting the divisor during the calculation of the covariance according to `N-c` where `c` corresponds to the provided degrees of freedom adjustment. When computing the population covariance, setting this parameter to `0` is the standard choice (i.e., the provided arrays contain data constituting entire populations). When computing the unbiased sample covariance, setting this parameter to `1` is the standard choice (i.e., the provided arrays contain data sampled from larger populations; this is commonly referred to as Bessel's correction). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should update to match README suggestion.
* - a zero-dimensional ndarray specifying mean of the first one-dimensional ndarray. | ||
* - a zero-dimensional ndarray specifying mean of the second one-dimensional ndarray. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* - a zero-dimensional ndarray specifying mean of the first one-dimensional ndarray. | |
* - a zero-dimensional ndarray specifying mean of the second one-dimensional ndarray. | |
* - a zero-dimensional ndarray specifying the mean of the first one-dimensional ndarray. | |
* - a zero-dimensional ndarray specifying the mean of the second one-dimensional ndarray. |
{ | ||
"name": "@stdlib/stats/base/ndarray/dcovarmtk", | ||
"version": "0.0.0", | ||
"description": "Computes the covariance of two one-dimensional double-precision floating-point ndarrays provided known means and using a one-pass textbook algorithm.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"description": "Computes the covariance of two one-dimensional double-precision floating-point ndarrays provided known means and using a one-pass textbook algorithm.", | |
"description": "Compute the covariance of two one-dimensional double-precision floating-point ndarrays provided known means and using a one-pass textbook algorithm.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few nits. Once addressed, should be ready.
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes. report:
Resolves None
Description
This pull request:
stats/base/ndarray/dcovarmtk
Related Issues
This pull request:
Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers