-
-
Notifications
You must be signed in to change notification settings - Fork 200
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
Additional Features for CubicHermiteInterp #1020
Conversation
add new features to CubicHermiteInterp taking advantage of scipy internals
Codecov Report
@@ Coverage Diff @@
## master #1020 +/- ##
==========================================
- Coverage 72.53% 72.51% -0.03%
==========================================
Files 68 68
Lines 10298 10368 +70
==========================================
+ Hits 7470 7518 +48
- Misses 2828 2850 +22
Continue to review full report at Codecov.
|
@alanlujan91 can you fix the merge conflict? (sorry for duplicating my comment on #1011 ) @mnwhite would you be able to review this? |
I'm working on this now. GitHub flagged a bunch of things as "conflicts" that plainly were not. And it also got upset about notebook execution metadata, which is annoying. It's quite likely that I broke stuff in that commit. |
This has one failing test, and I'm actually not sure whether it should pass. It looks like the test is for whether new cubic interpolator can accepts inputs of shape (N,1) rather than just (N,)-- flat 2D arrays. Is that intended? |
The problem was some |
The "flatten check" wasn't actually being used properly. Should be fixed now.
New cubic interpolator wants x to be strictly increasing, but KinkedR gridpoints are weakly increasing. Made tiny change to fix.
This PR adds new methods to
CubicHermiteInterp
.Because
CubicHermiteInterp
usesscipy
'sCubicHermiteSpline
, we can easily port additional methods that could be useful in HARK.These were initially in #1011 but were moved to a standalone PR for further discussion.
These new methods are:
der_interp(self[, nu])
Construct a new piecewise polynomial representing the derivative.antider_interp(self[, nu])
Construct a new piecewise polynomial representing the antiderivative.integrate(self, a, b[, extrapolate])
Compute a definite integral over a piecewise polynomial.roots(self[, discontinuity, extrapolate])
Find real roots of the the piecewise polynomial.solve(self[, y, discontinuity, extrapolate])
Find real solutions of the the equation pp(x) == y.See notebook for more details: https://github.com/alanlujan91/HARK/blob/CHI_new_feats/examples/Interpolation/CubicInterp.ipynb