jonathf / chaospy

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

PCE with dependent variables #224

Open GitHubBlues opened 4 years ago

GitHubBlues commented 4 years ago

Hi Jonathan,

I implemented a PCE with dependent variables based on the provided tutorial. It worked fine for my test case but I have some questions regarding its implementation.

1- What kind of dependencies are considered here? I do not really understand how transforming the distribution of the variables to a multivariate normal distribution allows to calculate dependencies. I am no mathematician and was wondering if there was some kind of simple answer to this. If it is too complex, I am happy to live without an answer...

2- Is there anything to consider when applying a PCE with dependent variables in a practical application? I am just following the tutorial and would like to know if there is anything I would need to adapt when dealing with my own problem (besides the parameter distributions) or what are potential options that I should fine-tune.

jonathf commented 4 years ago

1) chaospy considers dependency that can be formulated into a conditional decomposition: p(X)*p(Y|X)*p(Z|X,Y)*.... So in theory everything. In practice, some messy maths might be involved (which is why I am struggling to complete the implementation of multivariate Gaussian mixture models). When one talks about dependencies in multivariate normal distribution, it is usually synonymous with (Pearson's) correlation, as it is the core of the multivariate normal distribution. When you transform to normal (typically the Nataf transformation, I am guessing), one assumes a very specific type of dependency that can uniquely be defined through a covariance matrix.

2) There is. It is a open research question, which I have published an article on: https://epubs.siam.org/doi/pdf/10.1137/15M1020447 First, the canonical approach, generalized-polynomial chaos expansion, uses transformations and Stiltjes. It only works out if the transformation is not too "non-linear". In other words, the method works best, when the "proxy" distribution of independent variables are similar to the distribution you are analyzing. (Which is always the case between dependent and independent normal distributions.) If you have discontinuities in what I would could "coupled probability and physical space", where e.g. the discontinuities in model moves around as a function of the uncertain parameter, the generalized PCE method collapses and will not converge. Secondly, everything except generalized PCE is unstable. So you can use my chaospy.orth_chol which uses a regularized Cholesky decomposition to create orthogonal polynomials. But dependent on your distribution, this method will fail. So keep an eye out on the orthogonality property: E(outer(expansion, expansion), dist) should be a diagonal matrix. But for lower order polynomials (in the realm where most of us work), it might be more than enough.

GitHubBlues commented 4 years ago

Thanks for your help!