jonathf / chaospy

Chaospy - Toolbox for performing uncertainty quantification.
https://chaospy.readthedocs.io/
MIT License
433 stars 87 forks source link

Question about obtain the skewness and kurtosis of PCE #417

Open zhangshengwangBJUT opened 3 months ago

zhangshengwangBJUT commented 3 months ago

Hi Jonathan, I am a new user of chaospy, and my study is about using PCE to build a surrogate model of limit state function and then performing reliability analysis. Thanks for providing and maintaining such excellent UQ software.

Recently, I am interested in the higher order moments of PCE. I am very happy to find that chaospy can obtain the skewness and kurtosis of polynomials directly. I would like to know how to implement it in your code (only 13 lines code in Source code for chaospy.descriptives.skewness? ) and do you have some references equations or papers.

I have learned that one of the great advantages of PCE is that once the coefficients have been solved for, statistical information about PCE such as the first four orders of moments can be obtained from the coefficients. Among them, the mean and standard deviation are easy to obtain, as talked in #355 "Need to output non intrusive polynomial chaos coefficients". However, As far as I know, it is very difficult to obtain the exact higher-order moments of the PCE through the coefficience of PCE. I would like to know that if it can be implement in chaospy to obtain the exact skewness and kurtosis of PCE through the coefficience of PCE.

Thanks very much! Best regards, SW

jonathf commented 2 months ago

Chasopy calculates skewness and kurtosis using the expected value defintition. E.g. for skewness:

$$E( (\frac{X - \mu}{\sigma})^3 )$$

A bit of care has to be done to get the math right, but numerically this is directly solvable as there are straight forward rules for taking expectations of polynomials.

As for the exactness, it is not as good as what you get with mean (first coefficient) and variance (sum of the squared rest), but you do okay in my experience.