-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Documenter.jl
committed
Oct 8, 2024
1 parent
3d4ccfa
commit 23b3c0b
Showing
19 changed files
with
1,274 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<!--This file is automatically generated by Documenter.jl--> | ||
<meta http-equiv="refresh" content="0; url=./stable/"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v0.6.57 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v0.6.57 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"documenter":{"julia_version":"1.11.0","generation_timestamp":"2024-10-08T15:17:54","documenter_version":"1.7.0"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>API · DistributionsAD</title><meta name="title" content="API · DistributionsAD"/><meta property="og:title" content="API · DistributionsAD"/><meta property="twitter:title" content="API · DistributionsAD"/><meta name="description" content="Documentation for DistributionsAD."/><meta property="og:description" content="Documentation for DistributionsAD."/><meta property="twitter:description" content="Documentation for DistributionsAD."/><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.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/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="../search_index.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/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><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="../">DistributionsAD</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li class="is-active"><a class="tocitem" href>API</a><ul class="internal"><li><a class="tocitem" href="#Functions"><span>Functions</span></a></li></ul></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"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>API</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>API</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://github.com/TuringLang/DistributionsAD.jl" title="View the repository on GitHub"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">GitHub</span></a><a class="docs-navbar-link" href="https://github.com/TuringLang/DistributionsAD.jl/blob/master/docs/src/api.md" title="Edit source on GitHub"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="API"><a class="docs-heading-anchor" href="#API">API</a><a id="API-1"></a><a class="docs-heading-anchor-permalink" href="#API" title="Permalink"></a></h1><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="DistributionsAD.filldist" href="#DistributionsAD.filldist"><code>DistributionsAD.filldist</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">filldist(d::Distribution, ns...)</code></pre><p>Create a product distribution from a single distribution and a list of dimension sizes. If <code>size(d)</code> is <code>(d1, d2, ...)</code> and <code>ns</code> is <code>(n1, n2, ...)</code>, then the resulting distribution will have size <code>(d1, d2, ..., n1, n2, ...)</code>.</p><p>The default behaviour is to use <a href="https://juliastats.org/Distributions.jl/stable/multivariate/#Distributions.product_distribution"><code>Distributions.product_distribution</code></a>, with <code>FillArrays.Fill</code> supplied as the array argument. However, this behaviour is specialised in some instances, such as the one shown below.</p><p>When sampling from the resulting distribution, the output will be an array where each element is sampled from the original distribution <code>d</code>.</p><p><strong>Examples</strong></p><pre><code class="language-julia-repl hljs">julia> d = filldist(Normal(0, 1), 4, 5) # size(Normal(0, 1)) == () | ||
DistributionsAD.MatrixOfUnivariate{Continuous, Normal{Float64}, FillArrays.Fill{Normal{Float64}, 2, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}}( | ||
dists: Fill(Normal{Float64}(μ=0.0, σ=1.0), 4, 5) | ||
) | ||
|
||
julia> size(d) | ||
(4, 5) | ||
|
||
julia> Random.seed!(42); rand(d) | ||
4×5 Matrix{Float64}: | ||
-0.363357 0.816307 -2.11433 0.433886 -0.206613 | ||
0.251737 0.476738 0.0437817 -0.39544 -0.310744 | ||
-0.314988 -0.859555 -0.825335 0.517131 -0.0404734 | ||
-0.311252 -1.46929 0.840289 1.44722 0.104771</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/DistributionsAD.jl/blob/1eeda2d86811655170e0ee540221af150f9d9f74/src/filldist.jl#L1-L34">source</a></section></article><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="DistributionsAD.arraydist" href="#DistributionsAD.arraydist"><code>DistributionsAD.arraydist</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">arraydist(dists::AbstractArray{<:Distribution})</code></pre><p>Create a product distribution from an array of sub-distributions. Each element of <code>dists</code> should have the same size. If the size of each element is <code>(d1, d2, ...)</code>, and <code>size(dists)</code> is <code>(n1, n2, ...)</code>, then the resulting distribution will have size <code>(d1, d2, ..., n1, n2, ...)</code>.</p><p>The default behaviour is to directly use <a href="https://juliastats.org/Distributions.jl/stable/multivariate/#Distributions.product_distribution"><code>Distributions.product_distribution</code></a>, although this can sometimes be specialised.</p><p><strong>Examples</strong></p><pre><code class="language-julia-repl hljs">julia> d1 = arraydist([Normal(0, 1), Normal(10, 1)]) | ||
Product{Continuous, Normal{Float64}, Vector{Normal{Float64}}}(v=Normal{Float64}[Normal{Float64}(μ=0.0, σ=1.0), Normal{Float64}(μ=10.0, σ=1.0)]) | ||
|
||
julia> size(d1) | ||
(2,) | ||
|
||
julia> Random.seed!(42); rand(d1) | ||
2-element Vector{Float64}: | ||
0.7883556016042917 | ||
9.1201414040456 | ||
|
||
julia> d2 = arraydist([Normal(0, 1) Normal(5, 1); Normal(10, 1) Normal(15, 1)]) | ||
DistributionsAD.MatrixOfUnivariate{Continuous, Normal{Float64}, Matrix{Normal{Float64}}}( | ||
dists: Normal{Float64}[Normal{Float64}(μ=0.0, σ=1.0) Normal{Float64}(μ=5.0, σ=1.0); Normal{Float64}(μ=10.0, σ=1.0) Normal{Float64}(μ=15.0, σ=1.0)] | ||
) | ||
|
||
julia> size(d2) | ||
(2, 2) | ||
|
||
julia> Random.seed!(42); rand(d2) | ||
2×2 Matrix{Float64}: | ||
0.788356 4.12621 | ||
9.12014 14.2667</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/DistributionsAD.jl/blob/1eeda2d86811655170e0ee540221af150f9d9f74/src/arraydist.jl#L1-L40">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Home</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 15:17">Tuesday 8 October 2024</span>. Using Julia version 1.11.0.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> |
Oops, something went wrong.