xicor
xicor
pgxicor : XI Correlation Coefficient in Postgres
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 4670 | xicor | pgxicor | 0.1.0 | FUNC | GPL-3.0 | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
--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
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.1.0 | 18 17 16 15 14 | pgxicor | - |
| RPM | PIGSTY | 0.1.0 | 18 17 16 15 14 | pgxicor_$v | - |
| DEB | PIGSTY | 0.1.0 | 18 17 16 15 14 | postgresql-$v-pgxicor | - |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
el8.x86_64 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 |
el8.aarch64 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 |
el9.x86_64 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 |
el9.aarch64 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 |
el10.x86_64 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 |
el10.aarch64 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 |
d12.x86_64 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 |
d12.aarch64 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 |
d13.x86_64 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 | PIGSTY 0.1.0 |
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 |
Source
pig build pkg pgxicor; # build rpm/debInstall
Make sure PGDG and PIGSTY repo available:
pig repo add pgsql -u # add both repo and update cacheInstall 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 14Create this extension with:
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;Last updated on