Skip to content

Commit

Permalink
build based on b4ebbf6
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Jun 5, 2024
1 parent 1f5b5fc commit f77dfe0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion previews/PR96/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-06-05T08:09:17","documenter_version":"1.4.1"}}
{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-06-05T08:17:14","documenter_version":"1.4.1"}}
4 changes: 2 additions & 2 deletions previews/PR96/api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
Other allowed proposals are
</code></pre><p>p1 = StaticProposal(Normal(0,1)) p2 = StaticProposal([Normal(0,1), InverseGamma(2,3)]) p3 = StaticProposal((a=Normal(0,1), b=InverseGamma(2,3))) p4 = StaticProposal((x=1.0) -&gt; Normal(x, 1))</p><pre><code class="nohighlight hljs">
The sampler is constructed using
</code></pre><p>julia spl = MetropolisHastings(proposal) ```</p><p>When using <code>MetropolisHastings</code> with the function <code>sample</code>, the following keyword arguments are allowed:</p><ul><li><code>initial_params</code> defines the initial parameterization for your model. If</li></ul><p>none is given, the initial parameters will be drawn from the sampler&#39;s proposals.</p><ul><li><code>param_names</code> is a vector of strings to be assigned to parameters. This is only</li></ul><p>used if <code>chain_type=Chains</code>.</p><ul><li><code>chain_type</code> is the type of chain you would like returned to you. Supported</li></ul><p>types are <code>chain_type=Chains</code> if <code>MCMCChains</code> is imported, or <code>chain_type=StructArray</code> if <code>StructArrays</code> is imported.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/AdvancedMH.jl/blob/e2eb9b615c2942fab2ca5d0fbe0ac9d34c875d00/src/mh-core.jl#L1-L43">source</a></section></article><h2 id="Functions"><a class="docs-heading-anchor" href="#Functions">Functions</a><a id="Functions-1"></a><a class="docs-heading-anchor-permalink" href="#Functions" title="Permalink"></a></h2><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="AdvancedMH.DensityModel" href="#AdvancedMH.DensityModel"><code>AdvancedMH.DensityModel</code></a><span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">DensityModel{F} &lt;: AbstractModel</code></pre><p><code>DensityModel</code> wraps around a self-contained log-liklihood function <code>logdensity</code>.</p><p>Example:</p><pre><code class="language-julia hljs">l(x) = logpdf(Normal(), x)
DensityModel(l)</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/AdvancedMH.jl/blob/e2eb9b615c2942fab2ca5d0fbe0ac9d34c875d00/src/AdvancedMH.jl#L38-L49">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« AdvancedMH.jl</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Wednesday 5 June 2024 08:09">Wednesday 5 June 2024</span>. Using Julia version 1.10.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
</code></pre><p>julia spl = MetropolisHastings(proposal) ```</p><p>When using <code>MetropolisHastings</code> with the function <code>sample</code>, the following keyword arguments are allowed:</p><ul><li><code>initial_params</code> defines the initial parameterization for your model. If</li></ul><p>none is given, the initial parameters will be drawn from the sampler&#39;s proposals.</p><ul><li><code>param_names</code> is a vector of strings to be assigned to parameters. This is only</li></ul><p>used if <code>chain_type=Chains</code>.</p><ul><li><code>chain_type</code> is the type of chain you would like returned to you. Supported</li></ul><p>types are <code>chain_type=Chains</code> if <code>MCMCChains</code> is imported, or <code>chain_type=StructArray</code> if <code>StructArrays</code> is imported.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/AdvancedMH.jl/blob/b4ebbf6d439b8ff4448b9dc51accdc7100cab1d2/src/mh-core.jl#L1-L43">source</a></section></article><h2 id="Functions"><a class="docs-heading-anchor" href="#Functions">Functions</a><a id="Functions-1"></a><a class="docs-heading-anchor-permalink" href="#Functions" title="Permalink"></a></h2><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="AdvancedMH.DensityModel" href="#AdvancedMH.DensityModel"><code>AdvancedMH.DensityModel</code></a><span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">DensityModel{F} &lt;: AbstractModel</code></pre><p><code>DensityModel</code> wraps around a self-contained log-liklihood function <code>logdensity</code>.</p><p>Example:</p><pre><code class="language-julia hljs">l(x) = logpdf(Normal(), x)
DensityModel(l)</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/AdvancedMH.jl/blob/b4ebbf6d439b8ff4448b9dc51accdc7100cab1d2/src/AdvancedMH.jl#L38-L49">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« AdvancedMH.jl</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Wednesday 5 June 2024 08:17">Wednesday 5 June 2024</span>. Using Julia version 1.10.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion previews/PR96/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@
# Sample from the posterior.
chain = sample(model, spl, 100000; initial_params=ones(2), chain_type=StructArray, param_names=[&quot;μ&quot;, &quot;σ&quot;])</code></pre><h3 id="Usage-with-[LogDensityProblems.jl](https://github.com/tpapp/LogDensityProblems.jl)-2"><a class="docs-heading-anchor" href="#Usage-with-[LogDensityProblems.jl](https://github.com/tpapp/LogDensityProblems.jl)-2">Usage with <a href="https://github.com/tpapp/LogDensityProblems.jl"><code>LogDensityProblems.jl</code></a></a><a class="docs-heading-anchor-permalink" href="#Usage-with-[LogDensityProblems.jl](https://github.com/tpapp/LogDensityProblems.jl)-2" title="Permalink"></a></h3><p>As above, we can define the model with the LogDensityProblems.jl interface. We can implement the gradient of the log density function manually, or use <a href="https://github.com/tpapp/LogDensityProblemsAD.jl"><code>LogDensityProblemsAD.jl</code></a> to provide us with the gradient computation used in MALA. Using our implementation of the <code>LogDensityProblems.jl</code> interface above:</p><pre><code class="language-julia hljs">using LogDensityProblemsAD
model_with_ad = LogDensityProblemsAD.ADgradient(Val(:ForwardDiff), LogTargetDensity())
sample(model_with_ad, spl, 100000; initial_params=ones(2), chain_type=StructArray, param_names=[&quot;μ&quot;, &quot;σ&quot;])</code></pre></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="api/">AdvancedMH.jl »</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Wednesday 5 June 2024 08:09">Wednesday 5 June 2024</span>. Using Julia version 1.10.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
sample(model_with_ad, spl, 100000; initial_params=ones(2), chain_type=StructArray, param_names=[&quot;μ&quot;, &quot;σ&quot;])</code></pre></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="api/">AdvancedMH.jl »</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Wednesday 5 June 2024 08:17">Wednesday 5 June 2024</span>. Using Julia version 1.10.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

0 comments on commit f77dfe0

Please sign in to comment.