Skip to content
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

The inf bounds for truncated normal is inconsistent #88

Closed
damar-wicaksono opened this issue Jan 17, 2023 · 1 comment
Closed

The inf bounds for truncated normal is inconsistent #88

damar-wicaksono opened this issue Jan 17, 2023 · 1 comment
Assignees
Labels
bug Something isn't working prob-input Update / fix issues in the probabilistic input modeling including the univariate distribution
Milestone

Comments

@damar-wicaksono
Copy link
Owner

The lower or upper bound of a truncated normal distribution may be set to either -inf or inf, but this is inconsistent with the implementation of the normal distribution. While the normal distribution is strictly speaking unbounded, in UQTestFuns the bounds are set such that the difference between 1.0 and the probability contained of the distribution between the two bounds are less than 1e-15.
This means that the bounds are set to:

lb = mu - 8.22 * sigma
ub = mu + 8.22 * sigma

The truncated normal may also be set to have infinite bounds which is the same as the untruncated normal distribution. In that case, for consistency, the bounds should take the bounds set for the normal distribution.

my_input_1 = uqtestfuns.UnivariateInput(distribution="trunc-normal", parameters=[0, 1, -np.inf, np.inf])  # a standard normal
my_input_2 = uqtestfuns.UnivariateInput(distribution="normal", parameters=[0, 1])  # also a standard normal
assert my_input_1.icdf(1.0) == my_input_2.icdf(1.0)  # But this will fail
@damar-wicaksono damar-wicaksono added the bug Something isn't working label Jan 17, 2023
@damar-wicaksono damar-wicaksono added this to the 0.1.0 Release milestone Jan 17, 2023
@damar-wicaksono damar-wicaksono self-assigned this Jan 17, 2023
damar-wicaksono added a commit that referenced this issue Jan 18, 2023
- Following Issue #88, the bounds for truncated normal when
  they are set to inf should be the same to the normal one
  (which is also truncated for numerical reason).
- The test suite has been extended to capture this issue.
@damar-wicaksono
Copy link
Owner Author

This issue has been resolved by PR #91.

@damar-wicaksono damar-wicaksono added the prob-input Update / fix issues in the probabilistic input modeling including the univariate distribution label Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working prob-input Update / fix issues in the probabilistic input modeling including the univariate distribution
Projects
None yet
Development

No branches or pull requests

1 participant