https://github.com/arvindrajan92/polymoment
High-order Moments of Multivariate Polynomials
https://github.com/arvindrajan92/polymoment
analytical method-of-moments moments polynomial polynomials
Last synced: 5 months ago
JSON representation
High-order Moments of Multivariate Polynomials
- Host: GitHub
- URL: https://github.com/arvindrajan92/polymoment
- Owner: arvindrajan92
- License: mit
- Created: 2022-08-28T14:20:25.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-10-29T22:42:37.000Z (over 3 years ago)
- Last Synced: 2025-09-09T10:37:07.902Z (9 months ago)
- Topics: analytical, method-of-moments, moments, polynomial, polynomials
- Language: Python
- Homepage:
- Size: 136 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# PolyMoment: High-order Moments of Multivariate Polynomials
***PolyMoment is now an online tool at [http://polymoment.com/](http://polymoment.com/).***
This is the implementation of the thesis: [Moment-Based Uncertainty Propagation Using Multivariate Polynomials: Advances in Probabilistic Engineering Design](https://bridges.monash.edu/articles/thesis/Moment-Based_Uncertainty_Propagation_Using_Multivariate_Polynomials_Advances_in_Probabilistic_Engineering_Design/6998936).
## Usage
The example below demonstrates how `PolyMoment` can be used to compute the high-order moment, mean, variance, standard deviation, skewness, or kurtosis of polynomial `x0^2+x1^2` with random variables `x0` and `x1` following normal distribution with means `m0` and `m1`, respectively, and standard deviations `s0` and `s1`, respectively.
The supported distributions and their respective probability density functions can be found in [this file](ProbabilityDensityFunction.pdf).
```python
from polymoment import PolyMoment
pm = PolyMoment(
poly='x0**2+x1**2',
dist={
'x0': {
'distribution': 'normal', # str
'type': 'symmetrical', # str
'translation': 'm0', # str | float
'scale': 's0', # str | float
'beta1': None, # str | float
'beta2': None, # str | float
},
'x1': {
'distribution': 'normal', # str
'type': 'symmetrical', # str
'translation': 'm1', # str | float
'scale': 's1', # str | float
'beta1': None, # str | float
'beta2': None, # str | float
}
}
)
# mean
print(pm.mean())
# variance
print(pm.var())
# standard deviation
print(pm.std())
# skewness
print(pm.skew())
# kurtosis (excess kurtosis + 3)
print(pm.kurt())
# n-th order moment of poly
print(pm.moment(order=1))
```
## Supported Distribution Types
```python
'symmetrical',
'one_sided_right',
'one_sided_left'
```
## Supported Distributions
Further information on the probability density functions listed below can be found in [this file](https://github.com/arvindrajan92/polymoment/blob/master/ProbabilityDensityFunction.pdf).
```python
'uniform',
'trapezoidal',
'triangular',
'beta',
'normal',
'student',
'laplace',
'gamma',
'weibull',
'maxwell'
```