{"id":26228239,"url":"https://github.com/florents-tselai/pgxicor","last_synced_at":"2025-04-19T16:43:19.253Z","repository":{"id":275044331,"uuid":"924638361","full_name":"Florents-Tselai/pgxicor","owner":"Florents-Tselai","description":"XI (ξ) Correlation Coefficient in Postgres","archived":false,"fork":false,"pushed_at":"2025-02-18T10:17:51.000Z","size":34,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T23:43:45.264Z","etag":null,"topics":["aggregate","correlation","sql","statistics"],"latest_commit_sha":null,"homepage":"https://tselai.com/pgxicor","language":"C","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/Florents-Tselai.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2025-01-30T11:36:45.000Z","updated_at":"2025-02-18T10:17:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"0dfaf918-72b6-45b9-bd4a-f01ca5f4a23b","html_url":"https://github.com/Florents-Tselai/pgxicor","commit_stats":null,"previous_names":["florents-tselai/pgxicor"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Florents-Tselai%2Fpgxicor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Florents-Tselai%2Fpgxicor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Florents-Tselai%2Fpgxicor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Florents-Tselai%2Fpgxicor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Florents-Tselai","download_url":"https://codeload.github.com/Florents-Tselai/pgxicor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249740675,"owners_count":21318699,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["aggregate","correlation","sql","statistics"],"created_at":"2025-03-12T20:39:55.980Z","updated_at":"2025-04-19T16:43:19.228Z","avatar_url":"https://github.com/Florents-Tselai.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pgxicor: XI (ξ) Correlation Coefficient in Postgres\n\n[![build](https://github.com/Florents-Tselai/pgxicor/actions/workflows/build.yml/badge.svg)](https://github.com/Florents-Tselai/pgxicor/actions/workflows/build.yml)\n![GitHub Repo stars](https://img.shields.io/github/stars/Florents-Tselai/pgxicor)\n\u003ca href=\"https://hub.docker.com/repository/docker/florents/pgxicor\"\u003e\u003cimg alt=\"Docker Pulls\" src=\"https://img.shields.io/docker/pulls/florents/pgxicor\"\u003e\u003c/a\u003e\n\n**pgxicor** is a Postgres extension that exposes a `SELECT xicor(X, Y)` aggregate function.\nXI can detect functional relationships between X and Y.\nYou can use it as a more powerful alternative to standard `corr(X, Y)` which works best on linear relationships only.\n\nFor more information on XI, see the original paper.\n[A New Coefficient of Correlation S. Chatterjee 2020](https://gwern.net/doc/statistics/order/2020-chatterjee.pdf)\n\n## Usage\n\n```tsql\nCREATE TABLE xicor_test (x float8, y float8);\nINSERT INTO xicor_test (x, y)\nVALUES\n    (1.0, 2.0),\n    (2.5, 3.5),\n    (3.0, 4.0),\n    (4.5, 5.5),\n    (5.0, 6.0);\n\n-- Query to calculate the Xi correlation using the aggregate function\nSELECT xicor(x, y) FROM xicor_test;\n```\n\nIf your data contains ties and you want 100% reproducible results, you should also set the following.\n\n```sql\nSET xicor.ties = true;\nSET xicor.seed = 42;\n```\n\n\u003e [!TIP]\n\u003e If you're interested in this, also check out\n\u003e [vasco](https://github.com/Florents-Tselai/vasco); another similar extension based on the Maximal Information Coefficient (MIC).\n\u003e A standalone C implementation of ξ is also available [libxicor](https://github.com/Florents-Tselai/libxicor).\n\n## Installation\n\n```\ncd /tmp\ngit clone https://github.com/Florents-Tselai/pgxicor.git\ncd pgxicor\nmake\nmake install # may need sudo\n```\n\nAfter the installation, in a session:\n\n```tsql\nCREATE EXTENSION xicor;\n```\n\n### Docker\n\nGet the [Docker image](https://hub.docker.com/r/florents/pgxicor) with:\n\n```sh\ndocker pull florents/pgxicor:pg17\n```\n\nThis adds pgxicor to the [Postgres image](https://hub.docker.com/_/postgres) (replace `17` with your Postgres server version, and run it the same way).\n\nRun the image in a container.\n\n```sh\ndocker run --name pgxicor -p 5432:5432 -e POSTGRES_PASSWORD=pass florents/pgxicor:pg17\n```\n\nThrough another terminal, connect to the running server (container).\n\n```sh\nPGPASSWORD=pass psql -h localhost -p 5432 -U postgres\n```\n\n### PGXN\n\nInstall from the [PostgreSQL Extension Network](https://pgxn.org/dist/pgxicor) with:\n\n```sh\npgxn install pgxicor\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflorents-tselai%2Fpgxicor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflorents-tselai%2Fpgxicor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflorents-tselai%2Fpgxicor/lists"}