Skip to content

Commit

Permalink
build based on ec95e71
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Dec 21, 2024
1 parent ba0eabc commit 32fe436
Show file tree
Hide file tree
Showing 63 changed files with 2,359 additions and 2,375 deletions.
2 changes: 1 addition & 1 deletion dev/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.11.2","generation_timestamp":"2024-12-21T07:27:33","documenter_version":"1.8.0"}}
{"documenter":{"julia_version":"1.11.2","generation_timestamp":"2024-12-21T09:28:19","documenter_version":"1.8.0"}}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions dev/adaptive_kalmanfilter/index.html

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions dev/api/index.html

Large diffs are not rendered by default.

Binary file removed dev/beetle_example/04bb4f6c.png
Binary file not shown.
Binary file added dev/beetle_example/0c78f876.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/beetle_example/18eca807.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions dev/beetle_example/3079f958.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed dev/beetle_example/3551aa42.png
Binary file not shown.
Binary file added dev/beetle_example/3da61457.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions dev/beetle_example/6cda41b0.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed dev/beetle_example/7d56539f.png
Binary file not shown.
82 changes: 41 additions & 41 deletions dev/beetle_example/c17cca23.svg → dev/beetle_example/831112a0.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 0 additions & 50 deletions dev/beetle_example/9887f561.svg

This file was deleted.

46 changes: 0 additions & 46 deletions dev/beetle_example/e74a81d4.svg

This file was deleted.

10 changes: 5 additions & 5 deletions dev/beetle_example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
T = length(y)
sol = forward_trajectory(pf,u[1:T],y[1:T])
(; x,w,we,ll) = sol
plot(sol, markerstrokecolor=:auto, m=(2,0.5))</code></pre><img src="7d56539f.png" alt="Example block output"/><p>We can clearly see when the beetle switched mode (state variable 5). This corresponds well to annotations provided by a biologist and is the fundamental question we want to answer with the filtering procedure.</p><p>We can plot the mean of the filtered trajectory as well</p><pre><code class="language-julia hljs">xh = mean_trajectory(x,we)
plot(sol, markerstrokecolor=:auto, m=(2,0.5))</code></pre><img src="0c78f876.png" alt="Example block output"/><p>We can clearly see when the beetle switched mode (state variable 5). This corresponds well to annotations provided by a biologist and is the fundamental question we want to answer with the filtering procedure.</p><p>We can plot the mean of the filtered trajectory as well</p><pre><code class="language-julia hljs">xh = mean_trajectory(x,we)

&quot;plotting helper function&quot;
function to1series(x::AbstractVector, y)
Expand All @@ -61,10 +61,10 @@
to1series(y) = to1series(1:size(y,1),y)

fig1 = plot(xh[:,1],xh[:,2], c=:blue, lab=&quot;estimate&quot;, legend=:bottomleft)
plot!(xyt[:,1],xyt[:,2], c=:red, lab=&quot;measurement&quot;)</code></pre><img src="e74a81d4.svg" alt="Example block output"/><p>as well as the angle state variable (we subsample the particles to not get sluggish plots)</p><pre><code class="language-julia hljs">fig2 = scatter(to1series(ϕ.(x)&#39;[:,1:2:end])..., m=(:black, 0.03, 2), lab=&quot;&quot;, size=(500,300))
plot!(identity.(xh[:,4]), lab=&quot;Filtered angle&quot;, legend=:topleft, ylims=(-30, 70))</code></pre><img src="3551aa42.png" alt="Example block output"/><p>The particle plot above indicate that the posterior is multimodal. This phenomenon arises due to the simple model that uses an angle that is allowed to leave the interval <span>$0-2π$</span> rad. In this example, we are not interested in the angle, but rather when the beetle switches mode. The filtering distribution above gives a hint at when this happens, but we will not plot the mode trajectory until we have explored smoothing as well.</p><h2 id="Smoothing"><a class="docs-heading-anchor" href="#Smoothing">Smoothing</a><a id="Smoothing-1"></a><a class="docs-heading-anchor-permalink" href="#Smoothing" title="Permalink"></a></h2><p>The filtering results above does not use all the available information when trying to figure out the state trajectory. To do this, we may call a smoother. We use a particle smoother and compute 10 smoothing trajectories.</p><pre><code class="language-julia hljs">M = 10 # Number of smoothing trajectories, NOTE: if this is set higher, the result will be better at the expense of linear scaling of the computational cost.
plot!(xyt[:,1],xyt[:,2], c=:red, lab=&quot;measurement&quot;)</code></pre><img src="3079f958.svg" alt="Example block output"/><p>as well as the angle state variable (we subsample the particles to not get sluggish plots)</p><pre><code class="language-julia hljs">fig2 = scatter(to1series(ϕ.(x)&#39;[:,1:2:end])..., m=(:black, 0.03, 2), lab=&quot;&quot;, size=(500,300))
plot!(identity.(xh[:,4]), lab=&quot;Filtered angle&quot;, legend=:topleft, ylims=(-30, 70))</code></pre><img src="3da61457.png" alt="Example block output"/><p>The particle plot above indicate that the posterior is multimodal. This phenomenon arises due to the simple model that uses an angle that is allowed to leave the interval <span>$0-2π$</span> rad. In this example, we are not interested in the angle, but rather when the beetle switches mode. The filtering distribution above gives a hint at when this happens, but we will not plot the mode trajectory until we have explored smoothing as well.</p><h2 id="Smoothing"><a class="docs-heading-anchor" href="#Smoothing">Smoothing</a><a id="Smoothing-1"></a><a class="docs-heading-anchor-permalink" href="#Smoothing" title="Permalink"></a></h2><p>The filtering results above does not use all the available information when trying to figure out the state trajectory. To do this, we may call a smoother. We use a particle smoother and compute 10 smoothing trajectories.</p><pre><code class="language-julia hljs">M = 10 # Number of smoothing trajectories, NOTE: if this is set higher, the result will be better at the expense of linear scaling of the computational cost.
sb,ll = smooth(pf, M, u, y) # Sample smoothing particles (b for backward-trajectory)
sbm = smoothed_mean(sb) # Calculate the mean of smoothing trajectories
sbt = smoothed_trajs(sb) # Get smoothing trajectories
plot!(fig1, sbm[1,:],sbm[2,:], lab=&quot;xs&quot;)</code></pre><img src="9887f561.svg" alt="Example block output"/><pre><code class="language-julia hljs">plot!(fig2, identity.(sbm&#39;[:,4]), lab=&quot;smoothed&quot;)</code></pre><img src="04bb4f6c.png" alt="Example block output"/><p>We see that the smoothed trajectory may look very different from the filter trajectory. This is an indication that it&#39;s hard to tell what state the beetle is currently in, but easier to look back and tell what state the beetle must have been in at a historical point. </p><p>We can also visualize the mode state</p><pre><code class="language-julia hljs">plot(xh[:,5], lab=&quot;Filtering&quot;)
plot!(to1series(sbt[5,:,:]&#39;)..., lab=&quot;Smoothing&quot;, title=&quot;Mode trajectories&quot;, l=(:black,0.2))</code></pre><img src="c17cca23.svg" alt="Example block output"/><p>also this state variable indicates that it&#39;s hard to tell what state the beetle is in during filtering, but obvious with hindsight (smoothing). The mode switch occurs when the filtering distribution of the angle becomes drastically wider, indicating that increased dynamics noise is required in order to describe the motion of the beetle.</p><h2 id="Summary"><a class="docs-heading-anchor" href="#Summary">Summary</a><a id="Summary-1"></a><a class="docs-heading-anchor-permalink" href="#Summary" title="Permalink"></a></h2><p>This example has demonstrated filtering and smoothing in an advanced application that includes manual control over noise, mixed continuous and discrete state.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../noisetuning/">« Noise tuning and disturbance modeling for Kalman filtering</a><a class="docs-footer-nextpage" href="../beetle_example_imm/">IMM-filter tutorial »</a><div class="flexbox-break"></div><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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.8.0 on <span class="colophon-date" title="Saturday 21 December 2024 07:27">Saturday 21 December 2024</span>. Using Julia version 1.11.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
plot!(fig1, sbm[1,:],sbm[2,:], lab=&quot;xs&quot;)</code></pre><img src="6cda41b0.svg" alt="Example block output"/><pre><code class="language-julia hljs">plot!(fig2, identity.(sbm&#39;[:,4]), lab=&quot;smoothed&quot;)</code></pre><img src="18eca807.png" alt="Example block output"/><p>We see that the smoothed trajectory may look very different from the filter trajectory. This is an indication that it&#39;s hard to tell what state the beetle is currently in, but easier to look back and tell what state the beetle must have been in at a historical point. </p><p>We can also visualize the mode state</p><pre><code class="language-julia hljs">plot(xh[:,5], lab=&quot;Filtering&quot;)
plot!(to1series(sbt[5,:,:]&#39;)..., lab=&quot;Smoothing&quot;, title=&quot;Mode trajectories&quot;, l=(:black,0.2))</code></pre><img src="831112a0.svg" alt="Example block output"/><p>also this state variable indicates that it&#39;s hard to tell what state the beetle is in during filtering, but obvious with hindsight (smoothing). The mode switch occurs when the filtering distribution of the angle becomes drastically wider, indicating that increased dynamics noise is required in order to describe the motion of the beetle.</p><h2 id="Summary"><a class="docs-heading-anchor" href="#Summary">Summary</a><a id="Summary-1"></a><a class="docs-heading-anchor-permalink" href="#Summary" title="Permalink"></a></h2><p>This example has demonstrated filtering and smoothing in an advanced application that includes manual control over noise, mixed continuous and discrete state.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../noisetuning/">« Noise tuning and disturbance modeling for Kalman filtering</a><a class="docs-footer-nextpage" href="../beetle_example_imm/">IMM-filter tutorial »</a><div class="flexbox-break"></div><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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.8.0 on <span class="colophon-date" title="Saturday 21 December 2024 09:28">Saturday 21 December 2024</span>. Using Julia version 1.11.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 32fe436

Please sign in to comment.