xicor
XI Correlation Coefficient in Postgres
Repository
Florents-Tselai/pgxicor
https://github.com/Florents-Tselai/pgxicor
Source
pgxicor-0.1.0.tar.gz
pgxicor-0.1.0.tar.gz
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pgxicor | 0.1.0 | 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.0 | 1817161514 | pgxicor | - |
| RPM | PIGSTY | 0.1.0 | 1817161514 | pgxicor_$v | - |
| DEB | PIGSTY | 0.1.0 | 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
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
| Function | Description |
|---|---|
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;
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.