-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement optimal particle filter from Alex (#133)
* Add functions for Alex optimal filter * Rewrite functions with rho_bar a vector and R21,R12 matrices * sample_height_proposal passes preliminary tests * sample_height_proposal passes preliminary tests * Add validation against Alex code * Add performance benchmarks * Shift grid indices so that both station and grid indexing starts at 1. Shift indices when initialising StationVectors from st.st_ij of Sample_Optimal_Height_Proposal.jl * Add get_log_weights function * Add comments, fix bugs change i to iprt for correct behaviour in get_log_weights! interpolate variables in function calls that are timed with @Btime * Apply suggestions from code review Add dots and in-place operations Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com> * matrices.K*KH is a real matrix product * Use mul! to do multiplication in-place * Remove duplicate call * Minimal allocations reduction * Add get_stations and set_particles! to the interface * Reorder data structures for compatibility. Remove unit tests (will move to runtests.jl) * Integrate Optimal Filter to ParticleDA - Added unit tests and validation tests - Made changes to model interface to expose fields needed by optimal filter - Added a OptimalFilter type for dispatching - No implementation of run_particle_filter yet * Apply suggestions from code review Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com> * Draft implementation * Changes suggested by review Changing rand(rng,nd) to randn(rng) causes validation test to fail unless it's done on both sides. Unclear why. * Implementation according to comment on 5 Feb in #136 * Add compat entry for FFTW * Change to a more sensible test height field * Make grid size nx (not nx+1) on both ParticleDA and OptimalFilter. Something goes wrong. * Correct dx,dy in covariance calculations. tests pass. * Fix bugs * Apply suggestions from code review Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com> * Apply suggestions from code review In two parts because I didn't realize github doesn't automatically load a large diff even when there are comments. Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com> * Define model grid as storing values at the nodes (instead of cell faces) The only change required is defining dx as L_x/(nx-1) instead of L_x/nx In my opinion this is more consistent with the way we define the stations Makes it easier (or perhaps even possible) to integrate with the optimal filter Also fixed a bug in write_stations that created an Int dataset on the hdf5 file for the coordinate (float) value Reference data and some tests had to be updated * Pass grid parameters instead of using model_params * Fix bugs * Minor improvements - Parametric types in init_filter - Comments - Indentations * Fix arguments to init_*line_matrices * Use sigma and lambda from model params instead of redefining them in filter. * update notebook with animation and parameters * Point out bootstrap filter in example * add FFTW to benchmark environment * Pass filter type to run_particle_filter and use it to dispatch (#155) * Pass filter type to run_particle_filter and use it to dispatch appropriate functions * Update to simpler syntax * Update benchmarks and the benchmark environment Co-authored-by: Mosè Giordano <mose@gnu.org> * Split get_grid_size into three functions (#157) * Split get_grid_size into three functions that return NTuples * Remove extra parenthesis * Clarify function names * Changes suggested by review - Define Grid in OptimalFilter - Annotate argument types - Fix runtests.jl - Fix docstrings * Add integration test with optimal filter * Add input file for the test * Precompute FFTW plan (#159) * Precompute FFTW plan * Support in-place and out-of-place FFTs * Reduce duplication in `normalized_2d_fft!` methods * Force A to be hermitian to avoid roundoff errors Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com> * Throw error if matrix is not approximately Hermitian * clean up * Pass RNG directly to the filter instead of the model Also, use the RNG also in the `resample!` function. * Reduce allocations in `sample_height_proposal!` (#162) Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com> Co-authored-by: Mosè Giordano <mose@gnu.org>
- Loading branch information
1 parent
2ee15f0
commit 38fad3b
Showing
18 changed files
with
1,801 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.