xicor
xicor
pgxicor : XI Correlation Coefficient in Postgres
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 4670 | xicor | pgxicor | 0.1.1 | FUNC | GPL-3.0 | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
--s-dtr | No | Yes | No | Yes | yes | yes |
| Relationships | |
|---|---|
| See Also | pg_idkit pgx_ulid pg_uuidv7 permuteseq pg_hashids sequential_uuids topn quantile |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.1.1 | 18 17 16 15 14 | pgxicor | - |
| RPM | PIGSTY | 0.1.1 | 18 17 16 15 14 | pgxicor_$v | - |
| DEB | PIGSTY | 0.1.1 | 18 17 16 15 14 | postgresql-$v-pgxicor | - |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
el8.x86_64 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 |
el8.aarch64 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 |
el9.x86_64 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 |
el9.aarch64 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 |
el10.x86_64 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 |
el10.aarch64 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 |
d12.x86_64 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 |
d12.aarch64 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 |
d13.x86_64 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 |
d13.aarch64 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 |
u22.x86_64 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 |
u22.aarch64 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 |
u24.x86_64 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 |
u24.aarch64 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 |
u26.x86_64 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 |
u26.aarch64 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 |
Source
pig build pkg pgxicor; # build rpm/debInstall
Make sure PGDG and PIGSTY repo available:
pig repo add pgsql -u # add both repo and update cacheInstall this extension with pig:
pig install pgxicor; # install via package name, for the active PG version
pig install xicor; # install by extension name, for the current active PG version
pig install xicor -v 18; # install for PG 18
pig install xicor -v 17; # install for PG 17
pig install xicor -v 16; # install for PG 16
pig install xicor -v 15; # install for PG 15
pig install xicor -v 14; # install for PG 14Create this extension with:
CREATE EXTENSION xicor;Usage
Sources: README, release 0.1.1
xicor exposes the XI (Chatterjee’s xi) correlation coefficient as a PostgreSQL aggregate. It is meant for detecting functional dependence, including non-linear relationships that Pearson’s corr() can miss.
CREATE EXTENSION xicor;Main Aggregate
SELECT xicor(x, y) FROM xicor_test;The upstream example contrasts it with corr() on a parabola-shaped dataset, where corr() is near zero while xicor() remains high.
Example
CREATE TABLE xicor_test (x float8, y float8);
INSERT INTO xicor_test (x, y) VALUES
(1.0, 2.0),
(2.5, 3.5),
(3.0, 4.0),
(4.5, 5.5),
(5.0, 6.0);
SELECT xicor(x, y) FROM xicor_test;Reproducibility Controls
For tied data, upstream recommends enabling deterministic tie handling:
SET xicor.ties = true;
SET xicor.seed = 42;Caveats
xicor()is an aggregate over two numeric inputs, not a general-purpose statistical framework.- Tie handling can change results unless you enable the documented GUCs for reproducible behavior.
Last updated on