Skip to content
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

Request - GPU documentation - Vector of Interpolation Objects #600

Open
Lincoln-Hannah opened this issue Aug 6, 2024 · 0 comments
Open

Comments

@Lincoln-Hannah
Copy link

Lincoln-Hannah commented Aug 6, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant