Skip to content

xicor

XI Correlation Coefficient in Postgres

pgxicor · XI Correlation Coefficient in Postgres

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
4670xicorpgxicor0.1.1FUNCGPL-3.0C
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--s-d--NoYesNoYesnono
Relationships
See Alsoweighted_statistics pg_math vasco fbsql

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXTPIGSTY0.1.119 18 17 16 15pgxicor-
RPMPIGSTY0.1.119 18 17 16 15pgxicor_$v-
DEBPIGSTY0.1.119 18 17 16 15postgresql-$v-pgxicor-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1
el8.aarch64N/APIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1
el9.x86_64PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1
el9.aarch64PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1
el10.x86_64PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1
el10.aarch64PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1
d12.x86_64PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1
d12.aarch64PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1
d13.x86_64PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1
d13.aarch64PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1
u22.x86_64PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1
u22.aarch64PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1
u24.x86_64PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1
u24.aarch64PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1
u26.x86_64PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1
u26.aarch64PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1PIGSTY 0.1.1
PackageVersionOSORGSIZEFile URL
pgxicor_190.1.1el9.x86_64pigsty37.3 KiBpgxicor_19-0.1.1-1PGSTY.el9.x86_64.rpm
pgxicor_190.1.1el9.aarch64pigsty36.9 KiBpgxicor_19-0.1.1-1PGSTY.el9.aarch64.rpm
pgxicor_190.1.1el10.x86_64pigsty37.2 KiBpgxicor_19-0.1.1-1PGSTY.el10.x86_64.rpm
pgxicor_190.1.1el10.aarch64pigsty36.9 KiBpgxicor_19-0.1.1-1PGSTY.el10.aarch64.rpm
postgresql-19-pgxicor0.1.1d12.x86_64pigsty27.2 KiBpostgresql-19-pgxicor_0.1.1-1PGSTY~bookworm_amd64.deb
postgresql-19-pgxicor0.1.1d12.aarch64pigsty27.0 KiBpostgresql-19-pgxicor_0.1.1-1PGSTY~bookworm_arm64.deb
postgresql-19-pgxicor0.1.1d13.x86_64pigsty27.3 KiBpostgresql-19-pgxicor_0.1.1-1PGSTY~trixie_amd64.deb
postgresql-19-pgxicor0.1.1d13.aarch64pigsty27.1 KiBpostgresql-19-pgxicor_0.1.1-1PGSTY~trixie_arm64.deb
postgresql-19-pgxicor0.1.1u22.x86_64pigsty28.9 KiBpostgresql-19-pgxicor_0.1.1-1PGSTY~jammy_amd64.deb
postgresql-19-pgxicor0.1.1u22.aarch64pigsty28.5 KiBpostgresql-19-pgxicor_0.1.1-1PGSTY~jammy_arm64.deb
postgresql-19-pgxicor0.1.1u24.x86_64pigsty28.1 KiBpostgresql-19-pgxicor_0.1.1-1PGSTY~noble_amd64.deb
postgresql-19-pgxicor0.1.1u24.aarch64pigsty27.7 KiBpostgresql-19-pgxicor_0.1.1-1PGSTY~noble_arm64.deb
postgresql-19-pgxicor0.1.1u26.x86_64pigsty28.3 KiBpostgresql-19-pgxicor_0.1.1-1PGSTY~resolute_amd64.deb
postgresql-19-pgxicor0.1.1u26.aarch64pigsty28.0 KiBpostgresql-19-pgxicor_0.1.1-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
pgxicor_180.1.1el8.x86_64pigsty37.1 KiBpgxicor_18-0.1.1-1PGSTY.el8.x86_64.rpm
pgxicor_180.1.1el8.aarch64pigsty37.2 KiBpgxicor_18-0.1.1-1PGSTY.el8.aarch64.rpm
pgxicor_180.1.1el9.x86_64pigsty37.3 KiBpgxicor_18-0.1.1-1PGSTY.el9.x86_64.rpm
pgxicor_180.1.1el9.aarch64pigsty36.9 KiBpgxicor_18-0.1.1-1PGSTY.el9.aarch64.rpm
pgxicor_180.1.1el10.x86_64pigsty37.2 KiBpgxicor_18-0.1.1-1PGSTY.el10.x86_64.rpm
pgxicor_180.1.1el10.aarch64pigsty36.9 KiBpgxicor_18-0.1.1-1PGSTY.el10.aarch64.rpm
postgresql-18-pgxicor0.1.1d12.x86_64pigsty27.2 KiBpostgresql-18-pgxicor_0.1.1-1PGSTY~bookworm_amd64.deb
postgresql-18-pgxicor0.1.1d12.aarch64pigsty27.0 KiBpostgresql-18-pgxicor_0.1.1-1PGSTY~bookworm_arm64.deb
postgresql-18-pgxicor0.1.1d13.x86_64pigsty27.2 KiBpostgresql-18-pgxicor_0.1.1-1PGSTY~trixie_amd64.deb
postgresql-18-pgxicor0.1.1d13.aarch64pigsty27.1 KiBpostgresql-18-pgxicor_0.1.1-1PGSTY~trixie_arm64.deb
postgresql-18-pgxicor0.1.1u22.x86_64pigsty28.9 KiBpostgresql-18-pgxicor_0.1.1-1PGSTY~jammy_amd64.deb
postgresql-18-pgxicor0.1.1u22.aarch64pigsty28.5 KiBpostgresql-18-pgxicor_0.1.1-1PGSTY~jammy_arm64.deb
postgresql-18-pgxicor0.1.1u24.x86_64pigsty28.1 KiBpostgresql-18-pgxicor_0.1.1-1PGSTY~noble_amd64.deb
postgresql-18-pgxicor0.1.1u24.aarch64pigsty27.7 KiBpostgresql-18-pgxicor_0.1.1-1PGSTY~noble_arm64.deb
postgresql-18-pgxicor0.1.1u26.x86_64pigsty28.3 KiBpostgresql-18-pgxicor_0.1.1-1PGSTY~resolute_amd64.deb
postgresql-18-pgxicor0.1.1u26.aarch64pigsty27.9 KiBpostgresql-18-pgxicor_0.1.1-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
pgxicor_170.1.1el8.x86_64pigsty37.0 KiBpgxicor_17-0.1.1-1PGSTY.el8.x86_64.rpm
pgxicor_170.1.1el8.aarch64pigsty37.1 KiBpgxicor_17-0.1.1-1PGSTY.el8.aarch64.rpm
pgxicor_170.1.1el9.x86_64pigsty37.2 KiBpgxicor_17-0.1.1-1PGSTY.el9.x86_64.rpm
pgxicor_170.1.1el9.aarch64pigsty36.8 KiBpgxicor_17-0.1.1-1PGSTY.el9.aarch64.rpm
pgxicor_170.1.1el10.x86_64pigsty37.2 KiBpgxicor_17-0.1.1-1PGSTY.el10.x86_64.rpm
pgxicor_170.1.1el10.aarch64pigsty36.9 KiBpgxicor_17-0.1.1-1PGSTY.el10.aarch64.rpm
postgresql-17-pgxicor0.1.1d12.x86_64pigsty27.2 KiBpostgresql-17-pgxicor_0.1.1-1PGSTY~bookworm_amd64.deb
postgresql-17-pgxicor0.1.1d12.aarch64pigsty27.0 KiBpostgresql-17-pgxicor_0.1.1-1PGSTY~bookworm_arm64.deb
postgresql-17-pgxicor0.1.1d13.x86_64pigsty27.3 KiBpostgresql-17-pgxicor_0.1.1-1PGSTY~trixie_amd64.deb
postgresql-17-pgxicor0.1.1d13.aarch64pigsty27.1 KiBpostgresql-17-pgxicor_0.1.1-1PGSTY~trixie_arm64.deb
postgresql-17-pgxicor0.1.1u22.x86_64pigsty30.0 KiBpostgresql-17-pgxicor_0.1.1-1PGSTY~jammy_amd64.deb
postgresql-17-pgxicor0.1.1u22.aarch64pigsty29.5 KiBpostgresql-17-pgxicor_0.1.1-1PGSTY~jammy_arm64.deb
postgresql-17-pgxicor0.1.1u24.x86_64pigsty28.1 KiBpostgresql-17-pgxicor_0.1.1-1PGSTY~noble_amd64.deb
postgresql-17-pgxicor0.1.1u24.aarch64pigsty27.7 KiBpostgresql-17-pgxicor_0.1.1-1PGSTY~noble_arm64.deb
postgresql-17-pgxicor0.1.1u26.x86_64pigsty28.2 KiBpostgresql-17-pgxicor_0.1.1-1PGSTY~resolute_amd64.deb
postgresql-17-pgxicor0.1.1u26.aarch64pigsty27.9 KiBpostgresql-17-pgxicor_0.1.1-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
pgxicor_160.1.1el8.x86_64pigsty37.0 KiBpgxicor_16-0.1.1-1PGSTY.el8.x86_64.rpm
pgxicor_160.1.1el8.aarch64pigsty37.1 KiBpgxicor_16-0.1.1-1PGSTY.el8.aarch64.rpm
pgxicor_160.1.1el9.x86_64pigsty37.2 KiBpgxicor_16-0.1.1-1PGSTY.el9.x86_64.rpm
pgxicor_160.1.1el9.aarch64pigsty36.8 KiBpgxicor_16-0.1.1-1PGSTY.el9.aarch64.rpm
pgxicor_160.1.1el10.x86_64pigsty37.2 KiBpgxicor_16-0.1.1-1PGSTY.el10.x86_64.rpm
pgxicor_160.1.1el10.aarch64pigsty36.9 KiBpgxicor_16-0.1.1-1PGSTY.el10.aarch64.rpm
postgresql-16-pgxicor0.1.1d12.x86_64pigsty27.2 KiBpostgresql-16-pgxicor_0.1.1-1PGSTY~bookworm_amd64.deb
postgresql-16-pgxicor0.1.1d12.aarch64pigsty27.0 KiBpostgresql-16-pgxicor_0.1.1-1PGSTY~bookworm_arm64.deb
postgresql-16-pgxicor0.1.1d13.x86_64pigsty27.3 KiBpostgresql-16-pgxicor_0.1.1-1PGSTY~trixie_amd64.deb
postgresql-16-pgxicor0.1.1d13.aarch64pigsty27.1 KiBpostgresql-16-pgxicor_0.1.1-1PGSTY~trixie_arm64.deb
postgresql-16-pgxicor0.1.1u22.x86_64pigsty30.0 KiBpostgresql-16-pgxicor_0.1.1-1PGSTY~jammy_amd64.deb
postgresql-16-pgxicor0.1.1u22.aarch64pigsty29.5 KiBpostgresql-16-pgxicor_0.1.1-1PGSTY~jammy_arm64.deb
postgresql-16-pgxicor0.1.1u24.x86_64pigsty28.1 KiBpostgresql-16-pgxicor_0.1.1-1PGSTY~noble_amd64.deb
postgresql-16-pgxicor0.1.1u24.aarch64pigsty27.7 KiBpostgresql-16-pgxicor_0.1.1-1PGSTY~noble_arm64.deb
postgresql-16-pgxicor0.1.1u26.x86_64pigsty28.2 KiBpostgresql-16-pgxicor_0.1.1-1PGSTY~resolute_amd64.deb
postgresql-16-pgxicor0.1.1u26.aarch64pigsty27.9 KiBpostgresql-16-pgxicor_0.1.1-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
pgxicor_150.1.1el8.x86_64pigsty37.1 KiBpgxicor_15-0.1.1-1PGSTY.el8.x86_64.rpm
pgxicor_150.1.1el8.aarch64pigsty37.2 KiBpgxicor_15-0.1.1-1PGSTY.el8.aarch64.rpm
pgxicor_150.1.1el9.x86_64pigsty37.5 KiBpgxicor_15-0.1.1-1PGSTY.el9.x86_64.rpm
pgxicor_150.1.1el9.aarch64pigsty37.2 KiBpgxicor_15-0.1.1-1PGSTY.el9.aarch64.rpm
pgxicor_150.1.1el10.x86_64pigsty37.4 KiBpgxicor_15-0.1.1-1PGSTY.el10.x86_64.rpm
pgxicor_150.1.1el10.aarch64pigsty37.4 KiBpgxicor_15-0.1.1-1PGSTY.el10.aarch64.rpm
postgresql-15-pgxicor0.1.1d12.x86_64pigsty27.3 KiBpostgresql-15-pgxicor_0.1.1-1PGSTY~bookworm_amd64.deb
postgresql-15-pgxicor0.1.1d12.aarch64pigsty27.0 KiBpostgresql-15-pgxicor_0.1.1-1PGSTY~bookworm_arm64.deb
postgresql-15-pgxicor0.1.1d13.x86_64pigsty27.3 KiBpostgresql-15-pgxicor_0.1.1-1PGSTY~trixie_amd64.deb
postgresql-15-pgxicor0.1.1d13.aarch64pigsty27.1 KiBpostgresql-15-pgxicor_0.1.1-1PGSTY~trixie_arm64.deb
postgresql-15-pgxicor0.1.1u22.x86_64pigsty30.1 KiBpostgresql-15-pgxicor_0.1.1-1PGSTY~jammy_amd64.deb
postgresql-15-pgxicor0.1.1u22.aarch64pigsty29.9 KiBpostgresql-15-pgxicor_0.1.1-1PGSTY~jammy_arm64.deb
postgresql-15-pgxicor0.1.1u24.x86_64pigsty28.2 KiBpostgresql-15-pgxicor_0.1.1-1PGSTY~noble_amd64.deb
postgresql-15-pgxicor0.1.1u24.aarch64pigsty28.1 KiBpostgresql-15-pgxicor_0.1.1-1PGSTY~noble_arm64.deb
postgresql-15-pgxicor0.1.1u26.x86_64pigsty28.4 KiBpostgresql-15-pgxicor_0.1.1-1PGSTY~resolute_amd64.deb
postgresql-15-pgxicor0.1.1u26.aarch64pigsty28.3 KiBpostgresql-15-pgxicor_0.1.1-1PGSTY~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 by package name
pig install xicor;		# install by extension name

pig install xicor -v 19;   # install for PG 19
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

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.

Table reader