Means
Means, Aggregation functions…
Documentation:
English: https://wgalka.github.io/Means/en/
Aggregations functions are: - Conjuctive - the final aggregated value will always be influenced by the smallest value among the inputs. - Disjnuctive - the aggregated value will always be influenced by the largest value among the inputs.
Example 1:
# example data
data = [0.2, 0.6, 0.7]
# configure function parameters
func1 = A_amn(p=0.5)
# use aggregation funciton
print(func1(data))
# Combine two aggregations - arithmetic mean and minimum
func2 = Combine2Aggregations(A_ar(), min)
# use combination of aggregation funciton
print(func2(data))
Example2:
To get information about aggregation function you can use __str__() or ‘repr()’ methods.
func1 = A_amn(p=0.5)
print(func1)
>>>A_amn(0.5)
func2 = Combine2Aggregations(A_ar(), A_md())
print(func2)
>>>A_armd
func3 = Combine2Aggregations(A_ar(), A_pw(r=3))
print(func3.__repr__()) # function parameters are printed in order: func1, func2
>>>A_arpw(r=3)
Aggregation functions
Aggregation function [1] is a mapping \(A:[0,1]^n\to[0,1]\), \(n \in \mathbb{N}\), \(n\ge 2\) which is is increasing and fulfills two boundary conditions, namely \(A(0,\dots,0) = 0\), \(A(1,\dots,1) = 1\).
The floowoing aggregation functions are implemented in this library:
\(\mathbf{A_{ar}}\) - Arithmetic mean
\(\mathbf{A_{qd}}\) - Quadratic mean
\(\mathbf{A_{pr}}\) - Product aggregation
\(\mathbf{A_{gm}}\) - Geometric mean
\(\mathbf{A_{hm}}\) - Harmonic mean
\(\mathbf{A_{pw}^{(r)}}\) - Power mean
special cases of power means \(A_{\text{pw}}^r\) [1] are: - Arithmetic Mean where r=1; - Quadratic Mean where r=2; - Harmonic Mean where r=-1; - Geometric Mean obtained as the limit \(\lim_{r \to 0} A_{\text{pw}}^r\).
\(\mathbf{A_{ex}^{(r)}}\) - Exponential mean
For computer implementations, to avoid numerical instability (overflow when \(r x_k > 709.78\) or underflow when all \(r x_k < -709.78\)), we use a numerically stable Log-Sum-Exp formulation by shifting the exponents by \(a_{max} = \max_{j} (r x_j)\):
\(\mathbf{A_{lm}}\) - Lehmer mean
\(\mathbf{A_{amn}^{(p)}}\) - Arithmetic minimum mean
\(\mathbf{A_{amx}^{(p)}}\) - Arithmetic maximum mean
OWA
In the case of n = 2 (when only two values are aggregated) the calculation of the median and the Olympic aggregation are reduced to the case of calculating the arithmetic mean of the given values.
\(\mathbf{A_{md}}\) - Median - ordered weighted aggregation
\(\mathbf{A_{ol}}\) - Olimpic aggregation
\(\mathbf{A_{oln}^{(p)}}\) - Olimpic aggregation
We can specify how many greatest and smallest records remove
\(\mathbf{A_{ln}}\) - Logaritmic aggregation [2]
\(\mathbf{A^{(p)}_{A_1,A_2}}\) - Convex combinations of aggregation functions
We can construct covex combination of aggregation functions as \(A^{(p)}_{A_1,A_2}=pA_1+(1-p)A_2\), where \(A_1, A_2\) are aggregation functions and \(p \in [0,1]\).
References
Beliakov, G., Bustince, H., and Calvo, T.: A practical Guide to Averaging Functions. Berlin: Springer Vol. 329, 2016.
Mustonen, Seppo. (2010). Logarithmic mean for several arguments.
Metadata
Release files for aggregationslib 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aggregationslib-0.1.7.tar.gz | 13.9 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aggregationslib-0.1.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.9 MB
Release files / aggregationslib-0.1.7.tar.gz
| Download URL | aggregationslib-0.1.7.tar.gz |
|---|---|
| Size | 13.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
45b1b7142617fe5027343425f1969627a70e2a8a268045c491d0781726db0fce
|
|
BLAKE2b-256 checksum How to use checksums |
b789e46509468ac3c8351f4d3e612e47d837d11eab18965bc615f4138750a08a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.5
|
Release files / aggregationslib-0.1.7-py3-none-any.whl
| Download URL | aggregationslib-0.1.7-py3-none-any.whl |
|---|---|
| Size | 20.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7ede16289be5321184779dfe17c8aa5e4c96b3b52e6b5341892793101b805406
|
|
BLAKE2b-256 checksum How to use checksums |
3ef45886382b5371b9632cf15dd37701fd10e2683e86782efd13eff3e5ad3bf4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.5
|