跳转到主要内容

xicor

在PG中计算XI相关系数

pgxicor · 在PG中计算XI相关系数

概览

ID扩展软件包版本类别许可证编程语言
4670xicorpgxicor0.1.1FUNCGPL-3.0C
属性可执行文件动态库需要预加载需要建扩展可迁移可信
--s-d--否是否是否否

软件包

类型仓库版本兼容的 PostgreSQL 大版本包名模式依赖
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
软件包版本平台仓库大小下载
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
软件包版本平台仓库大小下载
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
软件包版本平台仓库大小下载
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
软件包版本平台仓库大小下载
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
软件包版本平台仓库大小下载
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

源码

pig build pkg pgxicor;		# build rpm/deb

安装

启用 PGDG 和 PIGSTY 仓库并更新缓存。

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

使用 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 EXTENSION xicor;

用法

来源:README, release 0.1.1

xicor 将 XI(Chatterjee’s xi)相关系数暴露为 PostgreSQL 聚合函数。它适合检测函数依赖,包括 Pearson corr() 可能遗漏的非线性关系。

CREATE EXTENSION xicor;

主要聚合

SELECT xicor(x, y) FROM xicor_test;

上游示例把它与抛物线数据集上的 corr() 对比:corr() 接近零,而 xicor() 仍然较高。

示例

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;

可复现性控制

对于存在 ties 的数据,上游建议开启确定性 tie 处理:

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

注意事项

  • xicor() 是双数值输入的聚合函数,不是通用统计框架。
  • ties 的处理方式会影响结果;如果需要可复现行为,请启用文档中的 GUC。

表格阅读器