-
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
PCE with TruncNormal input variables cannot be used for uncertainty quantification and sensitivity analysis #354
Comments
Do you mind reporting stats on your run. In particular:
|
* python C3.7
* cp C4.3.3
* nu C 1.2.3
* np C1.20.3
My test_run is as follow:
import chaospy as cp
import numpy as np
m = 2
expansion_order = 3
level = 3
def model_solver(q):
return q[0]*np.e**-q[1]+1
distribution = cp.Iid(cp.TruncNormal(0, 1), m)
abscissas, weights = cp.generate_quadrature(level, distribution, rule='gaussian')
solves = np.array([model_solver(q) for q in abscissas.T])
expansion, norms = cp.generate_expansion(expansion_order, distribution, retall=True)
approx = cp.fit_quadrature(expansion, abscissas, weights, solves, norms=norms)
expected = cp.E(approx, distribution)
deviation = cp.Std(approx, distribution)
First_indices = cp.Sens_m(approx, distribution)
Total_indices = cp.Sens_t(approx, distribution)
从 Windows 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>发送
发件人: Jonathan ***@***.***>
发送时间: 2021年8月17日 16:43
收件人: ***@***.***>
抄送: ***@***.***>; ***@***.***>
主题: Re: [jonathf/chaospy] PCE with TruncNormal input variables cannot be used for uncertainty quantification and sensitivity analysis (#354)
Do you mind reporting stats on your run. In particular:
* python --version
* python -c "import chaospy as cp; print(cp.__version__)"
* python -c "import numpoly as nu; print(nu.__version__)"
* python -c "import numpy as np; print(np.__version__)"
―
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#354 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AVHPURHHHUVQH32D67RMN73T5IOMBANCNFSM5CJKTLNQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>.
|
I am unable to replicate the issue on my local machine. To weed out a small list of subtle problems, do you mind doing the following. Anyways:
Let me know how it goes and if it solves the problem or not. |
Hello, I've followed the steps you said, but I still haven't solved the problem. I'm still prompted before the error
从 Windows 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>发送
发件人: Jonathan ***@***.***>
发送时间: 2021年8月18日 22:30
收件人: ***@***.***>
抄送: ***@***.***>; ***@***.***>
主题: Re: [jonathf/chaospy] PCE with TruncNormal input variables cannot be used for uncertainty quantification and sensitivity analysis (#354)
I am unable to replicate the issue on my local machine.
To weed out a small list of subtle problems, do you mind doing the following.
I don't use windows (which I assume you do from the error output), so I appologies in advance for any mistake in the recipy.
Anyways:
* Make a completly new folder and copy the test_run.py script into it.
* From your shell (cmd.exe or Powershell) move into the new folder
* Make virtual env: python -m venv venv
* Make sure pip works: venv/bin/python -m ensurepip --upgrade
* Install chaospy: venv/bin/python -m pip install chaospy
* Run script: venv/bin/python test_run.py
Let me know how it goes and if it solves the problem or not.
―
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#354 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AVHPURFV42GWXQVEIR6VHIDT5O7YBANCNFSM5CJKTLNQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>.
|
Very weird. Can you post the new trace stack? It shouldn't be exactly the same. The paths at least should point to a new files. |
When TruncNormal is selected as the distribution and fitting PCE, we perform chaospy.E(approx, distribution) or chaospy.Std(approx, distribution). Finally the errors are as follow:
Traceback (most recent call last):
File "D:\Anaconda\lib\site-packages\chaospy\distributions\baseclass\distribution.py", line 618, in mom
out = [self._get_mom(kdata) for kdata in K.T]
File "D:\Anaconda\lib\site-packages\chaospy\distributions\baseclass\distribution.py", line 618, in
out = [self._get_mom(kdata) for kdata in K.T]
File "D:\Anaconda\lib\site-packages\chaospy\distributions\baseclass\distribution.py", line 641, in _get_mom
ret_val = float(self._mom(kdata, **parameters))
File "D:\Anaconda\lib\site-packages\chaospy\distributions\operators\joint.py", line 161, in _mom
output *= self._owners[unique_idx][1]._get_mom(kloc[index == unique_idx])
File "D:\Anaconda\lib\site-packages\chaospy\distributions\baseclass\distribution.py", line 641, in _get_mom
ret_val = float(self._mom(kdata, **parameters))
File "D:\Anaconda\lib\site-packages\chaospy\distributions\baseclass\shift_scale.py", line 109, in _mom
for key, coeff in zip(poly.exponents, poly.coefficients)])
File "D:\Anaconda\lib\site-packages\chaospy\distributions\baseclass\shift_scale.py", line 109, in
for key, coeff in zip(poly.exponents, poly.coefficients)])
File "D:\Anaconda\lib\site-packages\chaospy\distributions\baseclass\distribution.py", line 641, in _get_mom
ret_val = float(self._mom(kdata, **parameters))
File "D:\Anaconda\lib\site-packages\chaospy\distributions\baseclass\simple.py", line 110, in _mom
"%s: does not support analytical raw moments." % self)
chaospy.UnsupportedFeature: trunc_normal(lower=0, upper=1, mu=0, sigma=1): does not support analytical raw moments.
During handling of the above exception, another exception occurred:
The text was updated successfully, but these errors were encountered: