HARK
HARK copied to clipboard
[WIP] Vector-valued interpolation in `econforgeinterp`
econforgeinterp
(and all other interpolators in HARK) currently support interpolation of scalar valued functions, $f:\mathbb{R}^n\rightarrow \mathbb{R}$. I would like to work on adding the capability to interpolate vector-valued functions, $f:\mathbb{R}^n\rightarrow \mathbb{R^m}$.
The current version of this PR makes this possible in the barebones LinearFast
. I still need to adjust the extra-stuff: derivatives and decay-interpolation.
Why do I think this would be useful?
In a model with, say, a 2-dimensional state space, we often will construct a bunch of interpolators for vFunc(m,n)
, dvdmFunc(m,n)
, dvdnFunc(m,n)
, cFunc(m,n)
... over the same (m,n)
grids.
Often, in the expectation step of backward induction, we will need to evaluate, say dvdmFunc(m,n)
, dvdnFunc(m,n)
in a bunch of points. We can do this with two different interpolators, one for each function. But this does the slow calculation of which indices and weights to use for interpolation twice for every point (once in each interpolator). If we instead had an
$\mathbb{R}^2\rightarrow \mathbb{R^2}$ interpolator of (m,n) -> [dvdmFunc(m,n), dvdnFunc(m,n)]
the calculation of indices and weights would be done only once.
- [ ] Tests for new functionality/models or Tests to reproduce the bug-fix in code.
- [ ] Updated documentation of features that add new functionality.
- [ ] Update CHANGELOG.md with major/minor changes.