arrayfire / arrayfire/arrayfire-python
Bugs in af.approx1()
- Dominant language
- Python
- Stars
- 422
- Forks
- 63
- PR merge metrics
- No merged PRs in 30d
Description
Convergence checks performed on the ArrayFire routines for interpolation seem to indicate a few mistakes:
The following plot is generated using `af.INTERP.CUBIC`

The order of convergence comes out to be , while the expected convergence rate is . I checked with `af.INTERP.CUBIC_SPLINE` as well. Even in that case the order of convergence comes out to be 

Another issue is the fact that the error doesn't drop below 1e-7. The SciPy interpolation function `interp1d` using cubic interpolation gives this:

For your reference - this is the [code](https://gist.github.com/ShyamSS-95/ad0065e984b76d1ccaecc5e21b425734) I'd used to generate the plots.
Also regarding issue #130 - I've realised that the mistake was on my part. I should have added the off-set in the indexing to the normalized interpolant points.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by running the linked reproduction code and examining af.approx1 with af.INTERP.CUBIC and af.INTERP.CUBIC_SPLINE. Compare the observed convergence rates and error floor with SciPy's interp1d; done means identifying and correcting the interpolation behavior so the expected convergence and accuracy are restored.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100