Skip to content

Commit

Permalink
Added navbar and removed insert_navbar.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jul 21, 2024
1 parent 19ab0af commit 805d675
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions dev/api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@
});
</script>
<!-- NAVBAR END -->

<div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">GPLikelihoods.jl</a></span></div><form class="docs-search" action="../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><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="#Likelihoods"><span>Likelihoods</span></a></li><li><a class="tocitem" href="#Links"><span>Links</span></a></li><li><a class="tocitem" href="#Expectations"><span>Expectations</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"><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-edit-link" href="https://github.com/JuliaGaussianProcesses/GPLikelihoods.jl/blob/master/docs/src/api.md#L" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></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><ul><li><a href="#GPLikelihoods.BernoulliLikelihood"><code>GPLikelihoods.BernoulliLikelihood</code></a></li><li><a href="#GPLikelihoods.BijectiveSimplexLink"><code>GPLikelihoods.BijectiveSimplexLink</code></a></li><li><a href="#GPLikelihoods.CategoricalLikelihood"><code>GPLikelihoods.CategoricalLikelihood</code></a></li><li><a href="#GPLikelihoods.ChainLink"><code>GPLikelihoods.ChainLink</code></a></li><li><a href="#GPLikelihoods.ExpLink"><code>GPLikelihoods.ExpLink</code></a></li><li><a href="#GPLikelihoods.ExponentialLikelihood"><code>GPLikelihoods.ExponentialLikelihood</code></a></li><li><a href="#GPLikelihoods.GammaLikelihood"><code>GPLikelihoods.GammaLikelihood</code></a></li><li><a href="#GPLikelihoods.GaussianLikelihood"><code>GPLikelihoods.GaussianLikelihood</code></a></li><li><a href="#GPLikelihoods.HeteroscedasticGaussianLikelihood"><code>GPLikelihoods.HeteroscedasticGaussianLikelihood</code></a></li><li><a href="#GPLikelihoods.InvLink"><code>GPLikelihoods.InvLink</code></a></li><li><a href="#GPLikelihoods.Link"><code>GPLikelihoods.Link</code></a></li><li><a href="#GPLikelihoods.LogLink"><code>GPLikelihoods.LogLink</code></a></li><li><a href="#GPLikelihoods.LogisticLink"><code>GPLikelihoods.LogisticLink</code></a></li><li><a href="#GPLikelihoods.LogitLink"><code>GPLikelihoods.LogitLink</code></a></li><li><a href="#GPLikelihoods.NBParamFailure"><code>GPLikelihoods.NBParamFailure</code></a></li><li><a href="#GPLikelihoods.NBParamI"><code>GPLikelihoods.NBParamI</code></a></li><li><a href="#GPLikelihoods.NBParamII"><code>GPLikelihoods.NBParamII</code></a></li><li><a href="#GPLikelihoods.NBParamPower"><code>GPLikelihoods.NBParamPower</code></a></li><li><a href="#GPLikelihoods.NBParamSuccess"><code>GPLikelihoods.NBParamSuccess</code></a></li><li><a href="#GPLikelihoods.NegativeBinomialLikelihood"><code>GPLikelihoods.NegativeBinomialLikelihood</code></a></li><li><a href="#GPLikelihoods.NormalCDFLink"><code>GPLikelihoods.NormalCDFLink</code></a></li><li><a href="#GPLikelihoods.PoissonLikelihood"><code>GPLikelihoods.PoissonLikelihood</code></a></li><li><a href="#GPLikelihoods.ProbitLink"><code>GPLikelihoods.ProbitLink</code></a></li><li><a href="#GPLikelihoods.SoftMaxLink"><code>GPLikelihoods.SoftMaxLink</code></a></li><li><a href="#GPLikelihoods.SqrtLink"><code>GPLikelihoods.SqrtLink</code></a></li><li><a href="#GPLikelihoods.SquareLink"><code>GPLikelihoods.SquareLink</code></a></li><li><a href="#GPLikelihoods.expected_loglikelihood"><code>GPLikelihoods.expected_loglikelihood</code></a></li></ul><h2 id="Likelihoods"><a class="docs-heading-anchor" href="#Likelihoods">Likelihoods</a><a id="Likelihoods-1"></a><a class="docs-heading-anchor-permalink" href="#Likelihoods" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-binding" id="GPLikelihoods.BernoulliLikelihood" href="#GPLikelihoods.BernoulliLikelihood"><code>GPLikelihoods.BernoulliLikelihood</code></a><span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">BernoulliLikelihood(l=logistic)</code></pre><p>Bernoulli likelihood is to be used if we assume that the uncertainity associated with the data follows a Bernoulli distribution. The link <code>l</code> needs to transform the input <code>f</code> to the domain [0, 1]</p><p class="math-container">\[ p(y|f) = \operatorname{Bernoulli}(y | l(f))\]</p><p>On calling, this would return a Bernoulli distribution with <code>l(f)</code> probability of <code>true</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaGaussianProcesses/GPLikelihoods.jl/blob/fcb94533be503b11b1be4223d486de0558dc4c31/src/likelihoods/bernoulli.jl#LL1-L12">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="GPLikelihoods.CategoricalLikelihood" href="#GPLikelihoods.CategoricalLikelihood"><code>GPLikelihoods.CategoricalLikelihood</code></a><span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">CategoricalLikelihood(l=BijectiveSimplexLink(softmax))</code></pre><p>Categorical likelihood is to be used if we assume that the uncertainty associated with the data follows a <a href="https://en.wikipedia.org/wiki/Categorical_distribution">Categorical distribution</a>.</p><p>Assuming a distribution with <code>n</code> categories:</p><p><strong><code>n-1</code> inputs (bijective link)</strong></p><p>One can work with a bijective transformation by wrapping a link (like <code>softmax</code>) into a <a href="#GPLikelihoods.BijectiveSimplexLink"><code>BijectiveSimplexLink</code></a> and only needs <code>n-1</code> inputs:</p><p class="math-container">\[ p(y|f_1, f_2, \dots, f_{n-1}) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_{n-1}, 0))\]</p><p>The default constructor is a bijective link around <code>softmax</code>.</p><p><strong><code>n</code> inputs (non-bijective link)</strong></p><p>One can also pass directly the inputs without concatenating a <code>0</code>:</p><p class="math-container">\[ p(y|f_1, f_2, \dots, f_n) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_n))\]</p><p>This variant is over-parametrized, as there are <code>n-1</code> independent parameters embedded in a <code>n</code> dimensional parameter space. For more details, see the end of the section of this <a href="https://en.wikipedia.org/wiki/Exponential_family#Table_of_distributions">Wikipedia link</a> where it corresponds to Variant 1 and 2.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaGaussianProcesses/GPLikelihoods.jl/blob/fcb94533be503b11b1be4223d486de0558dc4c31/src/likelihoods/categorical.jl#LL1-L28">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="GPLikelihoods.ExponentialLikelihood" href="#GPLikelihoods.ExponentialLikelihood"><code>GPLikelihoods.ExponentialLikelihood</code></a><span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">ExponentialLikelihood(l=exp)</code></pre><p>Exponential likelihood with scale given by <code>l(f)</code>.</p><p class="math-container">\[ p(y|f) = \operatorname{Exponential}(y | l(f))\]</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaGaussianProcesses/GPLikelihoods.jl/blob/fcb94533be503b11b1be4223d486de0558dc4c31/src/likelihoods/exponential.jl#LL1-L9">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="GPLikelihoods.GammaLikelihood" href="#GPLikelihoods.GammaLikelihood"><code>GPLikelihoods.GammaLikelihood</code></a><span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">GammaLikelihood(α::Real=1.0, l=exp)</code></pre><p>Gamma likelihood with fixed shape <code>α</code>.</p><p class="math-container">\[ p(y|f) = \operatorname{Gamma}(y | α, l(f))\]</p><p>On calling, this returns a Gamma distribution with shape <code>α</code> and scale <code>invlink(f)</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaGaussianProcesses/GPLikelihoods.jl/blob/fcb94533be503b11b1be4223d486de0558dc4c31/src/likelihoods/gamma.jl#LL1-L10">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="GPLikelihoods.GaussianLikelihood" href="#GPLikelihoods.GaussianLikelihood"><code>GPLikelihoods.GaussianLikelihood</code></a><span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">GaussianLikelihood(σ²)</code></pre><p>Gaussian likelihood with <code>σ²</code> variance. This is to be used if we assume that the uncertainity associated with the data follows a Gaussian distribution.</p><p class="math-container">\[ p(y|f) = \operatorname{Normal}(y | f, σ²)\]</p><p>On calling, this would return a normal distribution with mean <code>f</code> and variance σ².</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaGaussianProcesses/GPLikelihoods.jl/blob/fcb94533be503b11b1be4223d486de0558dc4c31/src/likelihoods/gaussian.jl#LL1-L11">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="GPLikelihoods.HeteroscedasticGaussianLikelihood" href="#GPLikelihoods.HeteroscedasticGaussianLikelihood"><code>GPLikelihoods.HeteroscedasticGaussianLikelihood</code></a><span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">HeteroscedasticGaussianLikelihood(l=exp)</code></pre><p>Heteroscedastic Gaussian likelihood. This is a Gaussian likelihood whose mean and variance are functions of latent processes.</p><p class="math-container">\[ p(y|[f, g]) = \operatorname{Normal}(y | f, sqrt(l(g)))\]</p><p>On calling, this would return a normal distribution with mean <code>f</code> and variance <code>l(g)</code>. Where <code>l</code> is link going from R to R^+</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaGaussianProcesses/GPLikelihoods.jl/blob/fcb94533be503b11b1be4223d486de0558dc4c31/src/likelihoods/gaussian.jl#LL39-L51">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="GPLikelihoods.PoissonLikelihood" href="#GPLikelihoods.PoissonLikelihood"><code>GPLikelihoods.PoissonLikelihood</code></a><span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">PoissonLikelihood(l=exp)</code></pre><p>Poisson likelihood with rate defined as <code>l(f)</code>.</p><p class="math-container">\[ p(y|f) = \operatorname{Poisson}(y | θ=l(f))\]</p><p>This is to be used if we assume that the uncertainity associated with the data follows a Poisson distribution.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaGaussianProcesses/GPLikelihoods.jl/blob/fcb94533be503b11b1be4223d486de0558dc4c31/src/likelihoods/poisson.jl#LL1-L12">source</a></section></article><h3 id="Negative-Binomial"><a class="docs-heading-anchor" href="#Negative-Binomial">Negative Binomial</a><a id="Negative-Binomial-1"></a><a class="docs-heading-anchor-permalink" href="#Negative-Binomial" title="Permalink"></a></h3><article class="docstring"><header><a class="docstring-binding" id="GPLikelihoods.NegativeBinomialLikelihood" href="#GPLikelihoods.NegativeBinomialLikelihood"><code>GPLikelihoods.NegativeBinomialLikelihood</code></a><span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">NegativeBinomialLikelihood(param::NBParam, invlink::Union{Function,Link})</code></pre><p>There are many possible parametrizations for the Negative Binomial likelihood. We follow the convention laid out in p.137 of [^Hilbe&#39;11] and provide some common parametrizations. The <code>NegativeBinomialLikelihood</code> has a special structure; the first type parameter <code>NBParam</code> defines in what parametrization the latent function is used, and contains the other (scalar) parameters. <code>NBParam</code> itself has two subtypes:</p><ul><li><code>NBParamProb</code> for parametrizations where <code>f -&gt; p</code>, the probability of success of a Bernoulli event</li><li><code>NBParamMean</code> for parametrizations where <code>f -&gt; μ</code>, the expected number of events</li></ul><p><strong><code>NBParam</code> predefined types</strong></p><p><strong><code>NBParamProb</code> types with <code>p = invlink(f)</code> the probability of success or failure</strong></p><ul><li><a href="#GPLikelihoods.NBParamSuccess"><code>NBParamSuccess</code></a>: Here <code>p = invlink(f)</code> is the probability of success. This is the definition used in <a href="https://juliastats.org/Distributions.jl/latest/univariate/#Distributions.NegativeBinomial"><code>Distributions.jl</code></a>.</li><li><a href="#GPLikelihoods.NBParamFailure"><code>NBParamFailure</code></a>: Here <code>p = invlink(f)</code> is the probability of a failure</li></ul><p><strong><code>NBParamMean</code> types with <code>μ = invlink(f)</code> the mean/expected number of events</strong></p><ul><li><a href="#GPLikelihoods.NBParamI"><code>NBParamI</code></a>: Mean is linked to <code>f</code> and variance is given by <code>μ(1 + α)</code></li><li><a href="#GPLikelihoods.NBParamII"><code>NBParamII</code></a>: Mean is linked to <code>f</code> and variance is given by <code>μ(1 + α * μ)</code></li><li><a href="#GPLikelihoods.NBParamPower"><code>NBParamPower</code></a>: Mean is linked to <code>f</code> and variance is given by <code>μ(1 + α * μ^ρ)</code></li></ul><p>To create a new parametrization, you need to:</p><ul><li>create a new type <code>struct MyNBParam{T} &lt;: NBParam; myparams::T; end</code>;</li><li>dispatch <code>(l::NegativeBinomialLikelihood{&lt;:MyNBParam})(f::Real)</code>, which must return a <a href="https://juliastats.org/Distributions.jl/latest/univariate/#Distributions.NegativeBinomial"><code>NegativeBinomial</code></a> from <code>Distributions.jl</code>.</li></ul><p><code>NegativeBinomial</code> follows the parametrization of <a href="#GPLikelihoods.NBParamSuccess"><code>NBParamSuccess</code></a>, i.e. the first argument is the number of successes and the second argument is the probability of success.</p><p><strong>Examples</strong></p><pre><code class="language-julia-repl hljs">julia&gt; NegativeBinomialLikelihood(NBParamSuccess(10), logistic)(2.0)
NegativeBinomial{Float64}(r=10.0, p=0.8807970779778824)
julia&gt; NegativeBinomialLikelihood(NBParamFailure(10), logistic)(2.0)
Expand Down
Loading

0 comments on commit 805d675

Please sign in to comment.