xicor

XI Correlation Coefficient in Postgres

Overview

PackageVersionCategoryLicenseLanguage
pgxicor0.1.0FUNCGPL-3.0C
IDExtensionBinLibLoadCreateTrustRelocSchema
4670xicorNoYesNoYesYesYes-
Relatedpg_idkit pgx_ulid pg_uuidv7 permuteseq pg_hashids sequential_uuids topn quantile

Version

TypeRepoVersionPG VerPackageDeps
EXTPIGSTY0.1.01817161514pgxicor-
RPMPIGSTY0.1.01817161514pgxicor_$v-
DEBPIGSTY0.1.01817161514postgresql-$v-pgxicor-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
el8.aarch64
el9.x86_64
el9.aarch64
el10.x86_64
el10.aarch64
d12.x86_64
d12.aarch64
d13.x86_64
d13.aarch64
PIGSTY 0.1.0
PIGSTY 0.1.0
PIGSTY 0.1.0
PIGSTY 0.1.0
PIGSTY 0.1.0
u22.x86_64
PIGSTY 0.1.0
PIGSTY 0.1.0
PIGSTY 0.1.0
PIGSTY 0.1.0
PIGSTY 0.1.0
u22.aarch64
PIGSTY 0.1.0
PIGSTY 0.1.0
PIGSTY 0.1.0
PIGSTY 0.1.0
PIGSTY 0.1.0
u24.x86_64
PIGSTY 0.1.0
PIGSTY 0.1.0
PIGSTY 0.1.0
PIGSTY 0.1.0
PIGSTY 0.1.0
u24.aarch64
PIGSTY 0.1.0
PIGSTY 0.1.0
PIGSTY 0.1.0
PIGSTY 0.1.0
PIGSTY 0.1.0

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

xicor: XI correlation coefficient for PostgreSQL

Provides the XI (xi) correlation coefficient, which can detect functional relationships between X and Y – a more powerful alternative to corr(X, Y) that works beyond linear relationships.

CREATE EXTENSION xicor;

Functions

FunctionDescription
xicor(x, y)Compute the XI correlation coefficient between two variables

Configuration

For reproducible results with tied data:

SET xicor.ties = true;
SET xicor.seed = 42;

Examples

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;

Last Modified 2026-03-12: add pg extension catalog (95749bf)