|
43 | 43 | Iterations = 1:1:10000
|
44 | 44 | Number of chains = 1
|
45 | 45 | Samples per chain = 10000
|
46 |
| -Wall duration = 5.15 seconds |
47 |
| -Compute duration = 5.15 seconds |
| 46 | +Wall duration = 5.07 seconds |
| 47 | +Compute duration = 5.07 seconds |
48 | 48 | parameters = s, m
|
49 | 49 | internals = lp
|
50 | 50 |
|
51 | 51 | Summary Statistics
|
52 | 52 | <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> ⋯
|
53 | 53 | <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> ⋯
|
54 | 54 |
|
55 |
| - s 1.5620 2.9781 0.0475 5449.3692 5223.0625 1.0009 ⋯ |
56 |
| - m 0.0053 1.2591 0.0132 8981.8087 5577.5196 1.0000 ⋯ |
| 55 | + s 1.4998 1.3662 0.0236 5170.1325 4216.5035 1.0001 ⋯ |
| 56 | + m 0.0019 1.2083 0.0132 8508.1940 5824.8080 1.0002 ⋯ |
57 | 57 | <span class="sgr36"> 1 column omitted</span>
|
58 | 58 |
|
59 | 59 | Quantiles
|
60 | 60 | <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>
|
61 | 61 | <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>
|
62 | 62 |
|
63 |
| - s 0.4197 0.7711 1.1312 1.7585 4.9171 |
64 |
| - m -2.4716 -0.7378 -0.0064 0.7306 2.5166 |
| 63 | + s 0.4184 0.7695 1.1179 1.7440 4.8780 |
| 64 | + m -2.4304 -0.7153 0.0131 0.7081 2.3711 |
65 | 65 | </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
|
66 | 66 | using Turing
|
67 | 67 | using SliceSampling
|
|
92 | 92 | Iterations = 1:1:1000
|
93 | 93 | Number of chains = 1
|
94 | 94 | Samples per chain = 1000
|
95 |
| -Wall duration = 23.71 seconds |
96 |
| -Compute duration = 23.71 seconds |
| 95 | +Wall duration = 23.75 seconds |
| 96 | +Compute duration = 23.75 seconds |
97 | 97 | parameters = p, z
|
98 | 98 | internals = lp
|
99 | 99 |
|
100 | 100 | Summary Statistics
|
101 | 101 | <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> ⋯
|
102 | 102 | <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> ⋯
|
103 | 103 |
|
104 |
| - p 0.6001 0.1937 0.0062 953.8497 514.3461 0.9997 ⋯ |
105 |
| - z 0.2620 0.4399 0.0156 798.3987 NaN 0.9997 ⋯ |
| 104 | + p 0.5959 0.2027 0.0070 801.7320 573.6717 1.0000 ⋯ |
| 105 | + z 0.2840 0.4512 0.0167 727.6769 NaN 0.9992 ⋯ |
106 | 106 | <span class="sgr36"> 1 column omitted</span>
|
107 | 107 |
|
108 | 108 | Quantiles
|
109 | 109 | <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>
|
110 | 110 | <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>
|
111 | 111 |
|
112 |
| - p 0.2064 0.4573 0.6128 0.7432 0.9364 |
| 112 | + p 0.1702 0.4560 0.6060 0.7487 0.9322 |
113 | 113 | 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/d2e6208591d6ca2bac3dd166283936c9fc394d2f/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/d2e6208591d6ca2bac3dd166283936c9fc394d2f/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.7.0 on <span class="colophon-date" title="Tuesday 8 October 2024 16:46">Tuesday 8 October 2024</span>. Using Julia version 1.11.0.</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/87d42712065eed0d97b2913801a8761fde19b329/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/87d42712065eed0d97b2913801a8761fde19b329/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.7.0 on <span class="colophon-date" title="Tuesday 8 October 2024 16:47">Tuesday 8 October 2024</span>. Using Julia version 1.11.0.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> |
0 commit comments