File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 51
51
)
52
52
@test AdvancedPS. logZ (pc) ≈ log (sum (exp, 2 .* logps))
53
53
54
+ # Resample and propagate particles with reference particle
55
+ particles_ref = [AdvancedPS. Trace (fpc (logp)) for logp in logps]
56
+ pc_ref = AdvancedPS. ParticleContainer (particles_ref)
57
+ AdvancedPS. resample_propagate! (
58
+ Random. GLOBAL_RNG, pc_ref, AdvancedPS. resample_systematic, particles_ref[end ]
59
+ )
60
+ @test pc_ref. logWs == zeros (3 )
61
+ @test AdvancedPS. getweights (pc_ref) == fill (1 / 3 , 3 )
62
+ @test all (AdvancedPS. getweight (pc_ref, i) == 1 / 3 for i in 1 : 3 )
63
+ @test AdvancedPS. logZ (pc_ref) ≈ log (3 )
64
+ @test AdvancedPS. effectiveSampleSize (pc_ref) == 3
65
+ @test pc_ref. vals[end ] === particles_ref[end ]
66
+
54
67
# Resample and propagate particles.
55
68
AdvancedPS. resample_propagate! (Random. GLOBAL_RNG, pc)
56
69
@test pc. logWs == zeros (3 )
You can’t perform that action at this time.
0 commit comments