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

New resampling methods and example #817

Merged
merged 47 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
0b8f92b
typo corrections to tutorial 04
spike-dstl May 30, 2023
dcb28e4
add Multinomial and Stratified resamplers
spike-dstl May 31, 2023
39b951e
typo correction
spike-dstl May 31, 2023
bc4b057
Tests for Multinomial and Stratified resamplers
spike-dstl Jun 2, 2023
1feb26c
Resamplers tutorial
spike-dstl Jun 8, 2023
9b15945
Flake8 fix
spike-dstl Jun 8, 2023
8525960
Add ResidualResampler code
spike-dstl Jun 8, 2023
59679c8
Add tests for Residual resampler
spike-dstl Jun 8, 2023
c7f666d
Rework of how ResidualResampler resamples in stage 2. Method change t…
spike-dstl Jun 20, 2023
5becaa0
Changes to Resamplers example
spike-dstl Jun 20, 2023
e44e994
Changes to docstrings in attempt to fix errors
spike-dstl Jun 21, 2023
ccc6c72
Attempt to fix errors
spike-dstl Jun 22, 2023
038f28d
Small fix to avoid CircleCI error
spike-dstl Jun 22, 2023
86026f1
Make ResidualResampler stage 2 actually do the correct math
spike-dstl Jun 22, 2023
b541719
typo corrections to tutorial 04
spike-dstl May 30, 2023
5ecb99f
add Multinomial and Stratified resamplers
spike-dstl May 31, 2023
3b76467
typo correction
spike-dstl May 31, 2023
1302326
Tests for Multinomial and Stratified resamplers
spike-dstl Jun 2, 2023
6ec64bf
Resamplers tutorial
spike-dstl Jun 8, 2023
0e5b9de
Flake8 fix
spike-dstl Jun 8, 2023
c22d775
Add ResidualResampler code
spike-dstl Jun 8, 2023
873856b
Add tests for Residual resampler
spike-dstl Jun 8, 2023
ca90da7
Rework of how ResidualResampler resamples in stage 2. Method change t…
spike-dstl Jun 20, 2023
b2e4901
Changes to Resamplers example
spike-dstl Jun 20, 2023
09dc0b8
Changes to docstrings in attempt to fix errors
spike-dstl Jun 21, 2023
7c82d16
Attempt to fix errors
spike-dstl Jun 22, 2023
7ff7694
Small fix to avoid CircleCI error
spike-dstl Jun 22, 2023
6c0d218
Make ResidualResampler stage 2 actually do the correct math
spike-dstl Jun 22, 2023
c626fa8
Rebase origin to latest main
spike-dstl Jun 22, 2023
67c40ce
Relocate resampling tutorial to new sampling section
spike-dstl Jun 22, 2023
cd880a9
Add README file
spike-dstl Jun 22, 2023
724a308
RST syntax fix
spike-dstl Jun 22, 2023
7580cd6
Changes in response to review comments
spike-dstl Jul 5, 2023
edf565c
More changes after reviews
spike-dstl Jul 5, 2023
ec8c35e
Apply suggestions from code review by JW
spike-dstl Jul 24, 2023
dd93fe2
Apply suggestions from code review by RG
spike-dstl Jul 24, 2023
b00e1a5
Test commit to see if PR is still working
spike-dstl Jul 25, 2023
8b474b6
New explanation and diagrams for Residual Resampler, fixed errors
spike-dstl Jul 26, 2023
9135119
Add link to resampler tutorial in particle filter tutorial
spike-dstl Jul 26, 2023
cd8aecc
Apply suggestions from code review by OR
spike-dstl Jul 31, 2023
97c9c2d
Replace ESS formula
spike-dstl Jul 31, 2023
c8cfb96
Fix circleCI error
spike-dstl Jul 31, 2023
18bceb3
Improvements to plot function, minor fixes from RG review
spike-dstl Jul 31, 2023
4e84530
Update docs/tutorials/sampling/ResamplingTutorial.py
spike-dstl Aug 4, 2023
dd00a52
Changes to reflect suggestions from SH and OR
spike-dstl Aug 8, 2023
304e049
fix merge conflict
spike-dstl Aug 8, 2023
e6501ad
Fix circleCI error
spike-dstl Aug 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions docs/tutorials/04_ParticleFilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,19 +145,22 @@
# :class:`~.SystematicResampler`, which is passed to the updater. It should be noted that there are
# many resampling schemes, and almost as many choices as to when to undertake resampling. The
# systematic resampler is described in [#]_, and in what follows below resampling is undertaken
# at each time-step.
# at each time-step. More resamplers that are included in Stone Soup are covered in the
# `Resampler Tutorial <https://stonesoup.readthedocs.io/en/latest/auto_tutorials/sampling/Resamp\
# lingTutorial.html#sphx-glr-auto-tutorials-sampling-resamplingtutorial-py>`_

# %%
# Use of Effective Sample Size resampler (ESS)
spike-dstl marked this conversation as resolved.
Show resolved Hide resolved
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Resampling removes particles with a low weight and duplicates particles with a high weight.
# A side-effect of this is that additional variance is added. Use of `~.SystematicResampler`
# A side effect of this is that additional variance is added. Use of :class:`~.SystematicResampler`
# at each time-step means that additional variance is being introduced when it may not necessarily
# be required. To reduce the additional variance, it may be optimal to resample less frequently.
#
# The Effective Sample Size resampler (`~.ESSResampler`) compares the variance of the unnormalised weights
# of the particles to a pre-specified threshold, and only resamples when the variance is greater than this threshold.
# This threshold is often calculated by the ESS criterion (at time n) given by:
# The Effective Sample Size resampler (:class:`~.ESSResampler`) compares the variance of the
# unnormalised weights of the particles to a pre-specified threshold, and only resamples when the
# variance is greater than this threshold. This threshold is often calculated by the ESS criterion
# (at time n) given by:
#
# .. math::
# ESS = \left(\sum_{i=1}^{N} (W_{n}^i)^2\right)^{-1}
Expand Down
3 changes: 3 additions & 0 deletions docs/tutorials/sampling/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Sampling
--------
Here are some tutorials which cover sampling techniques.
Loading