Skip to content

xicor

pgxicor : XI Correlation Coefficient in Postgres

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
4670
xicor
pgxicor
0.1.1
FUNC
GPL-3.0
C
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--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

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
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 / PGPG18PG17PG16PG15PG14
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
PackageVersionOSORGSIZEFile URL
pgxicor_180.1.1el8.x86_64pigsty27.5 KiBpgxicor_18-0.1.1-1PIGSTY.el8.x86_64.rpm
pgxicor_180.1.1el8.aarch64pigsty27.6 KiBpgxicor_18-0.1.1-1PIGSTY.el8.aarch64.rpm
pgxicor_180.1.1el9.x86_64pigsty27.1 KiBpgxicor_18-0.1.1-1PIGSTY.el9.x86_64.rpm
pgxicor_180.1.1el9.aarch64pigsty26.9 KiBpgxicor_18-0.1.1-1PIGSTY.el9.aarch64.rpm
pgxicor_180.1.1el10.x86_64pigsty27.2 KiBpgxicor_18-0.1.1-1PIGSTY.el10.x86_64.rpm
pgxicor_180.1.1el10.aarch64pigsty27.2 KiBpgxicor_18-0.1.1-1PIGSTY.el10.aarch64.rpm
postgresql-18-pgxicor0.1.1d12.x86_64pigsty27.1 KiBpostgresql-18-pgxicor_0.1.1-1PIGSTY~bookworm_amd64.deb
postgresql-18-pgxicor0.1.1d12.aarch64pigsty26.8 KiBpostgresql-18-pgxicor_0.1.1-1PIGSTY~bookworm_arm64.deb
postgresql-18-pgxicor0.1.1d13.x86_64pigsty27.1 KiBpostgresql-18-pgxicor_0.1.1-1PIGSTY~trixie_amd64.deb
postgresql-18-pgxicor0.1.1d13.aarch64pigsty26.9 KiBpostgresql-18-pgxicor_0.1.1-1PIGSTY~trixie_arm64.deb
postgresql-18-pgxicor0.1.1u22.x86_64pigsty28.7 KiBpostgresql-18-pgxicor_0.1.1-1PIGSTY~jammy_amd64.deb
postgresql-18-pgxicor0.1.1u22.aarch64pigsty28.3 KiBpostgresql-18-pgxicor_0.1.1-1PIGSTY~jammy_arm64.deb
postgresql-18-pgxicor0.1.1u24.x86_64pigsty27.9 KiBpostgresql-18-pgxicor_0.1.1-1PIGSTY~noble_amd64.deb
postgresql-18-pgxicor0.1.1u24.aarch64pigsty27.5 KiBpostgresql-18-pgxicor_0.1.1-1PIGSTY~noble_arm64.deb
postgresql-18-pgxicor0.1.1u26.x86_64pigsty28.1 KiBpostgresql-18-pgxicor_0.1.1-1PIGSTY~resolute_amd64.deb
postgresql-18-pgxicor0.1.1u26.aarch64pigsty27.8 KiBpostgresql-18-pgxicor_0.1.1-1PIGSTY~resolute_arm64.deb

Source

pig build pkg pgxicor;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install 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 14

Create 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