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

Complete Particle Degeneration in SMC² #9

Open
charlesknipp opened this issue Sep 27, 2022 · 0 comments
Open

Complete Particle Degeneration in SMC² #9

charlesknipp opened this issue Sep 27, 2022 · 0 comments

Comments

@charlesknipp
Copy link
Owner

In the inflation example, I run a few different models over the FRED data. When running SMC² for the UC model, complete particle degeneration occurs at 2 points in this process. Let's look at the last.

SMC² Log

Looking at the log, we observe this process getting stuck at t=196 and fixing itself at t=212 when only one particle is considered an effective estimation. From here, the sampler knows that

...
t =  193        ess = 363.557
t =  194        ess = 234.327   [rejuvenating]  acc_rate: 0.28320
t =  195        ess = 459.419
t =  196        ess = 212.097   [rejuvenating]  acc_rate: 0.00000
t =  197        ess = 62.057    [rejuvenating]  acc_rate: 0.00000
t =  198        ess = 232.472   [rejuvenating]  acc_rate: 0.00000
t =  199        ess = 224.963   [rejuvenating]  acc_rate: 0.00000
t =  200        ess = 39.595    [rejuvenating]  acc_rate: 0.00000
t =  201        ess = 48.292    [rejuvenating]  acc_rate: 0.00000
t =  202        ess = 54.444    [rejuvenating]  acc_rate: 0.00000
t =  203        ess = 48.497    [rejuvenating]  acc_rate: 0.00000
t =  204        ess = 91.183    [rejuvenating]  acc_rate: 0.00000
t =  205        ess = 136.884   [rejuvenating]  acc_rate: 0.00000
t =  206        ess = 51.889    [rejuvenating]  acc_rate: 0.00000
t =  207        ess = 60.103    [rejuvenating]  acc_rate: 0.00000
t =  208        ess = 20.934    [rejuvenating]  acc_rate: 0.00000
t =  209        ess = 102.997   [rejuvenating]  acc_rate: 0.00000
t =  210        ess = 41.018    [rejuvenating]  acc_rate: 0.00000
t =  211        ess = 7.715     [rejuvenating]  acc_rate: 0.00000	
t =  212        ess = 1.000     [rejuvenating]  acc_rate: 1.00000
t =  213        ess = 503.637
t =  214        ess = 478.646
t =  215        ess = 421.993
...

Since we only care about degeneration, let's filter this down to observations with sufficiently low acceptance ratios. To track the degeneration process, we will track the movement sizes via the covariance:

ess = 62.057    norm(cov(θ)) = 0.4448203    norm(wcov(θ)) = 0.5533801
ess = 232.472   norm(cov(θ)) = 0.5406501    norm(wcov(θ)) = 0.5991085
ess = 224.963   norm(cov(θ)) = 0.5856705    norm(wcov(θ)) = 0.6205049
ess = 39.595    norm(cov(θ)) = 0.6291859    norm(wcov(θ)) = 0.6299769
ess = 48.292    norm(cov(θ)) = 0.6461557    norm(wcov(θ)) = 0.0635495
ess = 54.444    norm(cov(θ)) = 0.0658842    norm(wcov(θ)) = 0.0047175
ess = 48.497    norm(cov(θ)) = 0.0050397    norm(wcov(θ)) = 0.0025555
ess = 91.183    norm(cov(θ)) = 0.0000000    norm(wcov(θ)) = 0.0000000
ess = 136.884   norm(cov(θ)) = 0.0000000    norm(wcov(θ)) = 0.0000000
ess = 51.889    norm(cov(θ)) = 0.0000000    norm(wcov(θ)) = 0.0000000
ess = 60.103    norm(cov(θ)) = 0.0000000    norm(wcov(θ)) = 0.0000000
ess = 20.934    norm(cov(θ)) = 0.0000000    norm(wcov(θ)) = 0.0000000
ess = 102.997   norm(cov(θ)) = 0.0000000    norm(wcov(θ)) = 0.0000000
ess = 41.018    norm(cov(θ)) = 0.0000000    norm(wcov(θ)) = 0.0000000
ess = 7.715     norm(cov(θ)) = 0.0000000    norm(wcov(θ)) = 0.0000000
ess = 1.000     norm(cov(θ)) = 0.0000000    norm(wcov(θ)) = 0.0000000

Thus somewhere around t = 203 brings covariance down to almost nothing. Although, the norms are not exactly 0; this occurs exactly at the point where ess = 1.000 which finally allows new move steps to be accepted. Below are the last weighted covariance matrices.

wcov(θ) = 3×3 Array{Float64,2}:
  7.88861e-31   1.2326e-32   -9.86076e-32
  1.2326e-32    1.92593e-34  -1.54074e-33
 -9.86076e-32  -1.54074e-33   1.2326e-32

wcov(θ) = 3×3 Array{Float64,2}:
 0.0  0.0  0.0
 0.0  0.0  0.0
 0.0  0.0  0.0

But Why?

I'm struggling to understand why degeneration even occurs since we specifically push it through a rejuvenation step. Furthermore, increasing the number of MCMC steps seems to do very little in terms of improvement; in fact, it actually drags this problem on longer since there are more chances of accepting a move step.

This may be a potential underflow problem caused by taking the log of the deepcopy of ω, but I have my doubts. It seems like a more systematic problem especially since this occurs consistently at the same observation.

Lastly, I think this could be a problem with the model itself. It seems to be less prominent in the UCSV report, but again there is no way to know for certain unless I want to solve this analytically. Moreover, maybe my specification of the priors is malformed, although I remember testing this case and coming up with similar results.

Needs Further Investigation

  • Look into exactly why the program rejuvenates only when ess = 1.0. This is not well understood
  • Look at both the log parameter weights and the log likelihoods to investigate underflows
  • Run this without multithreading to see if there's a race condition I missed [highly unlikely]
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