Skip to content

Commit

Permalink
build based on d96e0af
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Sep 13, 2023
1 parent 34fe05a commit f69cd13
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions previews/PR16/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Home · SSMProblems</title><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href>SSMProblems</a></span></div><form class="docs-search" action="search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li class="is-active"><a class="tocitem" href>Home</a></li><li><span class="tocitem">Examples</span></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Home</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Home</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/TuringLang/SSMProblems.jl/blob/main/docs/src/index.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="SSMProblems"><a class="docs-heading-anchor" href="#SSMProblems">SSMProblems</a><a id="SSMProblems-1"></a><a class="docs-heading-anchor-permalink" href="#SSMProblems" title="Permalink"></a></h1><h3 id="Installation"><a class="docs-heading-anchor" href="#Installation">Installation</a><a id="Installation-1"></a><a class="docs-heading-anchor-permalink" href="#Installation" title="Permalink"></a></h3><p>In the <code>julia</code> REPL:</p><pre><code class="language-julia hljs">]add SSMProblems</code></pre><h3 id="Documentation"><a class="docs-heading-anchor" href="#Documentation">Documentation</a><a id="Documentation-1"></a><a class="docs-heading-anchor-permalink" href="#Documentation" title="Permalink"></a></h3><p><code>SSMProblems</code> defines a generic interface for State Space Problems (SSM). The main objective is to provide a consistent interface to work with SSMs and their logdensities.</p><p>Consider a markovian model from<sup class="footnote-reference"><a id="citeref-Murray" href="#footnote-Murray">[Murray]</a></sup>: <img src="./docs/images/state_space_model.png" alt="state space model"/></p><p>The model is fully specified by the following densities:</p><ul><li><strong>Initialisation</strong>: <span>$f_0(x)$</span></li><li><strong>Transition</strong>: <span>$f(x)$</span></li><li><strong>Emission</strong>: <span>$g(x)$</span></li></ul><p>And the dynamics of the model reduces to:</p><p class="math-container">\[x_t | x_{t-1} \sim f(x_t | x_{t-1})\]</p><p class="math-container">\[y_t | x_t \sim g(y_t | x_{t})\]</p><p>assuming <span>$x_0 \sim f_0(x)$</span>. </p><p>The joint law follows:</p><p class="math-container">\[p(x_{0:T}, y_{0:T}) = f_0(x_0) \prod_t g(y_t | x_t) f(x_t | x_{t-1})\]</p><p>Model users can define their <code>SSM</code> using the following interface:</p><pre><code class="language-julia hljs">
struct Model &lt;: AbstractStateSpaceModel end
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Home · SSMProblems</title><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href>SSMProblems</a></span></div><form class="docs-search" action="search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li class="is-active"><a class="tocitem" href>Home</a></li><li><span class="tocitem">Examples</span></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Home</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Home</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/TuringLang/SSMProblems.jl/blob/main/docs/src/index.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="SSMProblems"><a class="docs-heading-anchor" href="#SSMProblems">SSMProblems</a><a id="SSMProblems-1"></a><a class="docs-heading-anchor-permalink" href="#SSMProblems" title="Permalink"></a></h1><h3 id="Installation"><a class="docs-heading-anchor" href="#Installation">Installation</a><a id="Installation-1"></a><a class="docs-heading-anchor-permalink" href="#Installation" title="Permalink"></a></h3><p>In the <code>julia</code> REPL:</p><pre><code class="language-julia hljs">]add SSMProblems</code></pre><h3 id="Documentation"><a class="docs-heading-anchor" href="#Documentation">Documentation</a><a id="Documentation-1"></a><a class="docs-heading-anchor-permalink" href="#Documentation" title="Permalink"></a></h3><p><code>SSMProblems</code> defines a generic interface for State Space Problems (SSM). The main objective is to provide a consistent interface to work with SSMs and their logdensities.</p><p>Consider a markovian model from<sup class="footnote-reference"><a id="citeref-Murray" href="#footnote-Murray">[Murray]</a></sup>: <img src="./docs/images/state_space_model.png" alt="state space model"/></p><p>The model is fully specified by the following densities:</p><ul><li><strong>Initialisation</strong>: <span>$f_0(x)$</span></li><li><strong>Transition</strong>: <span>$f(x)$</span></li><li><strong>Emission</strong>: <span>$g(x)$</span></li></ul><p>And the dynamics of the model reduces to:</p><p class="math-container">\[\begin{aligned}
x_t | x_{t-1} &amp;\sim f(x_t | x_{t-1}) \\
y_t | x_t &amp;\sim g(y_t | x_{t})
\end{aligned}\]</p><p>assuming <span>$x_0 \sim f_0(x)$</span>. </p><p>The joint law follows:</p><p class="math-container">\[p(x_{0:T}, y_{0:T}) = f_0(x_0) \prod_t g(y_t | x_t) f(x_t | x_{t-1})\]</p><p>Users can define their SSM with <code>SSMProblems</code> in the following way:</p><pre><code class="language-julia hljs">struct Model &lt;: AbstractStateSpaceModel end

# Define the structure of the latent space
particleof(::Model) = Float64
Expand Down Expand Up @@ -36,4 +38,4 @@
particles[i] = transition!!(rng, t, model, particles[i])
logweights[i] += emission_logdensity(t, model, particles[i])
end
end</code></pre><h3 id="Interface"><a class="docs-heading-anchor" href="#Interface">Interface</a><a id="Interface-1"></a><a class="docs-heading-anchor-permalink" href="#Interface" title="Permalink"></a></h3><article class="docstring"><header><a class="docstring-binding" id="SSMProblems.AbstractStateSpaceModel" href="#SSMProblems.AbstractStateSpaceModel"><code>SSMProblems.AbstractStateSpaceModel</code></a><span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">AbstractStateSpaceModel</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/SSMProblems.jl/blob/14a0106ade7766c6c86aa49f82ab8d04577195d3/src/SSMProblems.jl#L6-L8">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="SSMProblems.emission_logdensity" href="#SSMProblems.emission_logdensity"><code>SSMProblems.emission_logdensity</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">emission_logdensity(model, timestep, state, observation[, cache])</code></pre><p>Compute the log potential of the current particle. This effectively &quot;reweight&quot; each particle.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/SSMProblems.jl/blob/14a0106ade7766c6c86aa49f82ab8d04577195d3/src/SSMProblems.jl#L26-L30">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="SSMProblems.transition!!" href="#SSMProblems.transition!!"><code>SSMProblems.transition!!</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">transition!!(rng, model[, timestep, state, cache])</code></pre><p>Simulate the particle for the next time step from the forward dynamics.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/SSMProblems.jl/blob/14a0106ade7766c6c86aa49f82ab8d04577195d3/src/SSMProblems.jl#L12-L16">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="SSMProblems.transition_logdensity" href="#SSMProblems.transition_logdensity"><code>SSMProblems.transition_logdensity</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">transition_logdensity(model, timestep, prev_state, next_state[, cache])</code></pre><p>(Optional) Computes the log-density of the forward transition if the density is available.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/SSMProblems.jl/blob/14a0106ade7766c6c86aa49f82ab8d04577195d3/src/SSMProblems.jl#L19-L23">source</a></section></article><section class="footnotes is-size-7"><ul><li class="footnote" id="footnote-Murray"><a class="tag is-link" href="#citeref-Murray">Murray</a><blockquote><p>Murray, Lawrence &amp; Lee, Anthony &amp; Jacob, Pierre. (2013). Rethinking resampling in the particle filter on graphics processing units. </p></blockquote></li></ul></section></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Thursday 7 September 2023 21:12">Thursday 7 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
end</code></pre><h3 id="Interface"><a class="docs-heading-anchor" href="#Interface">Interface</a><a id="Interface-1"></a><a class="docs-heading-anchor-permalink" href="#Interface" title="Permalink"></a></h3><article class="docstring"><header><a class="docstring-binding" id="SSMProblems.AbstractStateSpaceModel" href="#SSMProblems.AbstractStateSpaceModel"><code>SSMProblems.AbstractStateSpaceModel</code></a><span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">AbstractStateSpaceModel</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/SSMProblems.jl/blob/d96e0afdbcdda875306236456e1eca837e1800da/src/SSMProblems.jl#L6-L8">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="SSMProblems.emission_logdensity" href="#SSMProblems.emission_logdensity"><code>SSMProblems.emission_logdensity</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">emission_logdensity(model, state, observation[, timestep, cache])</code></pre><p>Compute the log potential of the current particle. This effectively &quot;reweight&quot; each particle.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/SSMProblems.jl/blob/d96e0afdbcdda875306236456e1eca837e1800da/src/SSMProblems.jl#L26-L30">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="SSMProblems.linearize-Union{Tuple{SSMProblems.Particle{T}}, Tuple{T}} where T" href="#SSMProblems.linearize-Union{Tuple{SSMProblems.Particle{T}}, Tuple{T}} where T"><code>SSMProblems.linearize</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">linearize(particle)</code></pre><p>Return the trace of a particle, i.e. the sequence of states from the root to the particle.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/SSMProblems.jl/blob/d96e0afdbcdda875306236456e1eca837e1800da/src/utils/particles.jl#L19-L23">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="SSMProblems.transition!!" href="#SSMProblems.transition!!"><code>SSMProblems.transition!!</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">transition!!(rng, model[, timestep, state, cache])</code></pre><p>Simulate the particle for the next time step from the forward dynamics.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/SSMProblems.jl/blob/d96e0afdbcdda875306236456e1eca837e1800da/src/SSMProblems.jl#L12-L16">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="SSMProblems.transition_logdensity" href="#SSMProblems.transition_logdensity"><code>SSMProblems.transition_logdensity</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">transition_logdensity(model, prev_state, current_state[, timestep, cache])</code></pre><p>(Optional) Computes the log-density of the forward transition if the density is available.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/SSMProblems.jl/blob/d96e0afdbcdda875306236456e1eca837e1800da/src/SSMProblems.jl#L19-L23">source</a></section></article><section class="footnotes is-size-7"><ul><li class="footnote" id="footnote-Murray"><a class="tag is-link" href="#citeref-Murray">Murray</a><blockquote><p>Murray, Lawrence &amp; Lee, Anthony &amp; Jacob, Pierre. (2013). Rethinking resampling in the particle filter on graphics processing units. </p></blockquote></li></ul></section></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Wednesday 13 September 2023 21:00">Wednesday 13 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit f69cd13

Please sign in to comment.