JuliaMath / JuliaMath/Interpolations.jl
Request - GPU documentation - Vector of Interpolation Objects
- Dominant language
- Julia
- Stars
- 575
- Forks
- 117
- PR merge metrics
- No merged PRs in 30d
Description
Would it be possible to have a Structure for a Vector of Interpolations across common x values and interpolation type ?
```
k = 0:4
M = eachrow(randn(1_000,5))
iv = interpolate.( [(k,)], M, [Gridded(Linear())] )
#possible syntax
iv_new = vector_of_interpolations( (k,), M, Gridded(Linear()))
iv_new.it # GriddedLinear()
iv_new.knots # ([0, 1, 2, 3, 4],)
iv_new.coefs # = [j.coefs for j in iv]
iv_new( x ) # = [j(x) for j in iv]
iv_new[1](x) # = iv[1](x)
```
In `iv_new`, `knots` and `it` are stored once. In `iv` (current syntax) they are stored for every vector element.
This would also make it easier to put the vector onto GPU. With `iv`, the interpolate elements can be moved to GPU but the vector holding them stays on CPU (I think).
This would be useful in banking calculations like VaR and XVAs where curves need to be simulated thousands of times.
Maybe also for sensitivity calculations. Each element of the vector could be the original curve with one point bumped.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.