Skip to content

Commit 2d87fd6

Browse files
author
Documenter.jl
committed
build based on 08a61eb
1 parent e60c2d3 commit 2d87fd6

File tree

10 files changed

+111
-113
lines changed

10 files changed

+111
-113
lines changed

dev/.documenter-siteinfo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-08-31T02:54:11","documenter_version":"1.6.0"}}
1+
{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-08-31T20:35:08","documenter_version":"1.6.0"}}

dev/abstractmcmc_demo.svg

Lines changed: 31 additions & 33 deletions
Loading

dev/general/index.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,25 +43,25 @@
4343
Iterations = 1:1:10000
4444
Number of chains = 1
4545
Samples per chain = 10000
46-
Wall duration = 4.12 seconds
47-
Compute duration = 4.12 seconds
46+
Wall duration = 4.04 seconds
47+
Compute duration = 4.04 seconds
4848
parameters = s, m
4949
internals = lp
5050

5151
Summary Statistics
5252
<span class="sgr1"> parameters </span> <span class="sgr1"> mean </span> <span class="sgr1"> std </span> <span class="sgr1"> mcse </span> <span class="sgr1"> ess_bulk </span> <span class="sgr1"> ess_tail </span> <span class="sgr1"> rhat </span>
5353
<span class="sgr90"> Symbol </span> <span class="sgr90"> Float64 </span> <span class="sgr90"> Float64 </span> <span class="sgr90"> Float64 </span> <span class="sgr90"> Float64 </span> <span class="sgr90"> Float64 </span> <span class="sgr90"> Float64 </span>
5454

55-
s 1.4919 1.3970 0.0219 5729.2782 4708.2181 0.9999
56-
m 0.0115 1.2178 0.0125 9461.1467 5906.4685 0.9999
55+
s 1.4992 1.3877 0.0210 6135.1586 5059.2571 1.0001
56+
m -0.0037 1.2076 0.0128 8981.1628 5686.1413 1.0000
5757
<span class="sgr36"> 1 column omitted</span>
5858

5959
Quantiles
6060
<span class="sgr1"> parameters </span> <span class="sgr1"> 2.5% </span> <span class="sgr1"> 25.0% </span> <span class="sgr1"> 50.0% </span> <span class="sgr1"> 75.0% </span> <span class="sgr1"> 97.5% </span>
6161
<span class="sgr90"> Symbol </span> <span class="sgr90"> Float64 </span> <span class="sgr90"> Float64 </span> <span class="sgr90"> Float64 </span> <span class="sgr90"> Float64 </span> <span class="sgr90"> Float64 </span>
6262

63-
s 0.4146 0.7695 1.1333 1.7245 4.8352
64-
m -2.4199 -0.7377 0.0210 0.7596 2.4090
63+
s 0.4204 0.7672 1.1281 1.7440 4.7841
64+
m -2.4433 -0.7102 -0.0024 0.7091 2.3687
6565
</code></pre><h3 id="Conditional-sampling-in-a-Turing.Experimental.Gibbs-sampler"><a class="docs-heading-anchor" href="#Conditional-sampling-in-a-Turing.Experimental.Gibbs-sampler">Conditional sampling in a <code>Turing.Experimental.Gibbs</code> sampler</a><a id="Conditional-sampling-in-a-Turing.Experimental.Gibbs-sampler-1"></a><a class="docs-heading-anchor-permalink" href="#Conditional-sampling-in-a-Turing.Experimental.Gibbs-sampler" title="Permalink"></a></h3><p><code>SliceSampling.jl</code> be used as a conditional sampler in <code>Turing.Experimental.Gibbs</code>.</p><pre><code class="language-julia hljs">using Distributions
6666
using Turing
6767
using SliceSampling
@@ -92,23 +92,23 @@
9292
Iterations = 1:1:1000
9393
Number of chains = 1
9494
Samples per chain = 1000
95-
Wall duration = 19.8 seconds
96-
Compute duration = 19.8 seconds
95+
Wall duration = 19.91 seconds
96+
Compute duration = 19.91 seconds
9797
parameters = p, z
9898
internals = lp
9999

100100
Summary Statistics
101101
<span class="sgr1"> parameters </span> <span class="sgr1"> mean </span> <span class="sgr1"> std </span> <span class="sgr1"> mcse </span> <span class="sgr1"> ess_bulk </span> <span class="sgr1"> ess_tail </span> <span class="sgr1"> rhat </span> <span class="sgr1"> e</span>
102102
<span class="sgr90"> Symbol </span> <span class="sgr90"> Float64 </span> <span class="sgr90"> Float64 </span> <span class="sgr90"> Float64 </span> <span class="sgr90"> Float64 </span> <span class="sgr90"> Float64 </span> <span class="sgr90"> Float64 </span> <span class="sgr90"> </span>
103103

104-
p 0.6016 0.2083 0.0071 779.1868 423.8877 1.0053
105-
z 0.3000 0.4585 0.0169 734.4237 NaN 0.9990
104+
p 0.5928 0.1909 0.0065 888.2518 785.1866 0.9999
105+
z 0.2600 0.4389 0.0155 806.7686 NaN 1.0000
106106
<span class="sgr36"> 1 column omitted</span>
107107

108108
Quantiles
109109
<span class="sgr1"> parameters </span> <span class="sgr1"> 2.5% </span> <span class="sgr1"> 25.0% </span> <span class="sgr1"> 50.0% </span> <span class="sgr1"> 75.0% </span> <span class="sgr1"> 97.5% </span>
110110
<span class="sgr90"> Symbol </span> <span class="sgr90"> Float64 </span> <span class="sgr90"> Float64 </span> <span class="sgr90"> Float64 </span> <span class="sgr90"> Float64 </span> <span class="sgr90"> Float64 </span>
111111

112-
p 0.1729 0.4574 0.6219 0.7584 0.9372
112+
p 0.2096 0.4634 0.6052 0.7440 0.9138
113113
z 0.0000 0.0000 0.0000 1.0000 1.0000
114-
</code></pre><h2 id="Drawing-Samples"><a class="docs-heading-anchor" href="#Drawing-Samples">Drawing Samples</a><a id="Drawing-Samples-1"></a><a class="docs-heading-anchor-permalink" href="#Drawing-Samples" title="Permalink"></a></h2><p>For drawing samples using the algorithms provided by <code>SliceSampling</code>, the user only needs to call:</p><pre><code class="language-julia hljs">sample([rng,] model, slice, N; initial_params)</code></pre><ul><li><code>slice::AbstractSliceSampling</code>: Any slice sampling algorithm provided by <code>SliceSampling</code>.</li><li><code>model</code>: A model implementing the <code>LogDensityProblems</code> interface.</li><li><code>N</code>: The number of samples</li></ul><p>The output is a <code>SliceSampling.Transition</code> object, which contains the following:</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="SliceSampling.Transition" href="#SliceSampling.Transition"><code>SliceSampling.Transition</code></a><span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">struct Transition</code></pre><p>Struct containing the results of the transition.</p><p><strong>Fields</strong></p><ul><li><code>params</code>: Samples generated by the transition.</li><li><code>lp::Real</code>: Log-target density of the samples.</li><li><code>info::NamedTuple</code>: Named tuple containing information about the transition. </li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/SliceSampling.jl/blob/c982d253aae2fdca36cc47264608e8c8e165ee30/src/SliceSampling.jl#L24-L33">source</a></section></article><p>For the keyword arguments, <code>SliceSampling</code> allows:</p><ul><li><code>initial_params</code>: The intial state of the Markov chain (default: <code>nothing</code>).</li></ul><p>If <code>initial_params</code> is <code>nothing</code>, the following function can be implemented to provide an initialization:</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="SliceSampling.initial_sample" href="#SliceSampling.initial_sample"><code>SliceSampling.initial_sample</code></a><span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">initial_sample(rng, model)</code></pre><p>Return the initial sample for the <code>model</code> using the random number generator <code>rng</code>.</p><p><strong>Arguments</strong></p><ul><li><code>rng::Random.AbstractRNG</code>: Random number generator.</li><li><code>model</code>: The target <code>LogDensityProblem</code>.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/SliceSampling.jl/blob/c982d253aae2fdca36cc47264608e8c8e165ee30/src/SliceSampling.jl#L45-L53">source</a></section></article><h2 id="Performing-a-Single-Transition"><a class="docs-heading-anchor" href="#Performing-a-Single-Transition">Performing a Single Transition</a><a id="Performing-a-Single-Transition-1"></a><a class="docs-heading-anchor-permalink" href="#Performing-a-Single-Transition" title="Permalink"></a></h2><p>For more fined-grained control, the user can call <code>AbstractMCMC.step</code>. That is, the chain can be initialized by calling:</p><pre><code class="language-julia hljs">transition, state = AbstractMCMC.steps([rng,] model, slice; initial_params)</code></pre><p>and then each MCMC transition on <code>state</code> can be performed by calling:</p><pre><code class="language-julia hljs">transition, state = AbstractMCMC.steps([rng,] model, slice, state)</code></pre><p>For more details, refer to the documentation of <code>AbstractMCMC</code>.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Home</a><a class="docs-footer-nextpage" href="../univariate_slice/">Univariate Slice Sampling »</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.6.0 on <span class="colophon-date" title="Saturday 31 August 2024 02:54">Saturday 31 August 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
114+
</code></pre><h2 id="Drawing-Samples"><a class="docs-heading-anchor" href="#Drawing-Samples">Drawing Samples</a><a id="Drawing-Samples-1"></a><a class="docs-heading-anchor-permalink" href="#Drawing-Samples" title="Permalink"></a></h2><p>For drawing samples using the algorithms provided by <code>SliceSampling</code>, the user only needs to call:</p><pre><code class="language-julia hljs">sample([rng,] model, slice, N; initial_params)</code></pre><ul><li><code>slice::AbstractSliceSampling</code>: Any slice sampling algorithm provided by <code>SliceSampling</code>.</li><li><code>model</code>: A model implementing the <code>LogDensityProblems</code> interface.</li><li><code>N</code>: The number of samples</li></ul><p>The output is a <code>SliceSampling.Transition</code> object, which contains the following:</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="SliceSampling.Transition" href="#SliceSampling.Transition"><code>SliceSampling.Transition</code></a><span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">struct Transition</code></pre><p>Struct containing the results of the transition.</p><p><strong>Fields</strong></p><ul><li><code>params</code>: Samples generated by the transition.</li><li><code>lp::Real</code>: Log-target density of the samples.</li><li><code>info::NamedTuple</code>: Named tuple containing information about the transition. </li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/SliceSampling.jl/blob/08a61eb1f57f59e6ccfacd9747d64dbe2c785445/src/SliceSampling.jl#L24-L33">source</a></section></article><p>For the keyword arguments, <code>SliceSampling</code> allows:</p><ul><li><code>initial_params</code>: The intial state of the Markov chain (default: <code>nothing</code>).</li></ul><p>If <code>initial_params</code> is <code>nothing</code>, the following function can be implemented to provide an initialization:</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="SliceSampling.initial_sample" href="#SliceSampling.initial_sample"><code>SliceSampling.initial_sample</code></a><span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">initial_sample(rng, model)</code></pre><p>Return the initial sample for the <code>model</code> using the random number generator <code>rng</code>.</p><p><strong>Arguments</strong></p><ul><li><code>rng::Random.AbstractRNG</code>: Random number generator.</li><li><code>model</code>: The target <code>LogDensityProblem</code>.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/SliceSampling.jl/blob/08a61eb1f57f59e6ccfacd9747d64dbe2c785445/src/SliceSampling.jl#L45-L53">source</a></section></article><h2 id="Performing-a-Single-Transition"><a class="docs-heading-anchor" href="#Performing-a-Single-Transition">Performing a Single Transition</a><a id="Performing-a-Single-Transition-1"></a><a class="docs-heading-anchor-permalink" href="#Performing-a-Single-Transition" title="Permalink"></a></h2><p>For more fined-grained control, the user can call <code>AbstractMCMC.step</code>. That is, the chain can be initialized by calling:</p><pre><code class="language-julia hljs">transition, state = AbstractMCMC.steps([rng,] model, slice; initial_params)</code></pre><p>and then each MCMC transition on <code>state</code> can be performed by calling:</p><pre><code class="language-julia hljs">transition, state = AbstractMCMC.steps([rng,] model, slice, state)</code></pre><p>For more details, refer to the documentation of <code>AbstractMCMC</code>.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Home</a><a class="docs-footer-nextpage" href="../univariate_slice/">Univariate Slice Sampling »</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.6.0 on <span class="colophon-date" title="Saturday 31 August 2024 20:35">Saturday 31 August 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

0 commit comments

Comments
 (0)