QuantEcon / QuantEcon/BasisMatrices.jl
In-Place Basis Matrix and funeval
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 33
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Description
I could be wrong, but my impression is that, aside from complete_polynomials!, there is no way to update a basis matrix in place (i.e. the matrix of basis functions evaluated at specific nodes). All other methods recreate the basis matrix from scratch. In general, this is fine, but in the special case where you are just interpolating the same number of grid points in every dimension, this results in extra allocations because you could have just worked directly in-place. The notebook for solving an NK model globally in Julia is able to avoid this problem when interpolating for the future values of S, F, and C by updating the basis matrix in place. Other Basis types don't appear to have such functionality.
Please let me know if I've overlooked parts of the code! I'm still relatively new to the package.
If not, then I'm happy to work on it. The refactoring should be relatively mild.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing complete_polynomials! and the other Basis methods that recreate evaluated basis matrices, then compare their behavior with the linked NK-model notebook. Done means the applicable Basis types can update a basis matrix in place for repeated grid-point interpolation while avoiding the extra allocations described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100