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

Levy SSM inference using Particle Gibbs #94

Closed
wants to merge 13 commits into from
Closed

Conversation

THargreaves
Copy link
Contributor

An example implementation of the Levy State Space Model (Godsill et al. 2020). Simulation of the driving Levy process is performed using the generalised shot noise formulation.

Copy link
Contributor

github-actions bot commented Nov 30, 2023

Pull Request Test Coverage Report for Build 7173173446

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 96.098%

Totals Coverage Status
Change from base Build 6816722471: 0.0%
Covered Lines: 394
Relevant Lines: 410

💛 - Coveralls

examples/levy-ssm/script.jl Outdated Show resolved Hide resolved
examples/levy-ssm/simulation.jl Outdated Show resolved Hide resolved
examples/levy-ssm/simulation.jl Outdated Show resolved Hide resolved
examples/levy-ssm/simulation.jl Outdated Show resolved Hide resolved
examples/levy-ssm/simulation.jl Outdated Show resolved Hide resolved
Copy link

codecov bot commented Nov 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.60%. Comparing base (1e5dfdd) to head (eec5511).

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #94      +/-   ##
==========================================
- Coverage   96.09%   95.60%   -0.49%     
==========================================
  Files           8        8              
  Lines         410      410              
==========================================
- Hits          394      392       -2     
- Misses         16       18       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

examples/levy-ssm/script.jl Outdated Show resolved Hide resolved
examples/levy-ssm/script.jl Outdated Show resolved Hide resolved
Comment on lines +174 to +176
return MixedState(
rand(rng, MultivariateNormal(exp(dyn, dt) * state.x + μ, Σ)), path
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we just mutate the state instead ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works in a purely filtering context, but if you then want to apply smoothing, you need all of the historic states saved, so mutating isn't an option.

I think this clunkiness is best solved by modifying AdvancedPS.jl to expect a sample to be returned rather than a distribution. I only wrote it this way to maintain compatibility.

@THargreaves
Copy link
Contributor Author

THargreaves commented Mar 21, 2024

I think this is as far as we can go with this commit with making substantial changes to AdvancedPS.jl — specifically, changing AdvancedPS.jl to expect a sample to be return by the transition function rather than a distribution.

My feeling is that this is at a good point to merge. @yebai @FredericWantiez?

output

@THargreaves THargreaves marked this pull request as ready for review March 21, 2024 14:33
path = simulate(model.θ.process, dt, s, t, ϵ)
μ, Σ = meancov(t, model.θ.dyn, path, model.θ.nvm)
Σ += 1e-6 * I
return logpdf(MultivariateNormal(exp(dyn, dt) * state.x + μ, Σ), state.x)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not using state ? Looks like should be something like:

let model = td.model, s = td.s, t = td.t, prev_state = td.current_state
  ...
  return logpdf(MultivariateNormal(exp(dyn, dt) * prev_state.x + μ, Σ), state.x)
end

@FredericWantiez
Copy link
Member

Apologies for making it a mess, but that's how it would look like with SSMProblems: here

@yebai yebai mentioned this pull request Apr 12, 2024
@yebai yebai closed this Apr 12, 2024
@yebai yebai deleted the levy-ssm branch April 12, 2024 19:32
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

Successfully merging this pull request may close these issues.

None yet

3 participants