{"id":34086088,"url":"https://github.com/privong/pymccorrelation","last_synced_at":"2026-04-10T10:04:07.426Z","repository":{"id":54374432,"uuid":"269100477","full_name":"privong/pymccorrelation","owner":"privong","description":"Correlation coefficients with uncertainties","archived":false,"fork":false,"pushed_at":"2024-02-23T19:57:23.000Z","size":77,"stargazers_count":11,"open_issues_count":7,"forks_count":4,"subscribers_count":1,"default_branch":"pymccorr","last_synced_at":"2025-11-07T10:06:36.026Z","etag":null,"topics":["bootstrapping-statistics","correlation-coefficient","monte-carlo"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/privong.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-06-03T13:49:16.000Z","updated_at":"2024-11-25T13:03:14.000Z","dependencies_parsed_at":"2024-02-26T18:46:32.476Z","dependency_job_id":null,"html_url":"https://github.com/privong/pymccorrelation","commit_stats":{"total_commits":81,"total_committers":5,"mean_commits":16.2,"dds":0.2592592592592593,"last_synced_commit":"61b5d0ebcc5711a8324de77be5b6282155b5eb01"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/privong/pymccorrelation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privong%2Fpymccorrelation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privong%2Fpymccorrelation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privong%2Fpymccorrelation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privong%2Fpymccorrelation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/privong","download_url":"https://codeload.github.com/privong/pymccorrelation/tar.gz/refs/heads/pymccorr","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privong%2Fpymccorrelation/sbom","scorecard":{"id":745584,"data":{"date":"2025-08-11","repo":{"name":"github.com/privong/pymccorrelation","commit":"c3d9964828baff4e1cc845236d0ecdb4b4fc800b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'pymccorr'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-22T18:36:31.732Z","repository_id":54374432,"created_at":"2025-08-22T18:36:31.732Z","updated_at":"2025-08-22T18:36:31.732Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31637749,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bootstrapping-statistics","correlation-coefficient","monte-carlo"],"created_at":"2025-12-14T13:22:19.290Z","updated_at":"2026-04-10T10:04:07.420Z","avatar_url":"https://github.com/privong.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pymccorrelation\n\nA tool to calculate correlation coefficients for data, using bootstrapping and/or perturbation to estimate the uncertainties on the correlation coefficient.\nThis was initially a python implementation of the [Curran (2014)](https://arxiv.org/abs/1411.3816) method for calculating uncertainties on Spearman's Rank Correlation Coefficient, but has since been expanded.\nCurran's original C implementation is [`MCSpearman`](https://github.com/PACurran/MCSpearman/) ([ASCL entry](http://ascl.net/1504.008)).\n\nCurrently the following correlation coefficients can be calculated (with bootstrapping and/or perturbation):\n\n* [Pearson's r](https://en.wikipedia.org/wiki/Pearson_correlation_coefficient)\n* [Spearman's rho](https://en.wikipedia.org/wiki/Spearman%27s_rank_correlation_coefficient)\n* [Kendall's tau](https://en.wikipedia.org/wiki/Kendall_rank_correlation_coefficient)\n\nKendall's tau can also calculated when some of the data are left/right censored, following the method described by [Isobe+1986](https://ui.adsabs.harvard.edu/abs/1986ApJ...306..490I/abstract).\n\n## Requirements\n\n- python3\n- scipy\n- numpy\n\n## Installation\n\n`pymccorrelation` is available via PyPi and can be installed with:\n\n```\npip install pymccorrelation\n```\n\n## Usage\n\n`pymccorrelation` exports a single function to the user (also called `pymccorrelation`).\n\n```\nfrom pymccorrelation import pymccorrelation\n\n[... load your data ...]\n```\n\nThe correlation coefficient can be one of `pearsonr`, `spearmanr`, or `kendallt`.\n\nFor example, to compute the Pearson's r for a sample, using 1000 bootstrapping iterations to estimate the uncertainties:\n\n```\nres = pymccorrelation(data['x'], data['y'],\n                      coeff='pearsonr',\n                      Nboot=1000)\n```\n\nThe output, `res` is a tuple of length 2, and the two elements are:\n\n* numpy array with the correlation coefficient (Pearson's r, in this case) percentiles (by default 16%, 50%, and 84%)\n* numpy array with the p-value percentiles (by default 16%, 50%, and 84%)\n\nThe percentile ranges can be adjusted using the `percentiles` keyword argument.\n\nAdditionally, if the full posterior distribution is desired, that can be obtained by setting the `return_dist` keyword argument to `True`.\nIn that case, `res` becomes a tuple of length four:\n\n* numpy array with the correlation coefficient (Pearson's r, in this case) percentiles (by default 16%, 50%, and 84%)\n* numpy array with the p-value percentiles (by default 16%, 50%, and 84%)\n* numpy array with full set of correlation coefficient values from the bootstrapping\n* numpy array with the full set of p-values computed from the bootstrapping\n\nPlease see the docstring for the full set of arguments and information including measurement uncertainties (necessary for point perturbation) and for marking censored data.\n\n## Citing\n\nIf you use this script as part of your research, I encourage you to cite the following papers:\n\n* [Curran 2014](https://arxiv.org/abs/1411.3816): Describes the technique and application to Spearman's rank correlation coefficient\n* [Privon+ 2020](https://ui.adsabs.harvard.edu/abs/2020ApJ...893..149P/abstract): First use of this software, as `pymcspearman`.\n\nPlease also cite [scipy](https://scipy.org/citing-scipy/) and [numpy](https://numpy.org/citing-numpy/).\n\n\nIf your work uses Kendall's tau with censored data please also cite:\n\n* [Isobe+ 1986](https://ui.adsabs.harvard.edu/abs/1986ApJ...306..490I/abstract): Censoring of data when computing Kendall's rank correlation coefficient.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprivong%2Fpymccorrelation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprivong%2Fpymccorrelation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprivong%2Fpymccorrelation/lists"}