xicor
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pgxicor | 0.1.1 | FUNC | GPL-3.0 | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 4670 | xicor | No | Yes | No | Yes | Yes | Yes | - |
| Related | pg_idkit pgx_ulid pg_uuidv7 permuteseq pg_hashids sequential_uuids topn quantile |
|---|
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.1.1 | 1817161514 | pgxicor | - |
| RPM | PIGSTY | 0.1.1 | 1817161514 | pgxicor_$v | - |
| DEB | PIGSTY | 0.1.1 | 1817161514 | postgresql-$v-pgxicor | - |
Build
You can build the RPM / DEB packages for pgxicor using pig build:
pig build pkg pgxicor # build RPM / DEB packages
Install
You can install pgxicor directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
pig repo add pgsql -u # Add repo and update cache
Install the extension using pig or apt/yum/dnf:
pig install pgxicor; # Install for current active PG version
pig ext install -y pgxicor -v 18 # PG 18
pig ext install -y pgxicor -v 17 # PG 17
pig ext install -y pgxicor -v 16 # PG 16
pig ext install -y pgxicor -v 15 # PG 15
pig ext install -y pgxicor -v 14 # PG 14
dnf install -y pgxicor_18 # PG 18
dnf install -y pgxicor_17 # PG 17
dnf install -y pgxicor_16 # PG 16
dnf install -y pgxicor_15 # PG 15
dnf install -y pgxicor_14 # PG 14
apt install -y postgresql-18-pgxicor # PG 18
apt install -y postgresql-17-pgxicor # PG 17
apt install -y postgresql-16-pgxicor # PG 16
apt install -y postgresql-15-pgxicor # PG 15
apt install -y postgresql-14-pgxicor # PG 14
Create Extension:
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.
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.