-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need to output non intrusive polynomial chaos coefficients #355
Comments
Yes, depending on the method you are using. For Stochstic collocation you can retrieve the coefficients from: approx_model, coefficients = chaospy.fit_regression(..., retall=True) In the docs I refer to them as Fourier coefficients, which i likely why you didn't find them. :) |
Hello Jonathan, Allow me to continue with Max's question. From the document he attached, the PCE coefficients can be used to calculate the mean and standard deviation using equation 26 and 27 on page 11. Does chaospy compute the mean and standard deviation from these PCE coefficients as well? If so, is there a way that we can extract them? I currently have acquire 2 sets of the mean and standard deviation from using chaospy.E(approx_model,distribution).tolist() and chaospy.Std(approx_model,distribution).tolist(), and from using equation 26 & 27 from the documentation. I noticed that the means are the same, but not the standard deviation. I'm not sure what would be the reason for that. Maybe because calculating the std using the approx_model vs. PCE coefficients can results in different values? Best, |
Equation (27) is the formula for variance, not standard deviation. Have you tried using expansion, norms = chaospy.generate_expansion(order, dist, retall=True)
...
variance = numpy.sum((coefficients[1:].T**2*norms).T, axis=0) |
Thank you Jonathan for the quick response. I've been looking into the variance calculation you provided but I still can't get the same results as compared to the chaospy.std(...), after taking the square root of the variance. Do you think you can provide me a quick example on how the calculation is performed? Here are the values from my case: approx_model = -0.009831942073299769q1**2+0.005974272819164532q0q1+0.010849566040654542q0**2-0.11631101473312169q1-0.33180220764889784q0+4.756581789190308 RESULTS: Thanks, |
I appologies for the late response. It has been a couple of hectic weeks both at work and at home (remoddeling the kitchen). Devil is in the details, and I got one wrong...
Does that look better? |
Hi Jonathan, thank you for getting back to me on top of your busy schedule. The new equations works now. Thank you very much! I am doing some validation work now by comparing the PCE/Statistical results between Chaospy and DAKOTA (Built by Sandia). Apparently DAKOTA's calculation for Standard Deviation is a order of magnitude higher than chaospy.std, there could be some error on our end but I will keep you updated. Thanks, |
Describe your problem
We are using chaospy to construct the non intrusive polynomial chaos surrogate models and are looking for the mean, standard deviation, and polynomial chaos expansion coefficients. We noticed that the output from chaospy gives us the polynomial equations, but none of the polynomial equation coefficients equal the mean value, which suggests that these coefficients are the product of the random basis function (psi) and the deterministic component (alpha). We were wondering if there is a way to output just the PCE coefficients?
Initial implementation
We've looked through the code but can't seem to find where the PCE coefficients are computed.
Additional context
Reference file attached, in particular we are working with the material in section III, and specifically we are referring to equation 5.
Recent Advances in Non-Intrusive Polynomial Chaos and Stochastic Collocation Methods for Uncertainty Analysis and Design.pdf
The text was updated successfully, but these errors were encountered: