SURGroup / UQpy

UQpy (Uncertainty Quantification with python) is a general purpose Python toolbox for modeling uncertainty in physical and mathematical systems.
MIT License
267 stars 75 forks source link

Feature/distribution speed up #226

Closed connor-krill closed 9 months ago

connor-krill commented 10 months ago

Uniform and Normal Distribution Performance Improvements

Wrote functions for Uniform pdf, cdf, icdf and Normal pdf, cdf that are faster than SciPy implementations

Description

Wrote the analytic formulas for Uniform distributions into functions for the class. Wrote new functions for Normal pdf and cdf that were faster than SciPy while maintaining accuracy. Normal InverseCDF (icdf) was not written because we could not write a fast implementation that was as accurate as SciPy. The normal icdf is still a call to the scipy implementation.

Motivation and Context

Algorithms that required many, many distribution calls were quite slow. This makes uniform and normal calls significantly faster.

How Has This Been Tested?

Extensive tests were written for the analytic answers to uniform distributions. Normal distribution is compared to the SciPy implementation for accuracy.

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

Checklist:

Go over all the following points, and put an x in all the boxes that apply. If you're unsure about any of these, don't hesitate to ask. We're here to help!

sonarcloud[bot] commented 10 months ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication