weighted_statistics
High-performance weighted statistics functions for sparse data
Repository
schmidni/pg_weighted_statistics
https://github.com/schmidni/pg_weighted_statistics
Source
pg_weighted_statistics-1.0.0.tar.gz
pg_weighted_statistics-1.0.0.tar.gz
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_weighted_statistics | 1.0.0 | FUNC | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 4680 | weighted_statistics | No | Yes | No | Yes | No | Yes | - |
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.0.0 | 1817161514 | pg_weighted_statistics | - |
| RPM | PIGSTY | 1.0.0 | 1817161514 | pg_weighted_statistics_$v | - |
| DEB | PIGSTY | 1.0.0 | 1817161514 | postgresql-$v-weighted-statistics | - |
Build
You can build the RPM / DEB packages for pg_weighted_statistics using pig build:
Install
You can install pg_weighted_statistics directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Install
pig
dnf
apt
Create Extension:
Usage
weighted_statistics: weighted statistical functions for PostgreSQL
High-performance C extension providing weighted statistical functions with automatic sparse data handling (when sum(weights) < 1.0).
Functions
| Function | Description |
|---|---|
weighted_mean(values[], weights[]) | Weighted mean |
weighted_variance(values[], weights[], ddof) | Weighted variance (ddof: 0=population, 1=sample) |
weighted_std(values[], weights[], ddof) | Weighted standard deviation |
weighted_quantile(values[], weights[], quantiles[]) | Empirical CDF quantiles |
wquantile(values[], weights[], quantiles[]) | Type 7 (Hyndman-Fan) quantiles |
whdquantile(values[], weights[], quantiles[]) | Harrell-Davis quantiles |
weighted_median(values[], weights[]) | 50th percentile shortcut (empirical CDF) |
Examples
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)