-
-
Notifications
You must be signed in to change notification settings - Fork 197
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
Interpolators with "Decay" extrapolation #1165
Conversation
Here is a test that shows how @llorracc I believe I've succeeded in implementing a decay method (I've called it "decay_hark") that works in multiple dimensions but collapses to the current implementation in 1D. This test compares the two and they produce the same output. What I still have to wrap my head around is:
|
Great -- thanks for this. Is the comparison to linearInterp in Decay.ipynb functional already? |
Not yet, I was using that notebook to just store some math scribbles on what I intended to do. I will add examples and comparisons soon! |
@llorracc I have quickly moved some plots and tests to the notebook and added minimal comments in case you want to check out/play with the interpolators. The comparison with base hark is in there. I must go out now, but will continue polishing this when the Calvo fairy permits. |
Codecov ReportBase: 73.58% // Head: 73.73% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #1165 +/- ##
==========================================
+ Coverage 73.58% 73.73% +0.15%
==========================================
Files 72 72
Lines 11465 11561 +96
==========================================
+ Hits 8436 8524 +88
- Misses 3029 3037 +8
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
I think this is ready for review. I have not implemented gradients yet, but I think that is a complex-enough and not-urgent-enough issue that it could be in its future own PR, and I don't want it to block this one. I made a notebook with formal descriptions of each decay method, examples, and comparisons with base-HARK. |
This PR introduces enhanced tools to implement functions (represented by interpolators) that asymptotically approach another function for points that fall outside of their grid.
HARK has some tools for this purpose, specifically in
interpolation.LinearInterp
, which has the option to provide a linear limiting function to which extrapolated values should approach. This PR improves upon those tools in various ways.It implements a class
DecayInterp
that receives an interpolator and a limiting function and returns an object that behaves as HARK's other interpolators but approaches the limiting function when queried about off-grid values. This achieves two generalizations with respect tointerpolation.LinearInterp
:econforge
interpolators.It has different methods for calculating the rate at which extrapolated values approach the limiting function.