FriesischScott / UncertaintyQuantification.jl

Uncertainty Quantification in Julia
MIT License
28 stars 7 forks source link

Add basic Polynomial Chaos Expansion #62

Closed FriesischScott closed 2 years ago

FriesischScott commented 2 years ago

Can compute PCE using least squares minimization or full quadrature rules using legendre basis functions.

The code should be fully extendible to other basis function, e.g. hermite by overloading a few methods in pcebases.jl.

Unfortunately SparseGrids.jl doesn't seem to support mixing nodes/weights for different families of polynomials. Having sparse quadrature rules will be very important going forward.

I'll add hermite polynomials before merging this.

codecov[bot] commented 2 years ago

Codecov Report

Merging #62 (ee0dd9b) into master (97fc031) will increase coverage by 0.59%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #62      +/-   ##
==========================================
+ Coverage   98.39%   98.98%   +0.59%     
==========================================
  Files          16       18       +2     
  Lines         373      590     +217     
==========================================
+ Hits          367      584     +217     
  Misses          6        6              
Impacted Files Coverage Δ
src/models/pce/pcebases.jl 100.00% <100.00%> (ø)
src/models/pce/polynomialchaosexpansion.jl 100.00% <100.00%> (ø)
src/sensitivity/sobolindices.jl 100.00% <100.00%> (ø)
src/simulations/subset.jl 100.00% <0.00%> (ø)
src/reliability/probabilityoffailure.jl 100.00% <0.00%> (ø)
src/models/externalmodel.jl 98.07% <0.00%> (+1.30%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

FriesischScott commented 2 years ago

I need to find a few more examples to check hermite polynomials and also hybrid bases.

AnderGray commented 2 years ago

Looks great to me, a very nice contribution and implementation. Only (minor) suggestion is that evaluate! could allow for raw samples as well as a DF. But we would have to change this for the evaluate functions

FriesischScott commented 2 years ago

Looks great to me, a very nice contribution and implementation. Only (minor) suggestion is that evaluate! could allow for raw samples as well as a DF. But we would have to change this for the evaluate functions

Maybe create an issue for it so we can discuss this generally?