From 19ab0af53e75bab7210cc788bb58967d9d125ee6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 14 Jul 2024 16:30:58 +0000 Subject: [PATCH] Added navbar and removed insert_navbar.sh --- dev/api/index.html | 463 ++++++++++++++++++++++++++++++- dev/index.html | 463 ++++++++++++++++++++++++++++++- dev/search/index.html | 463 ++++++++++++++++++++++++++++++- index.html | 1 + previews/PR100/api/index.html | 1 + previews/PR100/index.html | 1 + previews/PR100/search/index.html | 1 + previews/PR105/api/index.html | 1 + previews/PR105/index.html | 1 + previews/PR105/search/index.html | 1 + previews/PR66/api/index.html | 1 + previews/PR66/index.html | 1 + previews/PR66/search/index.html | 1 + previews/PR82/api/index.html | 1 + previews/PR82/index.html | 1 + previews/PR82/search/index.html | 1 + previews/PR99/api/index.html | 1 + previews/PR99/index.html | 1 + previews/PR99/search/index.html | 1 + v0.2.0/index.html | 1 + v0.2.0/search/index.html | 1 + v0.2.1/index.html | 1 + v0.2.1/search/index.html | 1 + v0.2.2/index.html | 1 + v0.2.2/search/index.html | 1 + v0.2.3/index.html | 1 + v0.2.3/search/index.html | 1 + v0.2.4/index.html | 1 + v0.2.4/search/index.html | 1 + v0.2.5/index.html | 1 + v0.2.5/search/index.html | 1 + v0.2.6/index.html | 1 + v0.2.6/search/index.html | 1 + v0.2.7/api/index.html | 1 + v0.2.7/index.html | 1 + v0.2.7/search/index.html | 1 + v0.3.0/api/index.html | 1 + v0.3.0/index.html | 1 + v0.3.0/search/index.html | 1 + v0.3.1/api/index.html | 1 + v0.3.1/index.html | 1 + v0.3.1/search/index.html | 1 + v0.4.0/api/index.html | 1 + v0.4.0/index.html | 1 + v0.4.0/search/index.html | 1 + v0.4.1/api/index.html | 1 + v0.4.1/index.html | 1 + v0.4.1/search/index.html | 1 + v0.4.2/api/index.html | 1 + v0.4.2/index.html | 1 + v0.4.2/search/index.html | 1 + v0.4.3/api/index.html | 1 + v0.4.3/index.html | 1 + v0.4.3/search/index.html | 1 + v0.4.4/api/index.html | 1 + v0.4.4/index.html | 1 + v0.4.4/search/index.html | 1 + v0.4.5/api/index.html | 1 + v0.4.5/index.html | 1 + v0.4.5/search/index.html | 1 + v0.4.6/api/index.html | 1 + v0.4.6/index.html | 1 + v0.4.6/search/index.html | 1 + v0.4.7/api/index.html | 1 + v0.4.7/index.html | 1 + v0.4.7/search/index.html | 1 + 66 files changed, 1449 insertions(+), 3 deletions(-) diff --git a/dev/api/index.html b/dev/api/index.html index bdbe57a..e235816 100644 --- a/dev/api/index.html +++ b/dev/api/index.html @@ -1,5 +1,465 @@ -API · GPLikelihoods.jl

API

Likelihoods

GPLikelihoods.BernoulliLikelihoodType
BernoulliLikelihood(l=logistic)

Bernoulli likelihood is to be used if we assume that the uncertainity associated with the data follows a Bernoulli distribution. The link l needs to transform the input f to the domain [0, 1]

\[ p(y|f) = \operatorname{Bernoulli}(y | l(f))\]

On calling, this would return a Bernoulli distribution with l(f) probability of true.

source
GPLikelihoods.CategoricalLikelihoodType
CategoricalLikelihood(l=BijectiveSimplexLink(softmax))

Categorical likelihood is to be used if we assume that the uncertainty associated with the data follows a Categorical distribution.

Assuming a distribution with n categories:

n-1 inputs (bijective link)

One can work with a bijective transformation by wrapping a link (like softmax) into a BijectiveSimplexLink and only needs n-1 inputs:

\[ p(y|f_1, f_2, \dots, f_{n-1}) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_{n-1}, 0))\]

The default constructor is a bijective link around softmax.

n inputs (non-bijective link)

One can also pass directly the inputs without concatenating a 0:

\[ p(y|f_1, f_2, \dots, f_n) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_n))\]

This variant is over-parametrized, as there are n-1 independent parameters embedded in a n dimensional parameter space. For more details, see the end of the section of this Wikipedia link where it corresponds to Variant 1 and 2.

source
GPLikelihoods.GammaLikelihoodType
GammaLikelihood(α::Real=1.0, l=exp)

Gamma likelihood with fixed shape α.

\[ p(y|f) = \operatorname{Gamma}(y | α, l(f))\]

On calling, this returns a Gamma distribution with shape α and scale invlink(f).

source
GPLikelihoods.GaussianLikelihoodType
GaussianLikelihood(σ²)

Gaussian likelihood with σ² variance. This is to be used if we assume that the uncertainity associated with the data follows a Gaussian distribution.

\[ p(y|f) = \operatorname{Normal}(y | f, σ²)\]

On calling, this would return a normal distribution with mean f and variance σ².

source
GPLikelihoods.HeteroscedasticGaussianLikelihoodType
HeteroscedasticGaussianLikelihood(l=exp)

Heteroscedastic Gaussian likelihood. This is a Gaussian likelihood whose mean and variance are functions of latent processes.

\[ p(y|[f, g]) = \operatorname{Normal}(y | f, sqrt(l(g)))\]

On calling, this would return a normal distribution with mean f and variance l(g). Where l is link going from R to R^+

source
GPLikelihoods.PoissonLikelihoodType
PoissonLikelihood(l=exp)

Poisson likelihood with rate defined as l(f).

\[ p(y|f) = \operatorname{Poisson}(y | θ=l(f))\]

This is to be used if we assume that the uncertainity associated with the data follows a Poisson distribution.

source

Negative Binomial

GPLikelihoods.NegativeBinomialLikelihoodType
NegativeBinomialLikelihood(param::NBParam, invlink::Union{Function,Link})

There are many possible parametrizations for the Negative Binomial likelihood. We follow the convention laid out in p.137 of [^Hilbe'11] and provide some common parametrizations. The NegativeBinomialLikelihood has a special structure; the first type parameter NBParam defines in what parametrization the latent function is used, and contains the other (scalar) parameters. NBParam itself has two subtypes:

  • NBParamProb for parametrizations where f -> p, the probability of success of a Bernoulli event
  • NBParamMean for parametrizations where f -> μ, the expected number of events

NBParam predefined types

NBParamProb types with p = invlink(f) the probability of success or failure

NBParamMean types with μ = invlink(f) the mean/expected number of events

  • NBParamI: Mean is linked to f and variance is given by μ(1 + α)
  • NBParamII: Mean is linked to f and variance is given by μ(1 + α * μ)
  • NBParamPower: Mean is linked to f and variance is given by μ(1 + α * μ^ρ)

To create a new parametrization, you need to:

  • create a new type struct MyNBParam{T} <: NBParam; myparams::T; end;
  • dispatch (l::NegativeBinomialLikelihood{<:MyNBParam})(f::Real), which must return a NegativeBinomial from Distributions.jl.

NegativeBinomial follows the parametrization of NBParamSuccess, i.e. the first argument is the number of successes and the second argument is the probability of success.

Examples

julia> NegativeBinomialLikelihood(NBParamSuccess(10), logistic)(2.0)
+API · GPLikelihoods.jl
+
+
+
+
+
+

API

Likelihoods

GPLikelihoods.BernoulliLikelihoodType
BernoulliLikelihood(l=logistic)

Bernoulli likelihood is to be used if we assume that the uncertainity associated with the data follows a Bernoulli distribution. The link l needs to transform the input f to the domain [0, 1]

\[ p(y|f) = \operatorname{Bernoulli}(y | l(f))\]

On calling, this would return a Bernoulli distribution with l(f) probability of true.

source
GPLikelihoods.CategoricalLikelihoodType
CategoricalLikelihood(l=BijectiveSimplexLink(softmax))

Categorical likelihood is to be used if we assume that the uncertainty associated with the data follows a Categorical distribution.

Assuming a distribution with n categories:

n-1 inputs (bijective link)

One can work with a bijective transformation by wrapping a link (like softmax) into a BijectiveSimplexLink and only needs n-1 inputs:

\[ p(y|f_1, f_2, \dots, f_{n-1}) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_{n-1}, 0))\]

The default constructor is a bijective link around softmax.

n inputs (non-bijective link)

One can also pass directly the inputs without concatenating a 0:

\[ p(y|f_1, f_2, \dots, f_n) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_n))\]

This variant is over-parametrized, as there are n-1 independent parameters embedded in a n dimensional parameter space. For more details, see the end of the section of this Wikipedia link where it corresponds to Variant 1 and 2.

source
GPLikelihoods.GammaLikelihoodType
GammaLikelihood(α::Real=1.0, l=exp)

Gamma likelihood with fixed shape α.

\[ p(y|f) = \operatorname{Gamma}(y | α, l(f))\]

On calling, this returns a Gamma distribution with shape α and scale invlink(f).

source
GPLikelihoods.GaussianLikelihoodType
GaussianLikelihood(σ²)

Gaussian likelihood with σ² variance. This is to be used if we assume that the uncertainity associated with the data follows a Gaussian distribution.

\[ p(y|f) = \operatorname{Normal}(y | f, σ²)\]

On calling, this would return a normal distribution with mean f and variance σ².

source
GPLikelihoods.HeteroscedasticGaussianLikelihoodType
HeteroscedasticGaussianLikelihood(l=exp)

Heteroscedastic Gaussian likelihood. This is a Gaussian likelihood whose mean and variance are functions of latent processes.

\[ p(y|[f, g]) = \operatorname{Normal}(y | f, sqrt(l(g)))\]

On calling, this would return a normal distribution with mean f and variance l(g). Where l is link going from R to R^+

source
GPLikelihoods.PoissonLikelihoodType
PoissonLikelihood(l=exp)

Poisson likelihood with rate defined as l(f).

\[ p(y|f) = \operatorname{Poisson}(y | θ=l(f))\]

This is to be used if we assume that the uncertainity associated with the data follows a Poisson distribution.

source

Negative Binomial

GPLikelihoods.NegativeBinomialLikelihoodType
NegativeBinomialLikelihood(param::NBParam, invlink::Union{Function,Link})

There are many possible parametrizations for the Negative Binomial likelihood. We follow the convention laid out in p.137 of [^Hilbe'11] and provide some common parametrizations. The NegativeBinomialLikelihood has a special structure; the first type parameter NBParam defines in what parametrization the latent function is used, and contains the other (scalar) parameters. NBParam itself has two subtypes:

  • NBParamProb for parametrizations where f -> p, the probability of success of a Bernoulli event
  • NBParamMean for parametrizations where f -> μ, the expected number of events

NBParam predefined types

NBParamProb types with p = invlink(f) the probability of success or failure

NBParamMean types with μ = invlink(f) the mean/expected number of events

  • NBParamI: Mean is linked to f and variance is given by μ(1 + α)
  • NBParamII: Mean is linked to f and variance is given by μ(1 + α * μ)
  • NBParamPower: Mean is linked to f and variance is given by μ(1 + α * μ^ρ)

To create a new parametrization, you need to:

  • create a new type struct MyNBParam{T} <: NBParam; myparams::T; end;
  • dispatch (l::NegativeBinomialLikelihood{<:MyNBParam})(f::Real), which must return a NegativeBinomial from Distributions.jl.

NegativeBinomial follows the parametrization of NBParamSuccess, i.e. the first argument is the number of successes and the second argument is the probability of success.

Examples

julia> NegativeBinomialLikelihood(NBParamSuccess(10), logistic)(2.0)
 NegativeBinomial{Float64}(r=10.0, p=0.8807970779778824)
 julia> NegativeBinomialLikelihood(NBParamFailure(10), logistic)(2.0)
 NegativeBinomial{Float64}(r=10.0, p=0.11920292202211757)
@@ -15,3 +475,4 @@
     q_f::AbstractVector{<:Normal},
     y::AbstractVector,
 )

This function computes the expected log likelihood:

\[ ∫ q(f) log p(y | f) df\]

where p(y | f) is the process likelihood. This is described by lik, which should be a callable that takes f as input and returns a Distribution over y that supports loglikelihood(lik(f), y).

q(f) is an approximation to the latent function values f given by:

\[ q(f) = ∫ p(f | u) q(u) du\]

where q(u) is the variational distribution over inducing points. The marginal distributions of q(f) are given by q_f.

quadrature determines which method is used to calculate the expected log likelihood.

Extended help

q(f) is assumed to be an MvNormal distribution and p(y | f) is assumed to have independent marginals such that only the marginals of q(f) are required.

source
expected_loglikelihood(::DefaultExpectationMethod, lik, q_f::AbstractVector{<:Normal}, y::AbstractVector)

The expected log likelihood, using the default quadrature method for the given likelihood. (The default quadrature method is defined by default_expectation_method(lik), and should be the closed form solution if it exists, but otherwise defaults to Gauss-Hermite quadrature.)

source
+ diff --git a/dev/index.html b/dev/index.html index ac0adee..6212ed9 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,463 @@ -Home · GPLikelihoods.jl

GPLikelihoods

GPLikelihoods.jl provides a practical interface to connect Gaussian and non-conjugate likelihoods to Gaussian Processes. The API is very basic: Every AbstractLikelihood object is a functor taking a Real or an AbstractVector as an input and returning a Distribution from Distributions.jl.

Single-latent vs multi-latent likelihoods

Most likelihoods, like the GaussianLikelihood, only require one latent Gaussian process. Passing a Real will therefore return a UnivariateDistribution, and passing an AbstractVector{<:Real} will return a multivariate product of distributions.

julia> f = 2.0;
julia> GaussianLikelihood()(f) == Normal(2.0, 1e-3)true
julia> fs = [2.0, 3.0, 1.5];
julia> GaussianLikelihood()(fs) isa AbstractMvNormaltrue

Some likelihoods, like the CategoricalLikelihood, require multiple latent Gaussian processes, and an AbstractVector{<:Real} needs to be passed. To obtain a product of distributions an AbstractVector{<:AbstractVector{<:Real}} has to be passed (we recommend using ColVecs and RowVecs from KernelFunctions.jl if you need to transform an AbstractMatrix).

julia> fs = [2.0, 3.0, 4.5];
julia> CategoricalLikelihood()(fs) isa Categoricaltrue
julia> Fs = [rand(3) for _ in 1:4];
julia> CategoricalLikelihood()(Fs) isa Product{<:Any,<:Categorical}true

Constrained parameters

The function values f of the latent Gaussian process live in the real domain $\mathbb{R}$. For some likelihoods, the domain of the distribution parameter p that is modulated by the latent Gaussian process is constrained to some subset of $\mathbb{R}$, e.g. only positive values or values in an interval.

To connect these two domains, a transformation from f to p is required. For this, we provide the Link type, which can be passed to the likelihood constructors. (Alternatively, functions can also directly be passed and will be wrapped in a Link.)

We typically call this passed transformation the invlink. This comes from the statistics literature, where the "link" is defined as f = link(p), whereas here we need p = invlink(f).

For more details about which likelihoods require a Link check out their docs.

A classical example is the BernoulliLikelihood for classification, with the probability parameter $p \in [0, 1]$. The default is to use a logistic transformation, but one could also use the inverse of the probit link:

julia> f = 2.0;
julia> BernoulliLikelihood()(f) == Bernoulli(logistic(f))true
julia> BernoulliLikelihood(NormalCDFLink())(f) == Bernoulli(normcdf(f))true

Note that we passed the inverse of the probit function which is the normcdf function.

+Home · GPLikelihoods.jl + + + + + +

GPLikelihoods

GPLikelihoods.jl provides a practical interface to connect Gaussian and non-conjugate likelihoods to Gaussian Processes. The API is very basic: Every AbstractLikelihood object is a functor taking a Real or an AbstractVector as an input and returning a Distribution from Distributions.jl.

Single-latent vs multi-latent likelihoods

Most likelihoods, like the GaussianLikelihood, only require one latent Gaussian process. Passing a Real will therefore return a UnivariateDistribution, and passing an AbstractVector{<:Real} will return a multivariate product of distributions.

julia> f = 2.0;
julia> GaussianLikelihood()(f) == Normal(2.0, 1e-3)true
julia> fs = [2.0, 3.0, 1.5];
julia> GaussianLikelihood()(fs) isa AbstractMvNormaltrue

Some likelihoods, like the CategoricalLikelihood, require multiple latent Gaussian processes, and an AbstractVector{<:Real} needs to be passed. To obtain a product of distributions an AbstractVector{<:AbstractVector{<:Real}} has to be passed (we recommend using ColVecs and RowVecs from KernelFunctions.jl if you need to transform an AbstractMatrix).

julia> fs = [2.0, 3.0, 4.5];
julia> CategoricalLikelihood()(fs) isa Categoricaltrue
julia> Fs = [rand(3) for _ in 1:4];
julia> CategoricalLikelihood()(Fs) isa Product{<:Any,<:Categorical}true

Constrained parameters

The function values f of the latent Gaussian process live in the real domain $\mathbb{R}$. For some likelihoods, the domain of the distribution parameter p that is modulated by the latent Gaussian process is constrained to some subset of $\mathbb{R}$, e.g. only positive values or values in an interval.

To connect these two domains, a transformation from f to p is required. For this, we provide the Link type, which can be passed to the likelihood constructors. (Alternatively, functions can also directly be passed and will be wrapped in a Link.)

We typically call this passed transformation the invlink. This comes from the statistics literature, where the "link" is defined as f = link(p), whereas here we need p = invlink(f).

For more details about which likelihoods require a Link check out their docs.

A classical example is the BernoulliLikelihood for classification, with the probability parameter $p \in [0, 1]$. The default is to use a logistic transformation, but one could also use the inverse of the probit link:

julia> f = 2.0;
julia> BernoulliLikelihood()(f) == Bernoulli(logistic(f))true
julia> BernoulliLikelihood(NormalCDFLink())(f) == Bernoulli(normcdf(f))true

Note that we passed the inverse of the probit function which is the normcdf function.

+ diff --git a/dev/search/index.html b/dev/search/index.html index 6698b82..2697634 100644 --- a/dev/search/index.html +++ b/dev/search/index.html @@ -1,2 +1,463 @@ -Search · GPLikelihoods.jl

Loading search...

    +Search · GPLikelihoods.jl + + + + + +

    Loading search...

      + diff --git a/index.html b/index.html index 6a5afc3..3ac2596 100644 --- a/index.html +++ b/index.html @@ -1,2 +1,3 @@ + diff --git a/previews/PR100/api/index.html b/previews/PR100/api/index.html index 77b6edd..545786a 100644 --- a/previews/PR100/api/index.html +++ b/previews/PR100/api/index.html @@ -459,6 +459,7 @@ }); +

      API

      Likelihoods

      GPLikelihoods.BernoulliLikelihoodType
      BernoulliLikelihood(l=logistic)

      Bernoulli likelihood is to be used if we assume that the uncertainity associated with the data follows a Bernoulli distribution. The link l needs to transform the input f to the domain [0, 1]

      \[ p(y|f) = \operatorname{Bernoulli}(y | l(f))\]

      On calling, this would return a Bernoulli distribution with l(f) probability of true.

      source
      GPLikelihoods.CategoricalLikelihoodType
      CategoricalLikelihood(l=BijectiveSimplexLink(softmax))

      Categorical likelihood is to be used if we assume that the uncertainty associated with the data follows a Categorical distribution.

      Assuming a distribution with n categories:

      n-1 inputs (bijective link)

      One can work with a bijective transformation by wrapping a link (like softmax) into a BijectiveSimplexLink and only needs n-1 inputs:

      \[ p(y|f_1, f_2, \dots, f_{n-1}) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_{n-1}, 0))\]

      The default constructor is a bijective link around softmax.

      n inputs (non-bijective link)

      One can also pass directly the inputs without concatenating a 0:

      \[ p(y|f_1, f_2, \dots, f_n) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_n))\]

      This variant is over-parametrized, as there are n-1 independent parameters embedded in a n dimensional parameter space. For more details, see the end of the section of this Wikipedia link where it corresponds to Variant 1 and 2.

      source
      GPLikelihoods.GammaLikelihoodType
      GammaLikelihood(α::Real=1.0, l=exp)

      Gamma likelihood with fixed shape α.

      \[ p(y|f) = \operatorname{Gamma}(y | α, l(f))\]

      On calling, this returns a Gamma distribution with shape α and scale invlink(f).

      source
      GPLikelihoods.GaussianLikelihoodType
      GaussianLikelihood(σ²)

      Gaussian likelihood with σ² variance. This is to be used if we assume that the uncertainity associated with the data follows a Gaussian distribution.

      \[ p(y|f) = \operatorname{Normal}(y | f, σ²)\]

      On calling, this would return a normal distribution with mean f and variance σ².

      source
      GPLikelihoods.HeteroscedasticGaussianLikelihoodType
      HeteroscedasticGaussianLikelihood(l=exp)

      Heteroscedastic Gaussian likelihood. This is a Gaussian likelihood whose mean and variance are functions of latent processes.

      \[ p(y|[f, g]) = \operatorname{Normal}(y | f, sqrt(l(g)))\]

      On calling, this would return a normal distribution with mean f and variance l(g). Where l is link going from R to R^+

      source
      GPLikelihoods.PoissonLikelihoodType
      PoissonLikelihood(l=exp)

      Poisson likelihood with rate defined as l(f).

      \[ p(y|f) = \operatorname{Poisson}(y | θ=l(f))\]

      This is to be used if we assume that the uncertainity associated with the data follows a Poisson distribution.

      source

      Negative Binomial

      GPLikelihoods.NegativeBinomialLikelihoodType
      NegativeBinomialLikelihood(param::NBParam, invlink::Union{Function,Link})

      There are many possible parametrizations for the Negative Binomial likelihood. We follow the convention laid out in p.137 of [^Hilbe'11] and provide some common parametrizations. The NegativeBinomialLikelihood has a special structure; the first type parameter NBParam defines in what parametrization the latent function is used, and contains the other (scalar) parameters. NBParam itself has two subtypes:

      • NBParamProb for parametrizations where f -> p, the probability of success of a Bernoulli event
      • NBParamMean for parametrizations where f -> μ, the expected number of events

      NBParam predefined types

      NBParamProb types with p = invlink(f) the probability of success

      NBParamMean types with μ = invlink(f) the mean/expected number of events

      • NBParamI: Mean is linked to f and variance is given by μ(1 + α)
      • NBParamII: Mean is linked to f and variance is given by μ(1 + α * μ)
      • NBParamPower: Mean is linked to f and variance is given by μ(1 + α * μ^ρ)

      To create a new parametrization, you need to:

      • create a new type struct MyNBParam{T} <: NBParam; myparams::T; end;
      • dispatch (l::NegativeBinomialLikelihood{<:MyNBParam})(f::Real), which must return a NegativeBinomial from Distributions.jl.

      NegativeBinomial follows the parametrization of NBParamSuccess, i.e. the first argument is the number of successes and the second argument is the probability of success.

      Examples

      julia> NegativeBinomialLikelihood(NBParamSuccess(10), logistic)(2.0)
       NegativeBinomial{Float64}(r=10.0, p=0.8807970779778824)
       julia> NegativeBinomialLikelihood(NBParamFailure(10), logistic)(2.0)
      diff --git a/previews/PR100/index.html b/previews/PR100/index.html
      index d3ed606..fd65c6e 100644
      --- a/previews/PR100/index.html
      +++ b/previews/PR100/index.html
      @@ -459,5 +459,6 @@
           });
       
       
      +
       

      GPLikelihoods

      GPLikelihoods.jl provides a practical interface to connect Gaussian and non-conjugate likelihoods to Gaussian Processes. The API is very basic: Every AbstractLikelihood object is a functor taking a Real or an AbstractVector as an input and returning a Distribution from Distributions.jl.

      Single-latent vs multi-latent likelihoods

      Most likelihoods, like the GaussianLikelihood, only require one latent Gaussian process. Passing a Real will therefore return a UnivariateDistribution, and passing an AbstractVector{<:Real} will return a multivariate product of distributions.

      julia> f = 2.0;
      julia> GaussianLikelihood()(f) == Normal(2.0, 1e-3)true
      julia> fs = [2.0, 3.0, 1.5];
      julia> GaussianLikelihood()(fs) isa AbstractMvNormaltrue

      Some likelihoods, like the CategoricalLikelihood, require multiple latent Gaussian processes, and an AbstractVector{<:Real} needs to be passed. To obtain a product of distributions an AbstractVector{<:AbstractVector{<:Real}} has to be passed (we recommend using ColVecs and RowVecs from KernelFunctions.jl if you need to transform an AbstractMatrix).

      julia> fs = [2.0, 3.0, 4.5];
      julia> CategoricalLikelihood()(fs) isa Categoricaltrue
      julia> Fs = [rand(3) for _ in 1:4];
      julia> CategoricalLikelihood()(Fs) isa Product{<:Any,<:Categorical}true

      Constrained parameters

      The function values f of the latent Gaussian process live in the real domain $\mathbb{R}$. For some likelihoods, the domain of the distribution parameter p that is modulated by the latent Gaussian process is constrained to some subset of $\mathbb{R}$, e.g. only positive values or values in an interval.

      To connect these two domains, a transformation from f to p is required. For this, we provide the Link type, which can be passed to the likelihood constructors. (Alternatively, functions can also directly be passed and will be wrapped in a Link.)

      We typically call this passed transformation the invlink. This comes from the statistics literature, where the "link" is defined as f = link(p), whereas here we need p = invlink(f).

      For more details about which likelihoods require a Link check out their docs.

      A classical example is the BernoulliLikelihood for classification, with the probability parameter $p \in [0, 1]$. The default is to use a logistic transformation, but one could also use the inverse of the probit link:

      julia> f = 2.0;
      julia> BernoulliLikelihood()(f) == Bernoulli(logistic(f))true
      julia> BernoulliLikelihood(NormalCDFLink())(f) == Bernoulli(normcdf(f))true

      Note that we passed the inverse of the probit function which is the normcdf function.

      diff --git a/previews/PR100/search/index.html b/previews/PR100/search/index.html index 55b0013..50a29a3 100644 --- a/previews/PR100/search/index.html +++ b/previews/PR100/search/index.html @@ -459,5 +459,6 @@ }); +

      Loading search...

        diff --git a/previews/PR105/api/index.html b/previews/PR105/api/index.html index d144a37..bc4c8da 100644 --- a/previews/PR105/api/index.html +++ b/previews/PR105/api/index.html @@ -459,6 +459,7 @@ }); +

        API

        Likelihoods

        GPLikelihoods.BernoulliLikelihoodType
        BernoulliLikelihood(l=logistic)

        Bernoulli likelihood is to be used if we assume that the uncertainity associated with the data follows a Bernoulli distribution. The link l needs to transform the input f to the domain [0, 1]

        \[ p(y|f) = \operatorname{Bernoulli}(y | l(f))\]

        On calling, this would return a Bernoulli distribution with l(f) probability of true.

        source
        GPLikelihoods.CategoricalLikelihoodType
        CategoricalLikelihood(l=BijectiveSimplexLink(softmax))

        Categorical likelihood is to be used if we assume that the uncertainty associated with the data follows a Categorical distribution.

        Assuming a distribution with n categories:

        n-1 inputs (bijective link)

        One can work with a bijective transformation by wrapping a link (like softmax) into a BijectiveSimplexLink and only needs n-1 inputs:

        \[ p(y|f_1, f_2, \dots, f_{n-1}) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_{n-1}, 0))\]

        The default constructor is a bijective link around softmax.

        n inputs (non-bijective link)

        One can also pass directly the inputs without concatenating a 0:

        \[ p(y|f_1, f_2, \dots, f_n) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_n))\]

        This variant is over-parametrized, as there are n-1 independent parameters embedded in a n dimensional parameter space. For more details, see the end of the section of this Wikipedia link where it corresponds to Variant 1 and 2.

        source
        GPLikelihoods.GammaLikelihoodType
        GammaLikelihood(α::Real=1.0, l=exp)

        Gamma likelihood with fixed shape α.

        \[ p(y|f) = \operatorname{Gamma}(y | α, l(f))\]

        On calling, this returns a Gamma distribution with shape α and scale invlink(f).

        source
        GPLikelihoods.GaussianLikelihoodType
        GaussianLikelihood(σ²)

        Gaussian likelihood with σ² variance. This is to be used if we assume that the uncertainity associated with the data follows a Gaussian distribution.

        \[ p(y|f) = \operatorname{Normal}(y | f, σ²)\]

        On calling, this would return a normal distribution with mean f and variance σ².

        source
        GPLikelihoods.HeteroscedasticGaussianLikelihoodType
        HeteroscedasticGaussianLikelihood(l=exp)

        Heteroscedastic Gaussian likelihood. This is a Gaussian likelihood whose mean and variance are functions of latent processes.

        \[ p(y|[f, g]) = \operatorname{Normal}(y | f, sqrt(l(g)))\]

        On calling, this would return a normal distribution with mean f and variance l(g). Where l is link going from R to R^+

        source
        GPLikelihoods.PoissonLikelihoodType
        PoissonLikelihood(l=exp)

        Poisson likelihood with rate defined as l(f).

        \[ p(y|f) = \operatorname{Poisson}(y | θ=l(f))\]

        This is to be used if we assume that the uncertainity associated with the data follows a Poisson distribution.

        source

        Negative Binomial

        GPLikelihoods.NegativeBinomialLikelihoodType
        NegativeBinomialLikelihood(param::NBParam, invlink::Union{Function,Link})

        There are many possible parametrizations for the Negative Binomial likelihood. We follow the convention laid out in p.137 of [^Hilbe'11] and provide some common parametrizations. The NegativeBinomialLikelihood has a special structure; the first type parameter NBParam defines in what parametrization the latent function is used, and contains the other (scalar) parameters. NBParam itself has two subtypes:

        • NBParamProb for parametrizations where f -> p, the probability of success of a Bernoulli event
        • NBParamMean for parametrizations where f -> μ, the expected number of events

        NBParam predefined types

        NBParamProb types with p = invlink(f) the probability of success or failure

        NBParamMean types with μ = invlink(f) the mean/expected number of events

        • NBParamI: Mean is linked to f and variance is given by μ(1 + α)
        • NBParamII: Mean is linked to f and variance is given by μ(1 + α * μ)
        • NBParamPower: Mean is linked to f and variance is given by μ(1 + α * μ^ρ)

        To create a new parametrization, you need to:

        • create a new type struct MyNBParam{T} <: NBParam; myparams::T; end;
        • dispatch (l::NegativeBinomialLikelihood{<:MyNBParam})(f::Real), which must return a NegativeBinomial from Distributions.jl.

        NegativeBinomial follows the parametrization of NBParamSuccess, i.e. the first argument is the number of successes and the second argument is the probability of success.

        Examples

        julia> NegativeBinomialLikelihood(NBParamSuccess(10), logistic)(2.0)
         NegativeBinomial{Float64}(r=10.0, p=0.8807970779778824)
         julia> NegativeBinomialLikelihood(NBParamFailure(10), logistic)(2.0)
        diff --git a/previews/PR105/index.html b/previews/PR105/index.html
        index 4b6cc62..f390b1b 100644
        --- a/previews/PR105/index.html
        +++ b/previews/PR105/index.html
        @@ -459,5 +459,6 @@
             });
         
         
        +
         

        GPLikelihoods

        GPLikelihoods.jl provides a practical interface to connect Gaussian and non-conjugate likelihoods to Gaussian Processes. The API is very basic: Every AbstractLikelihood object is a functor taking a Real or an AbstractVector as an input and returning a Distribution from Distributions.jl.

        Single-latent vs multi-latent likelihoods

        Most likelihoods, like the GaussianLikelihood, only require one latent Gaussian process. Passing a Real will therefore return a UnivariateDistribution, and passing an AbstractVector{<:Real} will return a multivariate product of distributions.

        julia> f = 2.0;
        julia> GaussianLikelihood()(f) == Normal(2.0, 1e-3)true
        julia> fs = [2.0, 3.0, 1.5];
        julia> GaussianLikelihood()(fs) isa AbstractMvNormaltrue

        Some likelihoods, like the CategoricalLikelihood, require multiple latent Gaussian processes, and an AbstractVector{<:Real} needs to be passed. To obtain a product of distributions an AbstractVector{<:AbstractVector{<:Real}} has to be passed (we recommend using ColVecs and RowVecs from KernelFunctions.jl if you need to transform an AbstractMatrix).

        julia> fs = [2.0, 3.0, 4.5];
        julia> CategoricalLikelihood()(fs) isa Categoricaltrue
        julia> Fs = [rand(3) for _ in 1:4];
        julia> CategoricalLikelihood()(Fs) isa Product{<:Any,<:Categorical}true

        Constrained parameters

        The function values f of the latent Gaussian process live in the real domain $\mathbb{R}$. For some likelihoods, the domain of the distribution parameter p that is modulated by the latent Gaussian process is constrained to some subset of $\mathbb{R}$, e.g. only positive values or values in an interval.

        To connect these two domains, a transformation from f to p is required. For this, we provide the Link type, which can be passed to the likelihood constructors. (Alternatively, functions can also directly be passed and will be wrapped in a Link.)

        We typically call this passed transformation the invlink. This comes from the statistics literature, where the "link" is defined as f = link(p), whereas here we need p = invlink(f).

        For more details about which likelihoods require a Link check out their docs.

        A classical example is the BernoulliLikelihood for classification, with the probability parameter $p \in [0, 1]$. The default is to use a logistic transformation, but one could also use the inverse of the probit link:

        julia> f = 2.0;
        julia> BernoulliLikelihood()(f) == Bernoulli(logistic(f))true
        julia> BernoulliLikelihood(NormalCDFLink())(f) == Bernoulli(normcdf(f))true

        Note that we passed the inverse of the probit function which is the normcdf function.

        diff --git a/previews/PR105/search/index.html b/previews/PR105/search/index.html index a5dea0f..a19b082 100644 --- a/previews/PR105/search/index.html +++ b/previews/PR105/search/index.html @@ -459,5 +459,6 @@ }); +

        Loading search...

          diff --git a/previews/PR66/api/index.html b/previews/PR66/api/index.html index 1246382..56a57e4 100644 --- a/previews/PR66/api/index.html +++ b/previews/PR66/api/index.html @@ -459,6 +459,7 @@ }); +

          API

          Likelihoods

          GPLikelihoods.BernoulliLikelihoodType
          BernoulliLikelihood(l=logistic)

          Bernoulli likelihood is to be used if we assume that the uncertainity associated with the data follows a Bernoulli distribution. The link l needs to transform the input f to the domain [0, 1]

          \[ p(y|f) = \operatorname{Bernoulli}(y | l(f))\]

          On calling, this would return a Bernoulli distribution with l(f) probability of true.

          source
          GPLikelihoods.CategoricalLikelihoodType
          CategoricalLikelihood(l=BijectiveSimplexLink(softmax))

          Categorical likelihood is to be used if we assume that the uncertainty associated with the data follows a Categorical distribution.

          Assuming a distribution with n categories:

          n-1 inputs (bijective link)

          One can work with a bijective transformation by wrapping a link (like softmax) into a BijectiveSimplexLink and only needs n-1 inputs:

          \[ p(y|f_1, f_2, \dots, f_{n-1}) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_{n-1}, 0))\]

          The default constructor is a bijective link around softmax.

          n inputs (non-bijective link)

          One can also pass directly the inputs without concatenating a 0:

          \[ p(y|f_1, f_2, \dots, f_n) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_n))\]

          This variant is over-parametrized, as there are n-1 independent parameters embedded in a n dimensional parameter space. For more details, see the end of the section of this Wikipedia link where it corresponds to Variant 1 and 2.

          source
          GPLikelihoods.GammaLikelihoodType
          GammaLikelihood(α::Real=1.0, l=exp)

          Gamma likelihood with fixed shape α.

          \[ p(y|f) = \operatorname{Gamma}(y | α, l(f))\]

          On calling, this returns a Gamma distribution with shape α and scale invlink(f).

          source
          GPLikelihoods.GaussianLikelihoodType
          GaussianLikelihood(σ²)

          Gaussian likelihood with σ² variance. This is to be used if we assume that the uncertainity associated with the data follows a Gaussian distribution.

          \[ p(y|f) = \operatorname{Normal}(y | f, σ²)\]

          On calling, this would return a normal distribution with mean f and variance σ².

          source
          GPLikelihoods.HeteroscedasticGaussianLikelihoodType
          HeteroscedasticGaussianLikelihood(l=exp)

          Heteroscedastic Gaussian likelihood. This is a Gaussian likelihood whose mean and variance are functions of latent processes.

          \[ p(y|[f, g]) = \operatorname{Normal}(y | f, sqrt(l(g)))\]

          On calling, this would return a normal distribution with mean f and variance l(g). Where l is link going from R to R^+

          source
          GPLikelihoods.PoissonLikelihoodType
          PoissonLikelihood(l=exp)

          Poisson likelihood with rate defined as l(f).

          \[ p(y|f) = \operatorname{Poisson}(y | θ=l(f))\]

          This is to be used if we assume that the uncertainity associated with the data follows a Poisson distribution.

          source

          Negative Binomial

          GPLikelihoods.NegativeBinomialLikelihoodType
          NegativeBinomialLikelihood(param::NBParam, invlink::Union{Function,Link})

          There are many possible parametrizations for the Negative Binomial likelihood. We follow the convention laid out in p.137 of [^Hilbe'11] and provide some common parametrizations. The NegativeBinomialLikelihood has a special structure; the first type parameter NBParam defines in what parametrization the latent function is used, and contains the other (scalar) parameters. NBParam itself has two subtypes:

          • NBParamProb for parametrizations where f -> p, the probability of success of a Bernoulli event
          • NBParamMean for parametrizations where f -> μ, the expected number of events

          NBParam predefined types

          NBParamProb types with p = invlink(f) the probability of success or failure

          NBParamMean types with μ = invlink(f) the mean/expected number of events

          • NBParamI: Mean is linked to f and variance is given by μ(1 + α)
          • NBParamII: Mean is linked to f and variance is given by μ(1 + α * μ)
          • NBParamPower: Mean is linked to f and variance is given by μ(1 + α * μ^ρ)

          To create a new parametrization, you need to:

          • create a new type struct MyNBParam{T} <: NBParam; myparams::T; end;
          • dispatch (l::NegativeBinomialLikelihood{<:MyNBParam})(f::Real), which must return a NegativeBinomial from Distributions.jl.

          NegativeBinomial follows the parametrization of NBParamSuccess, i.e. the first argument is the number of successes and the second argument is the probability of success.

          Examples

          julia> NegativeBinomialLikelihood(NBParamSuccess(10), logistic)(2.0)
           NegativeBinomial{Float64}(r=10.0, p=0.8807970779778824)
           julia> NegativeBinomialLikelihood(NBParamFailure(10), logistic)(2.0)
          diff --git a/previews/PR66/index.html b/previews/PR66/index.html
          index 32c642b..de40976 100644
          --- a/previews/PR66/index.html
          +++ b/previews/PR66/index.html
          @@ -459,5 +459,6 @@
               });
           
           
          +
           

          GPLikelihoods

          GPLikelihoods.jl provides a practical interface to connect Gaussian and non-conjugate likelihoods to Gaussian Processes. The API is very basic: Every AbstractLikelihood object is a functor taking a Real or an AbstractVector as an input and returning a Distribution from Distributions.jl.

          Single-latent vs multi-latent likelihoods

          Most likelihoods, like the GaussianLikelihood, only require one latent Gaussian process. Passing a Real will therefore return a UnivariateDistribution, and passing an AbstractVector{<:Real} will return a multivariate product of distributions.

          julia> f = 2.0;
          julia> GaussianLikelihood()(f) == Normal(2.0, 1e-3)true
          julia> fs = [2.0, 3.0, 1.5];
          julia> GaussianLikelihood()(fs) isa AbstractMvNormaltrue

          Some likelihoods, like the CategoricalLikelihood, require multiple latent Gaussian processes, and an AbstractVector{<:Real} needs to be passed. To obtain a product of distributions an AbstractVector{<:AbstractVector{<:Real}} has to be passed (we recommend using ColVecs and RowVecs from KernelFunctions.jl if you need to transform an AbstractMatrix).

          julia> fs = [2.0, 3.0, 4.5];
          julia> CategoricalLikelihood()(fs) isa Categoricaltrue
          julia> Fs = [rand(3) for _ in 1:4];
          julia> CategoricalLikelihood()(Fs) isa Product{<:Any,<:Categorical}true

          Constrained parameters

          The function values f of the latent Gaussian process live in the real domain $\mathbb{R}$. For some likelihoods, the domain of the distribution parameter p that is modulated by the latent Gaussian process is constrained to some subset of $\mathbb{R}$, e.g. only positive values or values in an interval.

          To connect these two domains, a transformation from f to p is required. For this, we provide the Link type, which can be passed to the likelihood constructors. (Alternatively, functions can also directly be passed and will be wrapped in a Link.)

          We typically call this passed transformation the invlink. This comes from the statistics literature, where the "link" is defined as f = link(p), whereas here we need p = invlink(f).

          For more details about which likelihoods require a Link check out their docs.

          A classical example is the BernoulliLikelihood for classification, with the probability parameter $p \in [0, 1]$. The default is to use a logistic transformation, but one could also use the inverse of the probit link:

          julia> f = 2.0;
          julia> BernoulliLikelihood()(f) == Bernoulli(logistic(f))true
          julia> BernoulliLikelihood(NormalCDFLink())(f) == Bernoulli(normcdf(f))true

          Note that we passed the inverse of the probit function which is the normcdf function.

          diff --git a/previews/PR66/search/index.html b/previews/PR66/search/index.html index 103a787..881ef9f 100644 --- a/previews/PR66/search/index.html +++ b/previews/PR66/search/index.html @@ -459,5 +459,6 @@ }); +

          Loading search...

            diff --git a/previews/PR82/api/index.html b/previews/PR82/api/index.html index 6e957dd..86629db 100644 --- a/previews/PR82/api/index.html +++ b/previews/PR82/api/index.html @@ -459,5 +459,6 @@ }); +

            API

            Likelihoods

            GPLikelihoods.BernoulliLikelihoodType
            BernoulliLikelihood(l=logistic)

            Bernoulli likelihood is to be used if we assume that the uncertainity associated with the data follows a Bernoulli distribution. The link l needs to transform the input f to the domain [0, 1]

            \[ p(y|f) = \operatorname{Bernoulli}(y | l(f))\]

            On calling, this would return a Bernoulli distribution with l(f) probability of true.

            source
            GPLikelihoods.CategoricalLikelihoodType
            CategoricalLikelihood(l=BijectiveSimplexLink(softmax))

            Categorical likelihood is to be used if we assume that the uncertainty associated with the data follows a Categorical distribution.

            Assuming a distribution with n categories:

            n-1 inputs (bijective link)

            One can work with a bijective transformation by wrapping a link (like softmax) into a BijectiveSimplexLink and only needs n-1 inputs:

            \[ p(y|f_1, f_2, \dots, f_{n-1}) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_{n-1}, 0))\]

            The default constructor is a bijective link around softmax.

            n inputs (non-bijective link)

            One can also pass directly the inputs without concatenating a 0:

            \[ p(y|f_1, f_2, \dots, f_n) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_n))\]

            This variant is over-parametrized, as there are n-1 independent parameters embedded in a n dimensional parameter space. For more details, see the end of the section of this Wikipedia link where it corresponds to Variant 1 and 2.

            source
            GPLikelihoods.GammaLikelihoodType
            GammaLikelihood(α::Real=1.0, l=exp)

            Gamma likelihood with fixed shape α.

            \[ p(y|f) = \operatorname{Gamma}(y | α, l(f))\]

            On calling, this returns a Gamma distribution with shape α and scale invlink(f).

            source
            GPLikelihoods.GaussianLikelihoodType
            GaussianLikelihood(σ²)

            Gaussian likelihood with σ² variance. This is to be used if we assume that the uncertainity associated with the data follows a Gaussian distribution.

            \[ p(y|f) = \operatorname{Normal}(y | f, σ²)\]

            On calling, this would return a normal distribution with mean f and variance σ².

            source
            GPLikelihoods.HeteroscedasticGaussianLikelihoodType
            HeteroscedasticGaussianLikelihood(l=exp)

            Heteroscedastic Gaussian likelihood. This is a Gaussian likelihood whose mean and variance are functions of latent processes.

            \[ p(y|[f, g]) = \operatorname{Normal}(y | f, sqrt(l(g)))\]

            On calling, this would return a normal distribution with mean f and variance l(g). Where l is link going from R to R^+

            source
            GPLikelihoods.PoissonLikelihoodType
            PoissonLikelihood(l=exp)

            Poisson likelihood with rate defined as l(f).

            \[ p(y|f) = \operatorname{Poisson}(y | θ=l(f))\]

            This is to be used if we assume that the uncertainity associated with the data follows a Poisson distribution.

            source

            Negative Binomial

            GPLikelihoods.NegativeBinomialLikelihoodType
            NegativeBinomialLikelihood

            Abstract base type for the Negative Binomial likelihood. There are multiple parametrizations; you must choose one of those concrete parameterizations.

            You can find all available parametrizations using

            subtypes(NegativeBinomialLikelihood)
            source
            Missing docstring.

            Missing docstring for NBParamIII. Check Documenter's build log for details.

            Missing docstring.

            Missing docstring for ChainLink. Check Documenter's build log for details.

            The rest of the links ExpLink, LogisticLink, etc., are aliases for the corresponding wrapped functions in a Link. For example ExpLink == Link{typeof(exp)}.

            When passing a Link to an AbstractLikelihood, this link corresponds to the transformation p=link(f) while, as mentioned in the Constrained parameters section, the statistics literature usually use the denomination inverse link or mean function for it.

            diff --git a/previews/PR82/index.html b/previews/PR82/index.html index 1c5da84..e43c732 100644 --- a/previews/PR82/index.html +++ b/previews/PR82/index.html @@ -459,6 +459,7 @@ }); +

            GPLikelihoods

            GPLikelihoods.jl provides a practical interface to connect Gaussian and non-conjugate likelihoods to Gaussian Processes. The API is very basic: Every AbstractLikelihood object is a functor taking a Real or an AbstractVector as an input and returns a Distribution from Distributions.jl.

            Single-latent vs multi-latent likelihoods

            Most likelihoods, like the GaussianLikelihood, only require one latent Gaussian process. Passing a Real will therefore return a UnivariateDistribution, and passing an AbstractVector{<:Real} will return a multivariate product of distributions.

            julia> f = 2.0;
            julia> GaussianLikelihood()(f) == Normal(2.0)ERROR: UndefVarError: GaussianLikelihood not defined
            julia> fs = [2.0, 3.0, 1.5]3-element Vector{Float64}: 2.0 3.0 diff --git a/previews/PR82/search/index.html b/previews/PR82/search/index.html index 78078b7..1d9b79b 100644 --- a/previews/PR82/search/index.html +++ b/previews/PR82/search/index.html @@ -459,5 +459,6 @@ }); +

            Loading search...

              diff --git a/previews/PR99/api/index.html b/previews/PR99/api/index.html index 831f473..d4f0dc2 100644 --- a/previews/PR99/api/index.html +++ b/previews/PR99/api/index.html @@ -459,6 +459,7 @@ }); +

              API

              Likelihoods

              GPLikelihoods.BernoulliLikelihoodType
              BernoulliLikelihood(l=logistic)

              Bernoulli likelihood is to be used if we assume that the uncertainity associated with the data follows a Bernoulli distribution. The link l needs to transform the input f to the domain [0, 1]

              \[ p(y|f) = \operatorname{Bernoulli}(y | l(f))\]

              On calling, this would return a Bernoulli distribution with l(f) probability of true.

              source
              GPLikelihoods.CategoricalLikelihoodType
              CategoricalLikelihood(l=BijectiveSimplexLink(softmax))

              Categorical likelihood is to be used if we assume that the uncertainty associated with the data follows a Categorical distribution.

              Assuming a distribution with n categories:

              n-1 inputs (bijective link)

              One can work with a bijective transformation by wrapping a link (like softmax) into a BijectiveSimplexLink and only needs n-1 inputs:

              \[ p(y|f_1, f_2, \dots, f_{n-1}) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_{n-1}, 0))\]

              The default constructor is a bijective link around softmax.

              n inputs (non-bijective link)

              One can also pass directly the inputs without concatenating a 0:

              \[ p(y|f_1, f_2, \dots, f_n) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_n))\]

              This variant is over-parametrized, as there are n-1 independent parameters embedded in a n dimensional parameter space. For more details, see the end of the section of this Wikipedia link where it corresponds to Variant 1 and 2.

              source
              GPLikelihoods.GammaLikelihoodType
              GammaLikelihood(α::Real=1.0, l=exp)

              Gamma likelihood with fixed shape α.

              \[ p(y|f) = \operatorname{Gamma}(y | α, l(f))\]

              On calling, this returns a Gamma distribution with shape α and scale invlink(f).

              source
              GPLikelihoods.GaussianLikelihoodType
              GaussianLikelihood(σ²)

              Gaussian likelihood with σ² variance. This is to be used if we assume that the uncertainity associated with the data follows a Gaussian distribution.

              \[ p(y|f) = \operatorname{Normal}(y | f, σ²)\]

              On calling, this would return a normal distribution with mean f and variance σ².

              source
              GPLikelihoods.HeteroscedasticGaussianLikelihoodType
              HeteroscedasticGaussianLikelihood(l=exp)

              Heteroscedastic Gaussian likelihood. This is a Gaussian likelihood whose mean and variance are functions of latent processes.

              \[ p(y|[f, g]) = \operatorname{Normal}(y | f, sqrt(l(g)))\]

              On calling, this would return a normal distribution with mean f and variance l(g). Where l is link going from R to R^+

              source
              GPLikelihoods.PoissonLikelihoodType
              PoissonLikelihood(l=exp)

              Poisson likelihood with rate defined as l(f).

              \[ p(y|f) = \operatorname{Poisson}(y | θ=l(f))\]

              This is to be used if we assume that the uncertainity associated with the data follows a Poisson distribution.

              source

              Negative Binomial

              GPLikelihoods.NegativeBinomialLikelihoodType
              NegativeBinomialLikelihood(param::NBParam, invlink::Union{Function,Link})

              There are many possible parametrizations for the Negative Binomial likelihood. We follow the convention laid out in p.137 of [^Hilbe'11] and provide some common parametrizations. The NegativeBinomialLikelihood has a special structure; the first type parameter NBParam defines in what parametrization the latent function is used, and contains the other (scalar) parameters. NBParam itself has two subtypes:

              • NBParamProb for parametrizations where f -> p, the probability of success of a Bernoulli event
              • NBParamMean for parametrizations where f -> μ, the expected number of events

              NBParam predefined types

              NBParamProb types with p = invlink(f) the probability of success

              NBParamMean types with μ = invlink(f) the mean/expected number of events

              • NBParamI: Mean is linked to f and variance is given by μ(1 + α)
              • NBParamII: Mean is linked to f and variance is given by μ(1 + α * μ)
              • NBParamPower: Mean is linked to f and variance is given by μ(1 + α * μ^ρ)

              To create a new parametrization, you need to:

              • create a new type struct MyNBParam{T} <: NBParam; myparams::T; end;
              • dispatch (l::NegativeBinomialLikelihood{<:MyNBParam})(f::Real), which must return a NegativeBinomial from Distributions.jl.

              NegativeBinomial follows the parametrization of NBParamSuccess, i.e. the first argument is the number of successes and the second argument is the probability of success.

              Examples

              julia> NegativeBinomialLikelihood(NBParamSuccess(10), logistic)(2.0)
               NegativeBinomial{Float64}(r=10.0, p=0.8807970779778824)
               julia> NegativeBinomialLikelihood(NBParamFailure(10), logistic)(2.0)
              diff --git a/previews/PR99/index.html b/previews/PR99/index.html
              index 53df02f..2d4160d 100644
              --- a/previews/PR99/index.html
              +++ b/previews/PR99/index.html
              @@ -459,5 +459,6 @@
                   });
               
               
              +
               

              GPLikelihoods

              GPLikelihoods.jl provides a practical interface to connect Gaussian and non-conjugate likelihoods to Gaussian Processes. The API is very basic: Every AbstractLikelihood object is a functor taking a Real or an AbstractVector as an input and returning a Distribution from Distributions.jl.

              Single-latent vs multi-latent likelihoods

              Most likelihoods, like the GaussianLikelihood, only require one latent Gaussian process. Passing a Real will therefore return a UnivariateDistribution, and passing an AbstractVector{<:Real} will return a multivariate product of distributions.

              julia> f = 2.0;
              julia> GaussianLikelihood()(f) == Normal(2.0, 1e-3)true
              julia> fs = [2.0, 3.0, 1.5];
              julia> GaussianLikelihood()(fs) isa AbstractMvNormaltrue

              Some likelihoods, like the CategoricalLikelihood, require multiple latent Gaussian processes, and an AbstractVector{<:Real} needs to be passed. To obtain a product of distributions an AbstractVector{<:AbstractVector{<:Real}} has to be passed (we recommend using ColVecs and RowVecs from KernelFunctions.jl if you need to transform an AbstractMatrix).

              julia> fs = [2.0, 3.0, 4.5];
              julia> CategoricalLikelihood()(fs) isa Categoricaltrue
              julia> Fs = [rand(3) for _ in 1:4];
              julia> CategoricalLikelihood()(Fs) isa Product{<:Any,<:Categorical}true

              Constrained parameters

              The function values f of the latent Gaussian process live in the real domain $\mathbb{R}$. For some likelihoods, the domain of the distribution parameter p that is modulated by the latent Gaussian process is constrained to some subset of $\mathbb{R}$, e.g. only positive values or values in an interval.

              To connect these two domains, a transformation from f to p is required. For this, we provide the Link type, which can be passed to the likelihood constructors. (Alternatively, functions can also directly be passed and will be wrapped in a Link.)

              We typically call this passed transformation the invlink. This comes from the statistics literature, where the "link" is defined as f = link(p), whereas here we need p = invlink(f).

              For more details about which likelihoods require a Link check out their docs.

              A classical example is the BernoulliLikelihood for classification, with the probability parameter $p \in [0, 1]$. The default is to use a logistic transformation, but one could also use the inverse of the probit link:

              julia> f = 2.0;
              julia> BernoulliLikelihood()(f) == Bernoulli(logistic(f))true
              julia> BernoulliLikelihood(NormalCDFLink())(f) == Bernoulli(normcdf(f))true

              Note that we passed the inverse of the probit function which is the normcdf function.

              diff --git a/previews/PR99/search/index.html b/previews/PR99/search/index.html index 79bf8f5..1ce2364 100644 --- a/previews/PR99/search/index.html +++ b/previews/PR99/search/index.html @@ -459,5 +459,6 @@ }); +

              Loading search...

                diff --git a/v0.2.0/index.html b/v0.2.0/index.html index 7646ea7..9a9e12e 100644 --- a/v0.2.0/index.html +++ b/v0.2.0/index.html @@ -459,5 +459,6 @@ }); +

                GPLikelihoods.jl

                GPLikelihoods.AbstractLinkType
                AbstractLink

                Abstract type defining maps from R^n -> X. They can be applied by calling link(x).

                A series of definitions are given in http://web.pdx.edu/~newsomj/mvclass/ho_link.pdf

                source
                GPLikelihoods.BernoulliLikelihoodType
                BernoulliLikelihood(l::AbstractLink=LogisticLink())

                Bernoulli likelihood is to be used if we assume that the uncertainity associated with the data follows a Bernoulli distribution. The link l needs to transform the input f to the domain [0, 1]

                \[ p(y|f) = Bernoulli(y | l(f))\]

                On calling, this would return a Bernoulli distribution with l(f) probability of true.

                source
                GPLikelihoods.CategoricalLikelihoodType
                CategoricalLikelihood(l::AbstractLink=SoftMaxLink())

                Categorical likelihood is to be used if we assume that the uncertainity associated with the data follows a Categorical distribution.

                \[ p(y|f_1, f_2, \dots, f_{n-1}) = Categorical(y | l(f_1, f_2, \dots, f_{n-1}, 0))\]

                Given an AbstractVector [f1, f2, ..., f{n-1}], returns a Categorical distribution, with probabilities given by `l(f1, f2, ..., f{n-1}, 0)`.

                source
                GPLikelihoods.GammaLikelihoodType
                GammaLikelihood(α::Real=1.0, l::AbstractLink=ExpLink())

                Gamma likelihood with fixed shape α.

                \[ p(y|f) = Gamma(y | α, l(f))\]

                On calling, this would return a gamma distribution with shape α and scale l(f).

                source
                GPLikelihoods.GaussianLikelihoodType
                GaussianLikelihood(σ²)

                Gaussian likelihood with σ² variance. This is to be used if we assume that the uncertainity associated with the data follows a Gaussian distribution.

                \[ p(y|f) = Normal(y | f, σ²)\]

                On calling, this would return a normal distribution with mean f and variance σ².

                source
                GPLikelihoods.HeteroscedasticGaussianLikelihoodType
                HeteroscedasticGaussianLikelihood(l::AbstractLink=ExpLink())

                Heteroscedastic Gaussian likelihood. This is a Gaussian likelihood whose mean and variance are functions of latent processes.

                \[ p(y|[f, g]) = Normal(y | f, sqrt(l(g)))\]

                On calling, this would return a normal distribution with mean f and variance l(g). Where l is link going from R to R^+

                source
                GPLikelihoods.PoissonLikelihoodType
                PoissonLikelihood(l::AbstractLink=ExpLink())

                Poisson likelihood with rate defined as l(f).

                \[ p(y|f) = Poisson(y | θ=l(f))\]

                This is to be used if we assume that the uncertainity associated with the data follows a Poisson distribution.

                source
                diff --git a/v0.2.0/search/index.html b/v0.2.0/search/index.html index 29fa799..880057f 100644 --- a/v0.2.0/search/index.html +++ b/v0.2.0/search/index.html @@ -459,5 +459,6 @@ }); +

                Loading search...

                  diff --git a/v0.2.1/index.html b/v0.2.1/index.html index 4bf558e..13921ee 100644 --- a/v0.2.1/index.html +++ b/v0.2.1/index.html @@ -459,5 +459,6 @@ }); +

                  GPLikelihoods.jl

                  GPLikelihoods.AbstractLinkType
                  AbstractLink

                  Abstract type defining maps from R^n -> X. They can be applied by calling link(x).

                  A series of definitions are given in http://web.pdx.edu/~newsomj/mvclass/ho_link.pdf

                  source
                  GPLikelihoods.BernoulliLikelihoodType
                  BernoulliLikelihood(l::AbstractLink=LogisticLink())

                  Bernoulli likelihood is to be used if we assume that the uncertainity associated with the data follows a Bernoulli distribution. The link l needs to transform the input f to the domain [0, 1]

                  \[ p(y|f) = Bernoulli(y | l(f))\]

                  On calling, this would return a Bernoulli distribution with l(f) probability of true.

                  source
                  GPLikelihoods.CategoricalLikelihoodType
                  CategoricalLikelihood(l::AbstractLink=SoftMaxLink())

                  Categorical likelihood is to be used if we assume that the uncertainity associated with the data follows a Categorical distribution.

                  \[ p(y|f_1, f_2, \dots, f_{n-1}) = Categorical(y | l(f_1, f_2, \dots, f_{n-1}, 0))\]

                  Given an AbstractVector [f1, f2, ..., f{n-1}], returns a Categorical distribution, with probabilities given by `l(f1, f2, ..., f{n-1}, 0)`.

                  source
                  GPLikelihoods.GammaLikelihoodType
                  GammaLikelihood(α::Real=1.0, l::AbstractLink=ExpLink())

                  Gamma likelihood with fixed shape α.

                  \[ p(y|f) = Gamma(y | α, l(f))\]

                  On calling, this would return a gamma distribution with shape α and scale l(f).

                  source
                  GPLikelihoods.GaussianLikelihoodType
                  GaussianLikelihood(σ²)

                  Gaussian likelihood with σ² variance. This is to be used if we assume that the uncertainity associated with the data follows a Gaussian distribution.

                  \[ p(y|f) = Normal(y | f, σ²)\]

                  On calling, this would return a normal distribution with mean f and variance σ².

                  source
                  GPLikelihoods.HeteroscedasticGaussianLikelihoodType
                  HeteroscedasticGaussianLikelihood(l::AbstractLink=ExpLink())

                  Heteroscedastic Gaussian likelihood. This is a Gaussian likelihood whose mean and variance are functions of latent processes.

                  \[ p(y|[f, g]) = Normal(y | f, sqrt(l(g)))\]

                  On calling, this would return a normal distribution with mean f and variance l(g). Where l is link going from R to R^+

                  source
                  GPLikelihoods.PoissonLikelihoodType
                  PoissonLikelihood(l::AbstractLink=ExpLink())

                  Poisson likelihood with rate defined as l(f).

                  \[ p(y|f) = Poisson(y | θ=l(f))\]

                  This is to be used if we assume that the uncertainity associated with the data follows a Poisson distribution.

                  source
                  diff --git a/v0.2.1/search/index.html b/v0.2.1/search/index.html index 6e37a01..ae9bf33 100644 --- a/v0.2.1/search/index.html +++ b/v0.2.1/search/index.html @@ -459,5 +459,6 @@ }); +

                  Loading search...

                    diff --git a/v0.2.2/index.html b/v0.2.2/index.html index 2f48f97..b05f3ff 100644 --- a/v0.2.2/index.html +++ b/v0.2.2/index.html @@ -459,5 +459,6 @@ }); +

                    GPLikelihoods.jl

                    GPLikelihoods.AbstractLinkType
                    AbstractLink

                    Abstract type defining maps from R^n -> X. They can be applied by calling link(x).

                    A series of definitions are given in http://web.pdx.edu/~newsomj/mvclass/ho_link.pdf

                    source
                    GPLikelihoods.BernoulliLikelihoodType
                    BernoulliLikelihood(l::AbstractLink=LogisticLink())

                    Bernoulli likelihood is to be used if we assume that the uncertainity associated with the data follows a Bernoulli distribution. The link l needs to transform the input f to the domain [0, 1]

                    \[ p(y|f) = \operatorname{Bernoulli}(y | l(f))\]

                    On calling, this would return a Bernoulli distribution with l(f) probability of true.

                    source
                    GPLikelihoods.CategoricalLikelihoodType
                    CategoricalLikelihood(l::AbstractLink=SoftMaxLink())

                    Categorical likelihood is to be used if we assume that the uncertainity associated with the data follows a Categorical distribution.

                    \[ p(y|f_1, f_2, \dots, f_{n-1}) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_{n-1}, 0))\]

                    Given an AbstractVector $[f_1, f_2, ..., f_{n-1}]$, returns a Categorical distribution, with probabilities given by $l(f_1, f_2, ..., f_{n-1}, 0)$.

                    source
                    GPLikelihoods.GammaLikelihoodType
                    GammaLikelihood(α::Real=1.0, l::AbstractLink=ExpLink())

                    Gamma likelihood with fixed shape α.

                    \[ p(y|f) = \operatorname{Gamma}(y | α, l(f))\]

                    On calling, this would return a gamma distribution with shape α and scale l(f).

                    source
                    GPLikelihoods.GaussianLikelihoodType
                    GaussianLikelihood(σ²)

                    Gaussian likelihood with σ² variance. This is to be used if we assume that the uncertainity associated with the data follows a Gaussian distribution.

                    \[ p(y|f) = \operatorname{Normal}(y | f, σ²)\]

                    On calling, this would return a normal distribution with mean f and variance σ².

                    source
                    GPLikelihoods.HeteroscedasticGaussianLikelihoodType
                    HeteroscedasticGaussianLikelihood(l::AbstractLink=ExpLink())

                    Heteroscedastic Gaussian likelihood. This is a Gaussian likelihood whose mean and variance are functions of latent processes.

                    \[ p(y|[f, g]) = \operatorname{Normal}(y | f, sqrt(l(g)))\]

                    On calling, this would return a normal distribution with mean f and variance l(g). Where l is link going from R to R^+

                    source
                    GPLikelihoods.PoissonLikelihoodType
                    PoissonLikelihood(l::AbstractLink=ExpLink())

                    Poisson likelihood with rate defined as l(f).

                    \[ p(y|f) = \operatorname{Poisson}(y | θ=l(f))\]

                    This is to be used if we assume that the uncertainity associated with the data follows a Poisson distribution.

                    source
                    diff --git a/v0.2.2/search/index.html b/v0.2.2/search/index.html index 5eae6cf..e581f3e 100644 --- a/v0.2.2/search/index.html +++ b/v0.2.2/search/index.html @@ -459,5 +459,6 @@ }); +

                    Loading search...

                      diff --git a/v0.2.3/index.html b/v0.2.3/index.html index fe60058..ff1e0cb 100644 --- a/v0.2.3/index.html +++ b/v0.2.3/index.html @@ -459,5 +459,6 @@ }); +

                      GPLikelihoods.jl

                      GPLikelihoods.AbstractLinkType
                      AbstractLink

                      Abstract type defining maps from R^n -> X. They can be applied by calling link(x).

                      A series of definitions are given in http://web.pdx.edu/~newsomj/mvclass/ho_link.pdf

                      source
                      GPLikelihoods.BernoulliLikelihoodType
                      BernoulliLikelihood(l::AbstractLink=LogisticLink())

                      Bernoulli likelihood is to be used if we assume that the uncertainity associated with the data follows a Bernoulli distribution. The link l needs to transform the input f to the domain [0, 1]

                      \[ p(y|f) = \operatorname{Bernoulli}(y | l(f))\]

                      On calling, this would return a Bernoulli distribution with l(f) probability of true.

                      source
                      GPLikelihoods.CategoricalLikelihoodType
                      CategoricalLikelihood(l::AbstractLink=SoftMaxLink())

                      Categorical likelihood is to be used if we assume that the uncertainity associated with the data follows a Categorical distribution.

                      \[ p(y|f_1, f_2, \dots, f_{n-1}) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_{n-1}, 0))\]

                      Given an AbstractVector $[f_1, f_2, ..., f_{n-1}]$, returns a Categorical distribution, with probabilities given by $l(f_1, f_2, ..., f_{n-1}, 0)$.

                      source
                      GPLikelihoods.GammaLikelihoodType
                      GammaLikelihood(α::Real=1.0, l::AbstractLink=ExpLink())

                      Gamma likelihood with fixed shape α.

                      \[ p(y|f) = \operatorname{Gamma}(y | α, l(f))\]

                      On calling, this would return a gamma distribution with shape α and scale l(f).

                      source
                      GPLikelihoods.GaussianLikelihoodType
                      GaussianLikelihood(σ²)

                      Gaussian likelihood with σ² variance. This is to be used if we assume that the uncertainity associated with the data follows a Gaussian distribution.

                      \[ p(y|f) = \operatorname{Normal}(y | f, σ²)\]

                      On calling, this would return a normal distribution with mean f and variance σ².

                      source
                      GPLikelihoods.HeteroscedasticGaussianLikelihoodType
                      HeteroscedasticGaussianLikelihood(l::AbstractLink=ExpLink())

                      Heteroscedastic Gaussian likelihood. This is a Gaussian likelihood whose mean and variance are functions of latent processes.

                      \[ p(y|[f, g]) = \operatorname{Normal}(y | f, sqrt(l(g)))\]

                      On calling, this would return a normal distribution with mean f and variance l(g). Where l is link going from R to R^+

                      source
                      GPLikelihoods.PoissonLikelihoodType
                      PoissonLikelihood(l::AbstractLink=ExpLink())

                      Poisson likelihood with rate defined as l(f).

                      \[ p(y|f) = \operatorname{Poisson}(y | θ=l(f))\]

                      This is to be used if we assume that the uncertainity associated with the data follows a Poisson distribution.

                      source
                      GPLikelihoods.inverseMethod
                      inverse(f)

                      Return the inverse of function f.

                      This is an internal function to avoid type piracies such as inv(::typeof(exp)). At some point inv might support standard Julia functions which would allow us to remove inverse.

                      source
                      diff --git a/v0.2.3/search/index.html b/v0.2.3/search/index.html index d75114d..95bd958 100644 --- a/v0.2.3/search/index.html +++ b/v0.2.3/search/index.html @@ -459,5 +459,6 @@ }); +

                      Loading search...

                        diff --git a/v0.2.4/index.html b/v0.2.4/index.html index d3cce10..198052c 100644 --- a/v0.2.4/index.html +++ b/v0.2.4/index.html @@ -459,5 +459,6 @@ }); +

                        GPLikelihoods.jl

                        GPLikelihoods.AbstractLinkType
                        AbstractLink

                        Abstract type defining maps from R^n -> X. They can be applied by calling link(x).

                        A series of definitions are given in http://web.pdx.edu/~newsomj/mvclass/ho_link.pdf

                        source
                        GPLikelihoods.BernoulliLikelihoodType
                        BernoulliLikelihood(l=logistic)

                        Bernoulli likelihood is to be used if we assume that the uncertainity associated with the data follows a Bernoulli distribution. The link l needs to transform the input f to the domain [0, 1]

                        \[ p(y|f) = \operatorname{Bernoulli}(y | l(f))\]

                        On calling, this would return a Bernoulli distribution with l(f) probability of true.

                        source
                        GPLikelihoods.CategoricalLikelihoodType
                        CategoricalLikelihood(l=softmax)

                        Categorical likelihood is to be used if we assume that the uncertainity associated with the data follows a Categorical distribution.

                        \[ p(y|f_1, f_2, \dots, f_{n-1}) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_{n-1}, 0))\]

                        Given an AbstractVector $[f_1, f_2, ..., f_{n-1}]$, returns a Categorical distribution, with probabilities given by $l(f_1, f_2, ..., f_{n-1}, 0)$.

                        source
                        GPLikelihoods.GammaLikelihoodType
                        GammaLikelihood(α::Real=1.0, l=exp)

                        Gamma likelihood with fixed shape α.

                        \[ p(y|f) = \operatorname{Gamma}(y | α, l(f))\]

                        On calling, this would return a gamma distribution with shape α and scale l(f).

                        source
                        GPLikelihoods.GaussianLikelihoodType
                        GaussianLikelihood(σ²)

                        Gaussian likelihood with σ² variance. This is to be used if we assume that the uncertainity associated with the data follows a Gaussian distribution.

                        \[ p(y|f) = \operatorname{Normal}(y | f, σ²)\]

                        On calling, this would return a normal distribution with mean f and variance σ².

                        source
                        GPLikelihoods.HeteroscedasticGaussianLikelihoodType
                        HeteroscedasticGaussianLikelihood(l=exp)

                        Heteroscedastic Gaussian likelihood. This is a Gaussian likelihood whose mean and variance are functions of latent processes.

                        \[ p(y|[f, g]) = \operatorname{Normal}(y | f, sqrt(l(g)))\]

                        On calling, this would return a normal distribution with mean f and variance l(g). Where l is link going from R to R^+

                        source
                        GPLikelihoods.PoissonLikelihoodType
                        PoissonLikelihood(l=exp)

                        Poisson likelihood with rate defined as l(f).

                        \[ p(y|f) = \operatorname{Poisson}(y | θ=l(f))\]

                        This is to be used if we assume that the uncertainity associated with the data follows a Poisson distribution.

                        source
                        GPLikelihoods.inverseMethod
                        inverse(f)

                        Return the inverse of function f.

                        This is an internal function to avoid type piracies such as inv(::typeof(exp)). At some point inv might support standard Julia functions which would allow us to remove inverse.

                        source
                        diff --git a/v0.2.4/search/index.html b/v0.2.4/search/index.html index 645c62f..50fbfc5 100644 --- a/v0.2.4/search/index.html +++ b/v0.2.4/search/index.html @@ -459,5 +459,6 @@ }); +

                        Loading search...

                          diff --git a/v0.2.5/index.html b/v0.2.5/index.html index 3728052..8aa3777 100644 --- a/v0.2.5/index.html +++ b/v0.2.5/index.html @@ -459,5 +459,6 @@ }); +

                          GPLikelihoods.jl

                          GPLikelihoods.AbstractLinkType
                          AbstractLink

                          Abstract type defining maps from R^n -> X. They can be applied by calling link(x).

                          A series of definitions are given in http://web.pdx.edu/~newsomj/mvclass/ho_link.pdf

                          source
                          GPLikelihoods.BernoulliLikelihoodType
                          BernoulliLikelihood(l=logistic)

                          Bernoulli likelihood is to be used if we assume that the uncertainity associated with the data follows a Bernoulli distribution. The link l needs to transform the input f to the domain [0, 1]

                          \[ p(y|f) = \operatorname{Bernoulli}(y | l(f))\]

                          On calling, this would return a Bernoulli distribution with l(f) probability of true.

                          source
                          GPLikelihoods.CategoricalLikelihoodType
                          CategoricalLikelihood(l=softmax)

                          Categorical likelihood is to be used if we assume that the uncertainity associated with the data follows a Categorical distribution.

                          \[ p(y|f_1, f_2, \dots, f_{n-1}) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_{n-1}, 0))\]

                          Given an AbstractVector $[f_1, f_2, ..., f_{n-1}]$, returns a Categorical distribution, with probabilities given by $l(f_1, f_2, ..., f_{n-1}, 0)$.

                          source
                          GPLikelihoods.GammaLikelihoodType
                          GammaLikelihood(α::Real=1.0, l=exp)

                          Gamma likelihood with fixed shape α.

                          \[ p(y|f) = \operatorname{Gamma}(y | α, l(f))\]

                          On calling, this would return a gamma distribution with shape α and scale l(f).

                          source
                          GPLikelihoods.GaussianLikelihoodType
                          GaussianLikelihood(σ²)

                          Gaussian likelihood with σ² variance. This is to be used if we assume that the uncertainity associated with the data follows a Gaussian distribution.

                          \[ p(y|f) = \operatorname{Normal}(y | f, σ²)\]

                          On calling, this would return a normal distribution with mean f and variance σ².

                          source
                          GPLikelihoods.HeteroscedasticGaussianLikelihoodType
                          HeteroscedasticGaussianLikelihood(l=exp)

                          Heteroscedastic Gaussian likelihood. This is a Gaussian likelihood whose mean and variance are functions of latent processes.

                          \[ p(y|[f, g]) = \operatorname{Normal}(y | f, sqrt(l(g)))\]

                          On calling, this would return a normal distribution with mean f and variance l(g). Where l is link going from R to R^+

                          source
                          GPLikelihoods.PoissonLikelihoodType
                          PoissonLikelihood(l=exp)

                          Poisson likelihood with rate defined as l(f).

                          \[ p(y|f) = \operatorname{Poisson}(y | θ=l(f))\]

                          This is to be used if we assume that the uncertainity associated with the data follows a Poisson distribution.

                          source
                          diff --git a/v0.2.5/search/index.html b/v0.2.5/search/index.html index 2f49524..ffc622e 100644 --- a/v0.2.5/search/index.html +++ b/v0.2.5/search/index.html @@ -459,5 +459,6 @@ }); +

                          Loading search...

                            diff --git a/v0.2.6/index.html b/v0.2.6/index.html index f31f7f7..05c6100 100644 --- a/v0.2.6/index.html +++ b/v0.2.6/index.html @@ -459,5 +459,6 @@ }); +

                            GPLikelihoods.jl

                            GPLikelihoods.AbstractLinkType
                            AbstractLink

                            Abstract type defining maps from R^n -> X. They can be applied by calling link(x).

                            A series of definitions are given in http://web.pdx.edu/~newsomj/mvclass/ho_link.pdf

                            source
                            GPLikelihoods.BernoulliLikelihoodType
                            BernoulliLikelihood(l=logistic)

                            Bernoulli likelihood is to be used if we assume that the uncertainity associated with the data follows a Bernoulli distribution. The link l needs to transform the input f to the domain [0, 1]

                            \[ p(y|f) = \operatorname{Bernoulli}(y | l(f))\]

                            On calling, this would return a Bernoulli distribution with l(f) probability of true.

                            source
                            GPLikelihoods.CategoricalLikelihoodType
                            CategoricalLikelihood(l=softmax)

                            Categorical likelihood is to be used if we assume that the uncertainity associated with the data follows a Categorical distribution.

                            \[ p(y|f_1, f_2, \dots, f_{n-1}) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_{n-1}, 0))\]

                            Given an AbstractVector $[f_1, f_2, ..., f_{n-1}]$, returns a Categorical distribution, with probabilities given by $l(f_1, f_2, ..., f_{n-1}, 0)$.

                            source
                            GPLikelihoods.GammaLikelihoodType
                            GammaLikelihood(α::Real=1.0, l=exp)

                            Gamma likelihood with fixed shape α.

                            \[ p(y|f) = \operatorname{Gamma}(y | α, l(f))\]

                            On calling, this would return a gamma distribution with shape α and scale l(f).

                            source
                            GPLikelihoods.GaussianLikelihoodType
                            GaussianLikelihood(σ²)

                            Gaussian likelihood with σ² variance. This is to be used if we assume that the uncertainity associated with the data follows a Gaussian distribution.

                            \[ p(y|f) = \operatorname{Normal}(y | f, σ²)\]

                            On calling, this would return a normal distribution with mean f and variance σ².

                            source
                            GPLikelihoods.HeteroscedasticGaussianLikelihoodType
                            HeteroscedasticGaussianLikelihood(l=exp)

                            Heteroscedastic Gaussian likelihood. This is a Gaussian likelihood whose mean and variance are functions of latent processes.

                            \[ p(y|[f, g]) = \operatorname{Normal}(y | f, sqrt(l(g)))\]

                            On calling, this would return a normal distribution with mean f and variance l(g). Where l is link going from R to R^+

                            source
                            GPLikelihoods.PoissonLikelihoodType
                            PoissonLikelihood(l=exp)

                            Poisson likelihood with rate defined as l(f).

                            \[ p(y|f) = \operatorname{Poisson}(y | θ=l(f))\]

                            This is to be used if we assume that the uncertainity associated with the data follows a Poisson distribution.

                            source
                            diff --git a/v0.2.6/search/index.html b/v0.2.6/search/index.html index 7595f06..d94db5d 100644 --- a/v0.2.6/search/index.html +++ b/v0.2.6/search/index.html @@ -459,5 +459,6 @@ }); +

                            Loading search...

                              diff --git a/v0.2.7/api/index.html b/v0.2.7/api/index.html index ead591c..2bcf661 100644 --- a/v0.2.7/api/index.html +++ b/v0.2.7/api/index.html @@ -459,5 +459,6 @@ }); +

                              API

                              Likelihoods

                              GPLikelihoods.BernoulliLikelihoodType
                              BernoulliLikelihood(l=logistic)

                              Bernoulli likelihood is to be used if we assume that the uncertainity associated with the data follows a Bernoulli distribution. The link l needs to transform the input f to the domain [0, 1]

                              \[ p(y|f) = \operatorname{Bernoulli}(y | l(f))\]

                              On calling, this would return a Bernoulli distribution with l(f) probability of true.

                              source
                              GPLikelihoods.CategoricalLikelihoodType
                              CategoricalLikelihood(l=softmax)

                              Categorical likelihood is to be used if we assume that the uncertainity associated with the data follows a Categorical distribution.

                              \[ p(y|f_1, f_2, \dots, f_{n-1}) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_{n-1}, 0))\]

                              Given an AbstractVector $[f_1, f_2, ..., f_{n-1}]$, returns a Categorical distribution, with probabilities given by $l(f_1, f_2, ..., f_{n-1}, 0)$.

                              source
                              GPLikelihoods.GammaLikelihoodType
                              GammaLikelihood(α::Real=1.0, l=exp)

                              Gamma likelihood with fixed shape α.

                              \[ p(y|f) = \operatorname{Gamma}(y | α, l(f))\]

                              On calling, this would return a gamma distribution with shape α and scale l(f).

                              source
                              GPLikelihoods.GaussianLikelihoodType
                              GaussianLikelihood(σ²)

                              Gaussian likelihood with σ² variance. This is to be used if we assume that the uncertainity associated with the data follows a Gaussian distribution.

                              \[ p(y|f) = \operatorname{Normal}(y | f, σ²)\]

                              On calling, this would return a normal distribution with mean f and variance σ².

                              source
                              GPLikelihoods.HeteroscedasticGaussianLikelihoodType
                              HeteroscedasticGaussianLikelihood(l=exp)

                              Heteroscedastic Gaussian likelihood. This is a Gaussian likelihood whose mean and variance are functions of latent processes.

                              \[ p(y|[f, g]) = \operatorname{Normal}(y | f, sqrt(l(g)))\]

                              On calling, this would return a normal distribution with mean f and variance l(g). Where l is link going from R to R^+

                              source
                              GPLikelihoods.PoissonLikelihoodType
                              PoissonLikelihood(l=exp)

                              Poisson likelihood with rate defined as l(f).

                              \[ p(y|f) = \operatorname{Poisson}(y | θ=l(f))\]

                              This is to be used if we assume that the uncertainity associated with the data follows a Poisson distribution.

                              source
                              Missing docstring.

                              Missing docstring for ChainLink. Check Documenter's build log for details.

                              The rest of the links ExpLink, LogisticLink, etc., are aliases for the corresponding wrapped functions in a Link. For example ExpLink == Link{typeof(exp)}.

                              When passing a Link to an AbstractLikelihood, this link corresponds to the transformation p=link(f) while, as mentioned in the Constrained parameters section, the statistics literature usually use the denomination inverse link or mean function for it.

                              diff --git a/v0.2.7/index.html b/v0.2.7/index.html index 7f05ba0..35a6214 100644 --- a/v0.2.7/index.html +++ b/v0.2.7/index.html @@ -459,6 +459,7 @@ }); +

                              GPLikelihoods

                              GPLikelihoods.jl provides a practical interface to connect Gaussian and non-conjugate likelihoods to Gaussian Processes. The API is very basic: Every AbstractLikelihood object is a functor taking a Real or an AbstractVector as an input and returns a Distribution from Distributions.jl.

                              Single-latent vs multi-latent likelihoods

                              Most likelihoods, like the GaussianLikelihood, only require one latent Gaussian process. Passing a Real will therefore return a UnivariateDistribution, and passing an AbstractVector{<:Real} will return a multivariate product of distributions.

                              julia> f = 2.0;
                              julia> GaussianLikelihood()(f) == Normal(2.0)ERROR: UndefVarError: GaussianLikelihood not defined
                              julia> fs = [2.0, 3.0, 1.5]3-element Vector{Float64}: 2.0 3.0 diff --git a/v0.2.7/search/index.html b/v0.2.7/search/index.html index 9afa1c1..3713ea5 100644 --- a/v0.2.7/search/index.html +++ b/v0.2.7/search/index.html @@ -459,5 +459,6 @@ }); +

                              Loading search...

                                diff --git a/v0.3.0/api/index.html b/v0.3.0/api/index.html index 25e439f..02660c1 100644 --- a/v0.3.0/api/index.html +++ b/v0.3.0/api/index.html @@ -459,5 +459,6 @@ }); +

                                API

                                Likelihoods

                                GPLikelihoods.BernoulliLikelihoodType
                                BernoulliLikelihood(l=logistic)

                                Bernoulli likelihood is to be used if we assume that the uncertainity associated with the data follows a Bernoulli distribution. The link l needs to transform the input f to the domain [0, 1]

                                \[ p(y|f) = \operatorname{Bernoulli}(y | l(f))\]

                                On calling, this would return a Bernoulli distribution with l(f) probability of true.

                                source
                                GPLikelihoods.CategoricalLikelihoodType
                                CategoricalLikelihood(l=BijectiveSimplexLink(softmax))

                                Categorical likelihood is to be used if we assume that the uncertainty associated with the data follows a Categorical distribution.

                                Assuming a distribution with n categories:

                                n-1 inputs (bijective link)

                                One can work with a bijective transformation by wrapping a link (like softmax) into a BijectiveSimplexLink and only needs n-1 inputs:

                                \[ p(y|f_1, f_2, \dots, f_{n-1}) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_{n-1}, 0))\]

                                The default constructor is a bijective link around softmax.

                                n inputs (non-bijective link)

                                One can also pass directly the inputs without concatenating a 0:

                                \[ p(y|f_1, f_2, \dots, f_n) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_n))\]

                                This variant is over-parametrized, as there are n-1 independent parameters embedded in a n dimensional parameter space. For more details, see the end of the section of this Wikipedia link where it corresponds to Variant 1 and 2.

                                source
                                GPLikelihoods.GammaLikelihoodType
                                GammaLikelihood(α::Real=1.0, l=exp)

                                Gamma likelihood with fixed shape α.

                                \[ p(y|f) = \operatorname{Gamma}(y | α, l(f))\]

                                On calling, this would return a Gamma distribution with shape α and scale invlink(f).

                                source
                                GPLikelihoods.GaussianLikelihoodType
                                GaussianLikelihood(σ²)

                                Gaussian likelihood with σ² variance. This is to be used if we assume that the uncertainity associated with the data follows a Gaussian distribution.

                                \[ p(y|f) = \operatorname{Normal}(y | f, σ²)\]

                                On calling, this would return a normal distribution with mean f and variance σ².

                                source
                                GPLikelihoods.HeteroscedasticGaussianLikelihoodType
                                HeteroscedasticGaussianLikelihood(l=exp)

                                Heteroscedastic Gaussian likelihood. This is a Gaussian likelihood whose mean and variance are functions of latent processes.

                                \[ p(y|[f, g]) = \operatorname{Normal}(y | f, sqrt(l(g)))\]

                                On calling, this would return a normal distribution with mean f and variance l(g). Where l is link going from R to R^+

                                source
                                GPLikelihoods.PoissonLikelihoodType
                                PoissonLikelihood(l=exp)

                                Poisson likelihood with rate defined as l(f).

                                \[ p(y|f) = \operatorname{Poisson}(y | θ=l(f))\]

                                This is to be used if we assume that the uncertainity associated with the data follows a Poisson distribution.

                                source
                                Missing docstring.

                                Missing docstring for ChainLink. Check Documenter's build log for details.

                                The rest of the links ExpLink, LogisticLink, etc., are aliases for the corresponding wrapped functions in a Link. For example ExpLink == Link{typeof(exp)}.

                                When passing a Link to an AbstractLikelihood, this link corresponds to the transformation p=link(f) while, as mentioned in the Constrained parameters section, the statistics literature usually use the denomination inverse link or mean function for it.

                                diff --git a/v0.3.0/index.html b/v0.3.0/index.html index a7f81d0..649c07f 100644 --- a/v0.3.0/index.html +++ b/v0.3.0/index.html @@ -459,6 +459,7 @@ }); +

                                GPLikelihoods

                                GPLikelihoods.jl provides a practical interface to connect Gaussian and non-conjugate likelihoods to Gaussian Processes. The API is very basic: Every AbstractLikelihood object is a functor taking a Real or an AbstractVector as an input and returns a Distribution from Distributions.jl.

                                Single-latent vs multi-latent likelihoods

                                Most likelihoods, like the GaussianLikelihood, only require one latent Gaussian process. Passing a Real will therefore return a UnivariateDistribution, and passing an AbstractVector{<:Real} will return a multivariate product of distributions.

                                julia> f = 2.0;
                                julia> GaussianLikelihood()(f) == Normal(2.0)ERROR: UndefVarError: GaussianLikelihood not defined
                                julia> fs = [2.0, 3.0, 1.5]3-element Vector{Float64}: 2.0 3.0 diff --git a/v0.3.0/search/index.html b/v0.3.0/search/index.html index f02c759..00b9479 100644 --- a/v0.3.0/search/index.html +++ b/v0.3.0/search/index.html @@ -459,5 +459,6 @@ }); +

                                Loading search...

                                  diff --git a/v0.3.1/api/index.html b/v0.3.1/api/index.html index 7fddd0f..2a0acd5 100644 --- a/v0.3.1/api/index.html +++ b/v0.3.1/api/index.html @@ -459,5 +459,6 @@ }); +

                                  API

                                  Likelihoods

                                  GPLikelihoods.BernoulliLikelihoodType
                                  BernoulliLikelihood(l=logistic)

                                  Bernoulli likelihood is to be used if we assume that the uncertainity associated with the data follows a Bernoulli distribution. The link l needs to transform the input f to the domain [0, 1]

                                  \[ p(y|f) = \operatorname{Bernoulli}(y | l(f))\]

                                  On calling, this would return a Bernoulli distribution with l(f) probability of true.

                                  source
                                  GPLikelihoods.CategoricalLikelihoodType
                                  CategoricalLikelihood(l=BijectiveSimplexLink(softmax))

                                  Categorical likelihood is to be used if we assume that the uncertainty associated with the data follows a Categorical distribution.

                                  Assuming a distribution with n categories:

                                  n-1 inputs (bijective link)

                                  One can work with a bijective transformation by wrapping a link (like softmax) into a BijectiveSimplexLink and only needs n-1 inputs:

                                  \[ p(y|f_1, f_2, \dots, f_{n-1}) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_{n-1}, 0))\]

                                  The default constructor is a bijective link around softmax.

                                  n inputs (non-bijective link)

                                  One can also pass directly the inputs without concatenating a 0:

                                  \[ p(y|f_1, f_2, \dots, f_n) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_n))\]

                                  This variant is over-parametrized, as there are n-1 independent parameters embedded in a n dimensional parameter space. For more details, see the end of the section of this Wikipedia link where it corresponds to Variant 1 and 2.

                                  source
                                  GPLikelihoods.GammaLikelihoodType
                                  GammaLikelihood(α::Real=1.0, l=exp)

                                  Gamma likelihood with fixed shape α.

                                  \[ p(y|f) = \operatorname{Gamma}(y | α, l(f))\]

                                  On calling, this returns a Gamma distribution with shape α and scale invlink(f).

                                  source
                                  GPLikelihoods.GaussianLikelihoodType
                                  GaussianLikelihood(σ²)

                                  Gaussian likelihood with σ² variance. This is to be used if we assume that the uncertainity associated with the data follows a Gaussian distribution.

                                  \[ p(y|f) = \operatorname{Normal}(y | f, σ²)\]

                                  On calling, this would return a normal distribution with mean f and variance σ².

                                  source
                                  GPLikelihoods.HeteroscedasticGaussianLikelihoodType
                                  HeteroscedasticGaussianLikelihood(l=exp)

                                  Heteroscedastic Gaussian likelihood. This is a Gaussian likelihood whose mean and variance are functions of latent processes.

                                  \[ p(y|[f, g]) = \operatorname{Normal}(y | f, sqrt(l(g)))\]

                                  On calling, this would return a normal distribution with mean f and variance l(g). Where l is link going from R to R^+

                                  source
                                  GPLikelihoods.PoissonLikelihoodType
                                  PoissonLikelihood(l=exp)

                                  Poisson likelihood with rate defined as l(f).

                                  \[ p(y|f) = \operatorname{Poisson}(y | θ=l(f))\]

                                  This is to be used if we assume that the uncertainity associated with the data follows a Poisson distribution.

                                  source
                                  Missing docstring.

                                  Missing docstring for ChainLink. Check Documenter's build log for details.

                                  The rest of the links ExpLink, LogisticLink, etc., are aliases for the corresponding wrapped functions in a Link. For example ExpLink == Link{typeof(exp)}.

                                  When passing a Link to an AbstractLikelihood, this link corresponds to the transformation p=link(f) while, as mentioned in the Constrained parameters section, the statistics literature usually use the denomination inverse link or mean function for it.

                                  diff --git a/v0.3.1/index.html b/v0.3.1/index.html index 7767b06..6c9d5be 100644 --- a/v0.3.1/index.html +++ b/v0.3.1/index.html @@ -459,6 +459,7 @@ }); +

                                  GPLikelihoods

                                  GPLikelihoods.jl provides a practical interface to connect Gaussian and non-conjugate likelihoods to Gaussian Processes. The API is very basic: Every AbstractLikelihood object is a functor taking a Real or an AbstractVector as an input and returns a Distribution from Distributions.jl.

                                  Single-latent vs multi-latent likelihoods

                                  Most likelihoods, like the GaussianLikelihood, only require one latent Gaussian process. Passing a Real will therefore return a UnivariateDistribution, and passing an AbstractVector{<:Real} will return a multivariate product of distributions.

                                  julia> f = 2.0;
                                  julia> GaussianLikelihood()(f) == Normal(2.0)ERROR: UndefVarError: GaussianLikelihood not defined
                                  julia> fs = [2.0, 3.0, 1.5]3-element Vector{Float64}: 2.0 3.0 diff --git a/v0.3.1/search/index.html b/v0.3.1/search/index.html index e4dead2..70254d7 100644 --- a/v0.3.1/search/index.html +++ b/v0.3.1/search/index.html @@ -459,5 +459,6 @@ }); +

                                  Loading search...

                                    diff --git a/v0.4.0/api/index.html b/v0.4.0/api/index.html index c04ebe5..0708abf 100644 --- a/v0.4.0/api/index.html +++ b/v0.4.0/api/index.html @@ -459,5 +459,6 @@ }); +

                                    API

                                    Likelihoods

                                    GPLikelihoods.BernoulliLikelihoodType
                                    BernoulliLikelihood(l=logistic)

                                    Bernoulli likelihood is to be used if we assume that the uncertainity associated with the data follows a Bernoulli distribution. The link l needs to transform the input f to the domain [0, 1]

                                    \[ p(y|f) = \operatorname{Bernoulli}(y | l(f))\]

                                    On calling, this would return a Bernoulli distribution with l(f) probability of true.

                                    source
                                    GPLikelihoods.CategoricalLikelihoodType
                                    CategoricalLikelihood(l=BijectiveSimplexLink(softmax))

                                    Categorical likelihood is to be used if we assume that the uncertainty associated with the data follows a Categorical distribution.

                                    Assuming a distribution with n categories:

                                    n-1 inputs (bijective link)

                                    One can work with a bijective transformation by wrapping a link (like softmax) into a BijectiveSimplexLink and only needs n-1 inputs:

                                    \[ p(y|f_1, f_2, \dots, f_{n-1}) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_{n-1}, 0))\]

                                    The default constructor is a bijective link around softmax.

                                    n inputs (non-bijective link)

                                    One can also pass directly the inputs without concatenating a 0:

                                    \[ p(y|f_1, f_2, \dots, f_n) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_n))\]

                                    This variant is over-parametrized, as there are n-1 independent parameters embedded in a n dimensional parameter space. For more details, see the end of the section of this Wikipedia link where it corresponds to Variant 1 and 2.

                                    source
                                    GPLikelihoods.GammaLikelihoodType
                                    GammaLikelihood(α::Real=1.0, l=exp)

                                    Gamma likelihood with fixed shape α.

                                    \[ p(y|f) = \operatorname{Gamma}(y | α, l(f))\]

                                    On calling, this returns a Gamma distribution with shape α and scale invlink(f).

                                    source
                                    GPLikelihoods.GaussianLikelihoodType
                                    GaussianLikelihood(σ²)

                                    Gaussian likelihood with σ² variance. This is to be used if we assume that the uncertainity associated with the data follows a Gaussian distribution.

                                    \[ p(y|f) = \operatorname{Normal}(y | f, σ²)\]

                                    On calling, this would return a normal distribution with mean f and variance σ².

                                    source
                                    GPLikelihoods.HeteroscedasticGaussianLikelihoodType
                                    HeteroscedasticGaussianLikelihood(l=exp)

                                    Heteroscedastic Gaussian likelihood. This is a Gaussian likelihood whose mean and variance are functions of latent processes.

                                    \[ p(y|[f, g]) = \operatorname{Normal}(y | f, sqrt(l(g)))\]

                                    On calling, this would return a normal distribution with mean f and variance l(g). Where l is link going from R to R^+

                                    source
                                    GPLikelihoods.PoissonLikelihoodType
                                    PoissonLikelihood(l=exp)

                                    Poisson likelihood with rate defined as l(f).

                                    \[ p(y|f) = \operatorname{Poisson}(y | θ=l(f))\]

                                    This is to be used if we assume that the uncertainity associated with the data follows a Poisson distribution.

                                    source
                                    Missing docstring.

                                    Missing docstring for ChainLink. Check Documenter's build log for details.

                                    The rest of the links ExpLink, LogisticLink, etc., are aliases for the corresponding wrapped functions in a Link. For example ExpLink == Link{typeof(exp)}.

                                    When passing a Link to an AbstractLikelihood, this link corresponds to the transformation p=link(f) while, as mentioned in the Constrained parameters section, the statistics literature usually use the denomination inverse link or mean function for it.

                                    diff --git a/v0.4.0/index.html b/v0.4.0/index.html index a85c563..6c2b148 100644 --- a/v0.4.0/index.html +++ b/v0.4.0/index.html @@ -459,6 +459,7 @@ }); +

                                    GPLikelihoods

                                    GPLikelihoods.jl provides a practical interface to connect Gaussian and non-conjugate likelihoods to Gaussian Processes. The API is very basic: Every AbstractLikelihood object is a functor taking a Real or an AbstractVector as an input and returns a Distribution from Distributions.jl.

                                    Single-latent vs multi-latent likelihoods

                                    Most likelihoods, like the GaussianLikelihood, only require one latent Gaussian process. Passing a Real will therefore return a UnivariateDistribution, and passing an AbstractVector{<:Real} will return a multivariate product of distributions.

                                    julia> f = 2.0;
                                    julia> GaussianLikelihood()(f) == Normal(2.0)ERROR: UndefVarError: GaussianLikelihood not defined
                                    julia> fs = [2.0, 3.0, 1.5]3-element Vector{Float64}: 2.0 3.0 diff --git a/v0.4.0/search/index.html b/v0.4.0/search/index.html index f938dcd..73c83e4 100644 --- a/v0.4.0/search/index.html +++ b/v0.4.0/search/index.html @@ -459,5 +459,6 @@ }); +

                                    Loading search...

                                      diff --git a/v0.4.1/api/index.html b/v0.4.1/api/index.html index 89d3df6..c5db083 100644 --- a/v0.4.1/api/index.html +++ b/v0.4.1/api/index.html @@ -459,5 +459,6 @@ }); +

                                      API

                                      Likelihoods

                                      GPLikelihoods.BernoulliLikelihoodType
                                      BernoulliLikelihood(l=logistic)

                                      Bernoulli likelihood is to be used if we assume that the uncertainity associated with the data follows a Bernoulli distribution. The link l needs to transform the input f to the domain [0, 1]

                                      \[ p(y|f) = \operatorname{Bernoulli}(y | l(f))\]

                                      On calling, this would return a Bernoulli distribution with l(f) probability of true.

                                      source
                                      GPLikelihoods.CategoricalLikelihoodType
                                      CategoricalLikelihood(l=BijectiveSimplexLink(softmax))

                                      Categorical likelihood is to be used if we assume that the uncertainty associated with the data follows a Categorical distribution.

                                      Assuming a distribution with n categories:

                                      n-1 inputs (bijective link)

                                      One can work with a bijective transformation by wrapping a link (like softmax) into a BijectiveSimplexLink and only needs n-1 inputs:

                                      \[ p(y|f_1, f_2, \dots, f_{n-1}) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_{n-1}, 0))\]

                                      The default constructor is a bijective link around softmax.

                                      n inputs (non-bijective link)

                                      One can also pass directly the inputs without concatenating a 0:

                                      \[ p(y|f_1, f_2, \dots, f_n) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_n))\]

                                      This variant is over-parametrized, as there are n-1 independent parameters embedded in a n dimensional parameter space. For more details, see the end of the section of this Wikipedia link where it corresponds to Variant 1 and 2.

                                      source
                                      GPLikelihoods.GammaLikelihoodType
                                      GammaLikelihood(α::Real=1.0, l=exp)

                                      Gamma likelihood with fixed shape α.

                                      \[ p(y|f) = \operatorname{Gamma}(y | α, l(f))\]

                                      On calling, this returns a Gamma distribution with shape α and scale invlink(f).

                                      source
                                      GPLikelihoods.GaussianLikelihoodType
                                      GaussianLikelihood(σ²)

                                      Gaussian likelihood with σ² variance. This is to be used if we assume that the uncertainity associated with the data follows a Gaussian distribution.

                                      \[ p(y|f) = \operatorname{Normal}(y | f, σ²)\]

                                      On calling, this would return a normal distribution with mean f and variance σ².

                                      source
                                      GPLikelihoods.HeteroscedasticGaussianLikelihoodType
                                      HeteroscedasticGaussianLikelihood(l=exp)

                                      Heteroscedastic Gaussian likelihood. This is a Gaussian likelihood whose mean and variance are functions of latent processes.

                                      \[ p(y|[f, g]) = \operatorname{Normal}(y | f, sqrt(l(g)))\]

                                      On calling, this would return a normal distribution with mean f and variance l(g). Where l is link going from R to R^+

                                      source
                                      GPLikelihoods.PoissonLikelihoodType
                                      PoissonLikelihood(l=exp)

                                      Poisson likelihood with rate defined as l(f).

                                      \[ p(y|f) = \operatorname{Poisson}(y | θ=l(f))\]

                                      This is to be used if we assume that the uncertainity associated with the data follows a Poisson distribution.

                                      source
                                      Missing docstring.

                                      Missing docstring for ChainLink. Check Documenter's build log for details.

                                      The rest of the links ExpLink, LogisticLink, etc., are aliases for the corresponding wrapped functions in a Link. For example ExpLink == Link{typeof(exp)}.

                                      When passing a Link to an AbstractLikelihood, this link corresponds to the transformation p=link(f) while, as mentioned in the Constrained parameters section, the statistics literature usually use the denomination inverse link or mean function for it.

                                      diff --git a/v0.4.1/index.html b/v0.4.1/index.html index 029245e..3cda7eb 100644 --- a/v0.4.1/index.html +++ b/v0.4.1/index.html @@ -459,6 +459,7 @@ }); +

                                      GPLikelihoods

                                      GPLikelihoods.jl provides a practical interface to connect Gaussian and non-conjugate likelihoods to Gaussian Processes. The API is very basic: Every AbstractLikelihood object is a functor taking a Real or an AbstractVector as an input and returns a Distribution from Distributions.jl.

                                      Single-latent vs multi-latent likelihoods

                                      Most likelihoods, like the GaussianLikelihood, only require one latent Gaussian process. Passing a Real will therefore return a UnivariateDistribution, and passing an AbstractVector{<:Real} will return a multivariate product of distributions.

                                      julia> f = 2.0;
                                      julia> GaussianLikelihood()(f) == Normal(2.0)ERROR: UndefVarError: GaussianLikelihood not defined
                                      julia> fs = [2.0, 3.0, 1.5]3-element Vector{Float64}: 2.0 3.0 diff --git a/v0.4.1/search/index.html b/v0.4.1/search/index.html index c77d07b..52f444a 100644 --- a/v0.4.1/search/index.html +++ b/v0.4.1/search/index.html @@ -459,5 +459,6 @@ }); +

                                      Loading search...

                                        diff --git a/v0.4.2/api/index.html b/v0.4.2/api/index.html index 9ad5743..b0eeb08 100644 --- a/v0.4.2/api/index.html +++ b/v0.4.2/api/index.html @@ -459,6 +459,7 @@ }); +

                                        API

                                        Likelihoods

                                        GPLikelihoods.BernoulliLikelihoodType
                                        BernoulliLikelihood(l=logistic)

                                        Bernoulli likelihood is to be used if we assume that the uncertainity associated with the data follows a Bernoulli distribution. The link l needs to transform the input f to the domain [0, 1]

                                        \[ p(y|f) = \operatorname{Bernoulli}(y | l(f))\]

                                        On calling, this would return a Bernoulli distribution with l(f) probability of true.

                                        source
                                        GPLikelihoods.CategoricalLikelihoodType
                                        CategoricalLikelihood(l=BijectiveSimplexLink(softmax))

                                        Categorical likelihood is to be used if we assume that the uncertainty associated with the data follows a Categorical distribution.

                                        Assuming a distribution with n categories:

                                        n-1 inputs (bijective link)

                                        One can work with a bijective transformation by wrapping a link (like softmax) into a BijectiveSimplexLink and only needs n-1 inputs:

                                        \[ p(y|f_1, f_2, \dots, f_{n-1}) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_{n-1}, 0))\]

                                        The default constructor is a bijective link around softmax.

                                        n inputs (non-bijective link)

                                        One can also pass directly the inputs without concatenating a 0:

                                        \[ p(y|f_1, f_2, \dots, f_n) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_n))\]

                                        This variant is over-parametrized, as there are n-1 independent parameters embedded in a n dimensional parameter space. For more details, see the end of the section of this Wikipedia link where it corresponds to Variant 1 and 2.

                                        source
                                        GPLikelihoods.GammaLikelihoodType
                                        GammaLikelihood(α::Real=1.0, l=exp)

                                        Gamma likelihood with fixed shape α.

                                        \[ p(y|f) = \operatorname{Gamma}(y | α, l(f))\]

                                        On calling, this returns a Gamma distribution with shape α and scale invlink(f).

                                        source
                                        GPLikelihoods.GaussianLikelihoodType
                                        GaussianLikelihood(σ²)

                                        Gaussian likelihood with σ² variance. This is to be used if we assume that the uncertainity associated with the data follows a Gaussian distribution.

                                        \[ p(y|f) = \operatorname{Normal}(y | f, σ²)\]

                                        On calling, this would return a normal distribution with mean f and variance σ².

                                        source
                                        GPLikelihoods.HeteroscedasticGaussianLikelihoodType
                                        HeteroscedasticGaussianLikelihood(l=exp)

                                        Heteroscedastic Gaussian likelihood. This is a Gaussian likelihood whose mean and variance are functions of latent processes.

                                        \[ p(y|[f, g]) = \operatorname{Normal}(y | f, sqrt(l(g)))\]

                                        On calling, this would return a normal distribution with mean f and variance l(g). Where l is link going from R to R^+

                                        source
                                        GPLikelihoods.PoissonLikelihoodType
                                        PoissonLikelihood(l=exp)

                                        Poisson likelihood with rate defined as l(f).

                                        \[ p(y|f) = \operatorname{Poisson}(y | θ=l(f))\]

                                        This is to be used if we assume that the uncertainity associated with the data follows a Poisson distribution.

                                        source

                                        Negative Binomial

                                        GPLikelihoods.NegativeBinomialLikelihoodType
                                        NegativeBinomialLikelihood(param::NBParam, invlink::Union{Function,Link})

                                        There are many possible parametrizations for the Negative Binomial likelihood. We follow the convention laid out in p.137 of [1] and provide some common parametrizations. The NegativeBinomialLikelihood has a special structure; the first type parameter NBParam defines in what parametrization the latent function is used, and contains the other (scalar) parameters. NBParam itself has two subtypes:

                                        • NBParamProb for parametrizations where f -> p, the probability of success of a Bernoulli event
                                        • NBParamMean for parametrizations where f -> μ, the expected number of events

                                        NBParam predefined types

                                        NBParamProb types with p = invlink(f) the probability of success

                                        NBParamMean types with μ = invlink(f) the mean/expected number of events

                                        • NBParamI: Mean is linked to f and variance is given by μ(1 + α)
                                        • NBParamII: Mean is linked to f and variance is given by μ(1 + α * μ)
                                        • NBParamPower: Mean is linked to f and variance is given by μ(1 + α * μ^ρ)

                                        To create a new parametrization, you need to:

                                        • create a new type struct MyNBParam{T} <: NBParam; myparams::T; end;
                                        • dispatch (l::NegativeBinomialLikelihood{<:MyNBParam})(f::Real), which must return a NegativeBinomial from Distributions.jl.

                                        NegativeBinomial follows the parametrization of NBParamSuccess, i.e. the first argument is the number of successes and the second argument is the probability of success.

                                        Examples

                                        julia> NegativeBinomialLikelihood(NBParamSuccess(10), logistic)(2.0)
                                         NegativeBinomial{Float64}(r=10.0, p=0.8807970779778824)
                                         julia> NegativeBinomialLikelihood(NBParamFailure(10), logistic)(2.0)
                                        diff --git a/v0.4.2/index.html b/v0.4.2/index.html
                                        index 64e3c47..1ae7c9e 100644
                                        --- a/v0.4.2/index.html
                                        +++ b/v0.4.2/index.html
                                        @@ -459,6 +459,7 @@
                                             });
                                         
                                         
                                        +
                                         

                                        GPLikelihoods

                                        GPLikelihoods.jl provides a practical interface to connect Gaussian and non-conjugate likelihoods to Gaussian Processes. The API is very basic: Every AbstractLikelihood object is a functor taking a Real or an AbstractVector as an input and returns a Distribution from Distributions.jl.

                                        Single-latent vs multi-latent likelihoods

                                        Most likelihoods, like the GaussianLikelihood, only require one latent Gaussian process. Passing a Real will therefore return a UnivariateDistribution, and passing an AbstractVector{<:Real} will return a multivariate product of distributions.

                                        julia> f = 2.0;
                                        julia> GaussianLikelihood()(f) == Normal(2.0)ERROR: UndefVarError: GaussianLikelihood not defined
                                        julia> fs = [2.0, 3.0, 1.5]3-element Vector{Float64}: 2.0 3.0 diff --git a/v0.4.2/search/index.html b/v0.4.2/search/index.html index 7f42c07..a35e3be 100644 --- a/v0.4.2/search/index.html +++ b/v0.4.2/search/index.html @@ -459,5 +459,6 @@ }); +

                                        Loading search...

                                          diff --git a/v0.4.3/api/index.html b/v0.4.3/api/index.html index 5935bd4..9019f9e 100644 --- a/v0.4.3/api/index.html +++ b/v0.4.3/api/index.html @@ -459,6 +459,7 @@ }); +

                                          API

                                          Likelihoods

                                          GPLikelihoods.BernoulliLikelihoodType
                                          BernoulliLikelihood(l=logistic)

                                          Bernoulli likelihood is to be used if we assume that the uncertainity associated with the data follows a Bernoulli distribution. The link l needs to transform the input f to the domain [0, 1]

                                          \[ p(y|f) = \operatorname{Bernoulli}(y | l(f))\]

                                          On calling, this would return a Bernoulli distribution with l(f) probability of true.

                                          source
                                          GPLikelihoods.CategoricalLikelihoodType
                                          CategoricalLikelihood(l=BijectiveSimplexLink(softmax))

                                          Categorical likelihood is to be used if we assume that the uncertainty associated with the data follows a Categorical distribution.

                                          Assuming a distribution with n categories:

                                          n-1 inputs (bijective link)

                                          One can work with a bijective transformation by wrapping a link (like softmax) into a BijectiveSimplexLink and only needs n-1 inputs:

                                          \[ p(y|f_1, f_2, \dots, f_{n-1}) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_{n-1}, 0))\]

                                          The default constructor is a bijective link around softmax.

                                          n inputs (non-bijective link)

                                          One can also pass directly the inputs without concatenating a 0:

                                          \[ p(y|f_1, f_2, \dots, f_n) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_n))\]

                                          This variant is over-parametrized, as there are n-1 independent parameters embedded in a n dimensional parameter space. For more details, see the end of the section of this Wikipedia link where it corresponds to Variant 1 and 2.

                                          source
                                          GPLikelihoods.GammaLikelihoodType
                                          GammaLikelihood(α::Real=1.0, l=exp)

                                          Gamma likelihood with fixed shape α.

                                          \[ p(y|f) = \operatorname{Gamma}(y | α, l(f))\]

                                          On calling, this returns a Gamma distribution with shape α and scale invlink(f).

                                          source
                                          GPLikelihoods.GaussianLikelihoodType
                                          GaussianLikelihood(σ²)

                                          Gaussian likelihood with σ² variance. This is to be used if we assume that the uncertainity associated with the data follows a Gaussian distribution.

                                          \[ p(y|f) = \operatorname{Normal}(y | f, σ²)\]

                                          On calling, this would return a normal distribution with mean f and variance σ².

                                          source
                                          GPLikelihoods.HeteroscedasticGaussianLikelihoodType
                                          HeteroscedasticGaussianLikelihood(l=exp)

                                          Heteroscedastic Gaussian likelihood. This is a Gaussian likelihood whose mean and variance are functions of latent processes.

                                          \[ p(y|[f, g]) = \operatorname{Normal}(y | f, sqrt(l(g)))\]

                                          On calling, this would return a normal distribution with mean f and variance l(g). Where l is link going from R to R^+

                                          source
                                          GPLikelihoods.PoissonLikelihoodType
                                          PoissonLikelihood(l=exp)

                                          Poisson likelihood with rate defined as l(f).

                                          \[ p(y|f) = \operatorname{Poisson}(y | θ=l(f))\]

                                          This is to be used if we assume that the uncertainity associated with the data follows a Poisson distribution.

                                          source

                                          Negative Binomial

                                          GPLikelihoods.NegativeBinomialLikelihoodType
                                          NegativeBinomialLikelihood(param::NBParam, invlink::Union{Function,Link})

                                          There are many possible parametrizations for the Negative Binomial likelihood. We follow the convention laid out in p.137 of [^Hilbe'11] and provide some common parametrizations. The NegativeBinomialLikelihood has a special structure; the first type parameter NBParam defines in what parametrization the latent function is used, and contains the other (scalar) parameters. NBParam itself has two subtypes:

                                          • NBParamProb for parametrizations where f -> p, the probability of success of a Bernoulli event
                                          • NBParamMean for parametrizations where f -> μ, the expected number of events

                                          NBParam predefined types

                                          NBParamProb types with p = invlink(f) the probability of success

                                          NBParamMean types with μ = invlink(f) the mean/expected number of events

                                          • NBParamI: Mean is linked to f and variance is given by μ(1 + α)
                                          • NBParamII: Mean is linked to f and variance is given by μ(1 + α * μ)
                                          • NBParamPower: Mean is linked to f and variance is given by μ(1 + α * μ^ρ)

                                          To create a new parametrization, you need to:

                                          • create a new type struct MyNBParam{T} <: NBParam; myparams::T; end;
                                          • dispatch (l::NegativeBinomialLikelihood{<:MyNBParam})(f::Real), which must return a NegativeBinomial from Distributions.jl.

                                          NegativeBinomial follows the parametrization of NBParamSuccess, i.e. the first argument is the number of successes and the second argument is the probability of success.

                                          Examples

                                          julia> NegativeBinomialLikelihood(NBParamSuccess(10), logistic)(2.0)
                                           NegativeBinomial{Float64}(r=10.0, p=0.8807970779778824)
                                           julia> NegativeBinomialLikelihood(NBParamFailure(10), logistic)(2.0)
                                          diff --git a/v0.4.3/index.html b/v0.4.3/index.html
                                          index 92dcdd8..15119d5 100644
                                          --- a/v0.4.3/index.html
                                          +++ b/v0.4.3/index.html
                                          @@ -459,5 +459,6 @@
                                               });
                                           
                                           
                                          +
                                           

                                          GPLikelihoods

                                          GPLikelihoods.jl provides a practical interface to connect Gaussian and non-conjugate likelihoods to Gaussian Processes. The API is very basic: Every AbstractLikelihood object is a functor taking a Real or an AbstractVector as an input and returning a Distribution from Distributions.jl.

                                          Single-latent vs multi-latent likelihoods

                                          Most likelihoods, like the GaussianLikelihood, only require one latent Gaussian process. Passing a Real will therefore return a UnivariateDistribution, and passing an AbstractVector{<:Real} will return a multivariate product of distributions.

                                          julia> f = 2.0;
                                          julia> GaussianLikelihood()(f) == Normal(2.0, 1e-3)true
                                          julia> fs = [2.0, 3.0, 1.5];
                                          julia> GaussianLikelihood()(fs) isa AbstractMvNormaltrue

                                          Some likelihoods, like the CategoricalLikelihood, require multiple latent Gaussian processes, and an AbstractVector{<:Real} needs to be passed. To obtain a product of distributions an AbstractVector{<:AbstractVector{<:Real}} has to be passed (we recommend using ColVecs and RowVecs from KernelFunctions.jl if you need to transform an AbstractMatrix).

                                          julia> fs = [2.0, 3.0, 4.5];
                                          julia> CategoricalLikelihood()(fs) isa Categoricaltrue
                                          julia> Fs = [rand(3) for _ in 1:4];
                                          julia> CategoricalLikelihood()(Fs) isa Product{<:Any,<:Categorical}true

                                          Constrained parameters

                                          The function values f of the latent Gaussian process live in the real domain $\mathbb{R}$. For some likelihoods, the domain of the distribution parameter p that is modulated by the latent Gaussian process is constrained to some subset of $\mathbb{R}$, e.g. only positive values or values in an interval.

                                          To connect these two domains, a transformation from f to p is required. For this, we provide the Link type, which can be passed to the likelihood constructors. (Alternatively, functions can also directly be passed and will be wrapped in a Link.)

                                          We typically call this passed transformation the invlink. This comes from the statistics literature, where the "link" is defined as f = link(p), whereas here we need p = invlink(f).

                                          For more details about which likelihoods require a Link check out their docs.

                                          A classical example is the BernoulliLikelihood for classification, with the probability parameter $p \in [0, 1]$. The default is to use a logistic transformation, but one could also use the inverse of the probit link:

                                          julia> f = 2.0;
                                          julia> BernoulliLikelihood()(f) == Bernoulli(logistic(f))true
                                          julia> BernoulliLikelihood(NormalCDFLink())(f) == Bernoulli(normcdf(f))true

                                          Note that we passed the inverse of the probit function which is the normcdf function.

                                          diff --git a/v0.4.3/search/index.html b/v0.4.3/search/index.html index 7acf784..5bead33 100644 --- a/v0.4.3/search/index.html +++ b/v0.4.3/search/index.html @@ -459,5 +459,6 @@ }); +

                                          Loading search...

                                            diff --git a/v0.4.4/api/index.html b/v0.4.4/api/index.html index a34cd43..b423ca0 100644 --- a/v0.4.4/api/index.html +++ b/v0.4.4/api/index.html @@ -459,6 +459,7 @@ }); +

                                            API

                                            Likelihoods

                                            GPLikelihoods.BernoulliLikelihoodType
                                            BernoulliLikelihood(l=logistic)

                                            Bernoulli likelihood is to be used if we assume that the uncertainity associated with the data follows a Bernoulli distribution. The link l needs to transform the input f to the domain [0, 1]

                                            \[ p(y|f) = \operatorname{Bernoulli}(y | l(f))\]

                                            On calling, this would return a Bernoulli distribution with l(f) probability of true.

                                            source
                                            GPLikelihoods.CategoricalLikelihoodType
                                            CategoricalLikelihood(l=BijectiveSimplexLink(softmax))

                                            Categorical likelihood is to be used if we assume that the uncertainty associated with the data follows a Categorical distribution.

                                            Assuming a distribution with n categories:

                                            n-1 inputs (bijective link)

                                            One can work with a bijective transformation by wrapping a link (like softmax) into a BijectiveSimplexLink and only needs n-1 inputs:

                                            \[ p(y|f_1, f_2, \dots, f_{n-1}) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_{n-1}, 0))\]

                                            The default constructor is a bijective link around softmax.

                                            n inputs (non-bijective link)

                                            One can also pass directly the inputs without concatenating a 0:

                                            \[ p(y|f_1, f_2, \dots, f_n) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_n))\]

                                            This variant is over-parametrized, as there are n-1 independent parameters embedded in a n dimensional parameter space. For more details, see the end of the section of this Wikipedia link where it corresponds to Variant 1 and 2.

                                            source
                                            GPLikelihoods.GammaLikelihoodType
                                            GammaLikelihood(α::Real=1.0, l=exp)

                                            Gamma likelihood with fixed shape α.

                                            \[ p(y|f) = \operatorname{Gamma}(y | α, l(f))\]

                                            On calling, this returns a Gamma distribution with shape α and scale invlink(f).

                                            source
                                            GPLikelihoods.GaussianLikelihoodType
                                            GaussianLikelihood(σ²)

                                            Gaussian likelihood with σ² variance. This is to be used if we assume that the uncertainity associated with the data follows a Gaussian distribution.

                                            \[ p(y|f) = \operatorname{Normal}(y | f, σ²)\]

                                            On calling, this would return a normal distribution with mean f and variance σ².

                                            source
                                            GPLikelihoods.HeteroscedasticGaussianLikelihoodType
                                            HeteroscedasticGaussianLikelihood(l=exp)

                                            Heteroscedastic Gaussian likelihood. This is a Gaussian likelihood whose mean and variance are functions of latent processes.

                                            \[ p(y|[f, g]) = \operatorname{Normal}(y | f, sqrt(l(g)))\]

                                            On calling, this would return a normal distribution with mean f and variance l(g). Where l is link going from R to R^+

                                            source
                                            GPLikelihoods.PoissonLikelihoodType
                                            PoissonLikelihood(l=exp)

                                            Poisson likelihood with rate defined as l(f).

                                            \[ p(y|f) = \operatorname{Poisson}(y | θ=l(f))\]

                                            This is to be used if we assume that the uncertainity associated with the data follows a Poisson distribution.

                                            source

                                            Negative Binomial

                                            GPLikelihoods.NegativeBinomialLikelihoodType
                                            NegativeBinomialLikelihood(param::NBParam, invlink::Union{Function,Link})

                                            There are many possible parametrizations for the Negative Binomial likelihood. We follow the convention laid out in p.137 of [^Hilbe'11] and provide some common parametrizations. The NegativeBinomialLikelihood has a special structure; the first type parameter NBParam defines in what parametrization the latent function is used, and contains the other (scalar) parameters. NBParam itself has two subtypes:

                                            • NBParamProb for parametrizations where f -> p, the probability of success of a Bernoulli event
                                            • NBParamMean for parametrizations where f -> μ, the expected number of events

                                            NBParam predefined types

                                            NBParamProb types with p = invlink(f) the probability of success

                                            NBParamMean types with μ = invlink(f) the mean/expected number of events

                                            • NBParamI: Mean is linked to f and variance is given by μ(1 + α)
                                            • NBParamII: Mean is linked to f and variance is given by μ(1 + α * μ)
                                            • NBParamPower: Mean is linked to f and variance is given by μ(1 + α * μ^ρ)

                                            To create a new parametrization, you need to:

                                            • create a new type struct MyNBParam{T} <: NBParam; myparams::T; end;
                                            • dispatch (l::NegativeBinomialLikelihood{<:MyNBParam})(f::Real), which must return a NegativeBinomial from Distributions.jl.

                                            NegativeBinomial follows the parametrization of NBParamSuccess, i.e. the first argument is the number of successes and the second argument is the probability of success.

                                            Examples

                                            julia> NegativeBinomialLikelihood(NBParamSuccess(10), logistic)(2.0)
                                             NegativeBinomial{Float64}(r=10.0, p=0.8807970779778824)
                                             julia> NegativeBinomialLikelihood(NBParamFailure(10), logistic)(2.0)
                                            diff --git a/v0.4.4/index.html b/v0.4.4/index.html
                                            index 91a27f2..4d270b9 100644
                                            --- a/v0.4.4/index.html
                                            +++ b/v0.4.4/index.html
                                            @@ -459,5 +459,6 @@
                                                 });
                                             
                                             
                                            +
                                             

                                            GPLikelihoods

                                            GPLikelihoods.jl provides a practical interface to connect Gaussian and non-conjugate likelihoods to Gaussian Processes. The API is very basic: Every AbstractLikelihood object is a functor taking a Real or an AbstractVector as an input and returning a Distribution from Distributions.jl.

                                            Single-latent vs multi-latent likelihoods

                                            Most likelihoods, like the GaussianLikelihood, only require one latent Gaussian process. Passing a Real will therefore return a UnivariateDistribution, and passing an AbstractVector{<:Real} will return a multivariate product of distributions.

                                            julia> f = 2.0;
                                            julia> GaussianLikelihood()(f) == Normal(2.0, 1e-3)true
                                            julia> fs = [2.0, 3.0, 1.5];
                                            julia> GaussianLikelihood()(fs) isa AbstractMvNormaltrue

                                            Some likelihoods, like the CategoricalLikelihood, require multiple latent Gaussian processes, and an AbstractVector{<:Real} needs to be passed. To obtain a product of distributions an AbstractVector{<:AbstractVector{<:Real}} has to be passed (we recommend using ColVecs and RowVecs from KernelFunctions.jl if you need to transform an AbstractMatrix).

                                            julia> fs = [2.0, 3.0, 4.5];
                                            julia> CategoricalLikelihood()(fs) isa Categoricaltrue
                                            julia> Fs = [rand(3) for _ in 1:4];
                                            julia> CategoricalLikelihood()(Fs) isa Product{<:Any,<:Categorical}true

                                            Constrained parameters

                                            The function values f of the latent Gaussian process live in the real domain $\mathbb{R}$. For some likelihoods, the domain of the distribution parameter p that is modulated by the latent Gaussian process is constrained to some subset of $\mathbb{R}$, e.g. only positive values or values in an interval.

                                            To connect these two domains, a transformation from f to p is required. For this, we provide the Link type, which can be passed to the likelihood constructors. (Alternatively, functions can also directly be passed and will be wrapped in a Link.)

                                            We typically call this passed transformation the invlink. This comes from the statistics literature, where the "link" is defined as f = link(p), whereas here we need p = invlink(f).

                                            For more details about which likelihoods require a Link check out their docs.

                                            A classical example is the BernoulliLikelihood for classification, with the probability parameter $p \in [0, 1]$. The default is to use a logistic transformation, but one could also use the inverse of the probit link:

                                            julia> f = 2.0;
                                            julia> BernoulliLikelihood()(f) == Bernoulli(logistic(f))true
                                            julia> BernoulliLikelihood(NormalCDFLink())(f) == Bernoulli(normcdf(f))true

                                            Note that we passed the inverse of the probit function which is the normcdf function.

                                            diff --git a/v0.4.4/search/index.html b/v0.4.4/search/index.html index 14edee5..e9b42bf 100644 --- a/v0.4.4/search/index.html +++ b/v0.4.4/search/index.html @@ -459,5 +459,6 @@ }); +

                                            Loading search...

                                              diff --git a/v0.4.5/api/index.html b/v0.4.5/api/index.html index 06364a8..1e5c516 100644 --- a/v0.4.5/api/index.html +++ b/v0.4.5/api/index.html @@ -459,6 +459,7 @@ }); +

                                              API

                                              Likelihoods

                                              GPLikelihoods.BernoulliLikelihoodType
                                              BernoulliLikelihood(l=logistic)

                                              Bernoulli likelihood is to be used if we assume that the uncertainity associated with the data follows a Bernoulli distribution. The link l needs to transform the input f to the domain [0, 1]

                                              \[ p(y|f) = \operatorname{Bernoulli}(y | l(f))\]

                                              On calling, this would return a Bernoulli distribution with l(f) probability of true.

                                              source
                                              GPLikelihoods.CategoricalLikelihoodType
                                              CategoricalLikelihood(l=BijectiveSimplexLink(softmax))

                                              Categorical likelihood is to be used if we assume that the uncertainty associated with the data follows a Categorical distribution.

                                              Assuming a distribution with n categories:

                                              n-1 inputs (bijective link)

                                              One can work with a bijective transformation by wrapping a link (like softmax) into a BijectiveSimplexLink and only needs n-1 inputs:

                                              \[ p(y|f_1, f_2, \dots, f_{n-1}) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_{n-1}, 0))\]

                                              The default constructor is a bijective link around softmax.

                                              n inputs (non-bijective link)

                                              One can also pass directly the inputs without concatenating a 0:

                                              \[ p(y|f_1, f_2, \dots, f_n) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_n))\]

                                              This variant is over-parametrized, as there are n-1 independent parameters embedded in a n dimensional parameter space. For more details, see the end of the section of this Wikipedia link where it corresponds to Variant 1 and 2.

                                              source
                                              GPLikelihoods.GammaLikelihoodType
                                              GammaLikelihood(α::Real=1.0, l=exp)

                                              Gamma likelihood with fixed shape α.

                                              \[ p(y|f) = \operatorname{Gamma}(y | α, l(f))\]

                                              On calling, this returns a Gamma distribution with shape α and scale invlink(f).

                                              source
                                              GPLikelihoods.GaussianLikelihoodType
                                              GaussianLikelihood(σ²)

                                              Gaussian likelihood with σ² variance. This is to be used if we assume that the uncertainity associated with the data follows a Gaussian distribution.

                                              \[ p(y|f) = \operatorname{Normal}(y | f, σ²)\]

                                              On calling, this would return a normal distribution with mean f and variance σ².

                                              source
                                              GPLikelihoods.HeteroscedasticGaussianLikelihoodType
                                              HeteroscedasticGaussianLikelihood(l=exp)

                                              Heteroscedastic Gaussian likelihood. This is a Gaussian likelihood whose mean and variance are functions of latent processes.

                                              \[ p(y|[f, g]) = \operatorname{Normal}(y | f, sqrt(l(g)))\]

                                              On calling, this would return a normal distribution with mean f and variance l(g). Where l is link going from R to R^+

                                              source
                                              GPLikelihoods.PoissonLikelihoodType
                                              PoissonLikelihood(l=exp)

                                              Poisson likelihood with rate defined as l(f).

                                              \[ p(y|f) = \operatorname{Poisson}(y | θ=l(f))\]

                                              This is to be used if we assume that the uncertainity associated with the data follows a Poisson distribution.

                                              source

                                              Negative Binomial

                                              GPLikelihoods.NegativeBinomialLikelihoodType
                                              NegativeBinomialLikelihood(param::NBParam, invlink::Union{Function,Link})

                                              There are many possible parametrizations for the Negative Binomial likelihood. We follow the convention laid out in p.137 of [^Hilbe'11] and provide some common parametrizations. The NegativeBinomialLikelihood has a special structure; the first type parameter NBParam defines in what parametrization the latent function is used, and contains the other (scalar) parameters. NBParam itself has two subtypes:

                                              • NBParamProb for parametrizations where f -> p, the probability of success of a Bernoulli event
                                              • NBParamMean for parametrizations where f -> μ, the expected number of events

                                              NBParam predefined types

                                              NBParamProb types with p = invlink(f) the probability of success

                                              NBParamMean types with μ = invlink(f) the mean/expected number of events

                                              • NBParamI: Mean is linked to f and variance is given by μ(1 + α)
                                              • NBParamII: Mean is linked to f and variance is given by μ(1 + α * μ)
                                              • NBParamPower: Mean is linked to f and variance is given by μ(1 + α * μ^ρ)

                                              To create a new parametrization, you need to:

                                              • create a new type struct MyNBParam{T} <: NBParam; myparams::T; end;
                                              • dispatch (l::NegativeBinomialLikelihood{<:MyNBParam})(f::Real), which must return a NegativeBinomial from Distributions.jl.

                                              NegativeBinomial follows the parametrization of NBParamSuccess, i.e. the first argument is the number of successes and the second argument is the probability of success.

                                              Examples

                                              julia> NegativeBinomialLikelihood(NBParamSuccess(10), logistic)(2.0)
                                               NegativeBinomial{Float64}(r=10.0, p=0.8807970779778824)
                                               julia> NegativeBinomialLikelihood(NBParamFailure(10), logistic)(2.0)
                                              diff --git a/v0.4.5/index.html b/v0.4.5/index.html
                                              index 04e4d0f..5923004 100644
                                              --- a/v0.4.5/index.html
                                              +++ b/v0.4.5/index.html
                                              @@ -459,5 +459,6 @@
                                                   });
                                               
                                               
                                              +
                                               

                                              GPLikelihoods

                                              GPLikelihoods.jl provides a practical interface to connect Gaussian and non-conjugate likelihoods to Gaussian Processes. The API is very basic: Every AbstractLikelihood object is a functor taking a Real or an AbstractVector as an input and returning a Distribution from Distributions.jl.

                                              Single-latent vs multi-latent likelihoods

                                              Most likelihoods, like the GaussianLikelihood, only require one latent Gaussian process. Passing a Real will therefore return a UnivariateDistribution, and passing an AbstractVector{<:Real} will return a multivariate product of distributions.

                                              julia> f = 2.0;
                                              julia> GaussianLikelihood()(f) == Normal(2.0, 1e-3)true
                                              julia> fs = [2.0, 3.0, 1.5];
                                              julia> GaussianLikelihood()(fs) isa AbstractMvNormaltrue

                                              Some likelihoods, like the CategoricalLikelihood, require multiple latent Gaussian processes, and an AbstractVector{<:Real} needs to be passed. To obtain a product of distributions an AbstractVector{<:AbstractVector{<:Real}} has to be passed (we recommend using ColVecs and RowVecs from KernelFunctions.jl if you need to transform an AbstractMatrix).

                                              julia> fs = [2.0, 3.0, 4.5];
                                              julia> CategoricalLikelihood()(fs) isa Categoricaltrue
                                              julia> Fs = [rand(3) for _ in 1:4];
                                              julia> CategoricalLikelihood()(Fs) isa Product{<:Any,<:Categorical}true

                                              Constrained parameters

                                              The function values f of the latent Gaussian process live in the real domain $\mathbb{R}$. For some likelihoods, the domain of the distribution parameter p that is modulated by the latent Gaussian process is constrained to some subset of $\mathbb{R}$, e.g. only positive values or values in an interval.

                                              To connect these two domains, a transformation from f to p is required. For this, we provide the Link type, which can be passed to the likelihood constructors. (Alternatively, functions can also directly be passed and will be wrapped in a Link.)

                                              We typically call this passed transformation the invlink. This comes from the statistics literature, where the "link" is defined as f = link(p), whereas here we need p = invlink(f).

                                              For more details about which likelihoods require a Link check out their docs.

                                              A classical example is the BernoulliLikelihood for classification, with the probability parameter $p \in [0, 1]$. The default is to use a logistic transformation, but one could also use the inverse of the probit link:

                                              julia> f = 2.0;
                                              julia> BernoulliLikelihood()(f) == Bernoulli(logistic(f))true
                                              julia> BernoulliLikelihood(NormalCDFLink())(f) == Bernoulli(normcdf(f))true

                                              Note that we passed the inverse of the probit function which is the normcdf function.

                                              diff --git a/v0.4.5/search/index.html b/v0.4.5/search/index.html index 7894ecf..b068456 100644 --- a/v0.4.5/search/index.html +++ b/v0.4.5/search/index.html @@ -459,5 +459,6 @@ }); +

                                              Loading search...

                                                diff --git a/v0.4.6/api/index.html b/v0.4.6/api/index.html index 9f3eae0..b5a5d38 100644 --- a/v0.4.6/api/index.html +++ b/v0.4.6/api/index.html @@ -459,6 +459,7 @@ }); +

                                                API

                                                Likelihoods

                                                GPLikelihoods.BernoulliLikelihoodType
                                                BernoulliLikelihood(l=logistic)

                                                Bernoulli likelihood is to be used if we assume that the uncertainity associated with the data follows a Bernoulli distribution. The link l needs to transform the input f to the domain [0, 1]

                                                \[ p(y|f) = \operatorname{Bernoulli}(y | l(f))\]

                                                On calling, this would return a Bernoulli distribution with l(f) probability of true.

                                                source
                                                GPLikelihoods.CategoricalLikelihoodType
                                                CategoricalLikelihood(l=BijectiveSimplexLink(softmax))

                                                Categorical likelihood is to be used if we assume that the uncertainty associated with the data follows a Categorical distribution.

                                                Assuming a distribution with n categories:

                                                n-1 inputs (bijective link)

                                                One can work with a bijective transformation by wrapping a link (like softmax) into a BijectiveSimplexLink and only needs n-1 inputs:

                                                \[ p(y|f_1, f_2, \dots, f_{n-1}) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_{n-1}, 0))\]

                                                The default constructor is a bijective link around softmax.

                                                n inputs (non-bijective link)

                                                One can also pass directly the inputs without concatenating a 0:

                                                \[ p(y|f_1, f_2, \dots, f_n) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_n))\]

                                                This variant is over-parametrized, as there are n-1 independent parameters embedded in a n dimensional parameter space. For more details, see the end of the section of this Wikipedia link where it corresponds to Variant 1 and 2.

                                                source
                                                GPLikelihoods.GammaLikelihoodType
                                                GammaLikelihood(α::Real=1.0, l=exp)

                                                Gamma likelihood with fixed shape α.

                                                \[ p(y|f) = \operatorname{Gamma}(y | α, l(f))\]

                                                On calling, this returns a Gamma distribution with shape α and scale invlink(f).

                                                source
                                                GPLikelihoods.GaussianLikelihoodType
                                                GaussianLikelihood(σ²)

                                                Gaussian likelihood with σ² variance. This is to be used if we assume that the uncertainity associated with the data follows a Gaussian distribution.

                                                \[ p(y|f) = \operatorname{Normal}(y | f, σ²)\]

                                                On calling, this would return a normal distribution with mean f and variance σ².

                                                source
                                                GPLikelihoods.HeteroscedasticGaussianLikelihoodType
                                                HeteroscedasticGaussianLikelihood(l=exp)

                                                Heteroscedastic Gaussian likelihood. This is a Gaussian likelihood whose mean and variance are functions of latent processes.

                                                \[ p(y|[f, g]) = \operatorname{Normal}(y | f, sqrt(l(g)))\]

                                                On calling, this would return a normal distribution with mean f and variance l(g). Where l is link going from R to R^+

                                                source
                                                GPLikelihoods.PoissonLikelihoodType
                                                PoissonLikelihood(l=exp)

                                                Poisson likelihood with rate defined as l(f).

                                                \[ p(y|f) = \operatorname{Poisson}(y | θ=l(f))\]

                                                This is to be used if we assume that the uncertainity associated with the data follows a Poisson distribution.

                                                source

                                                Negative Binomial

                                                GPLikelihoods.NegativeBinomialLikelihoodType
                                                NegativeBinomialLikelihood(param::NBParam, invlink::Union{Function,Link})

                                                There are many possible parametrizations for the Negative Binomial likelihood. We follow the convention laid out in p.137 of [^Hilbe'11] and provide some common parametrizations. The NegativeBinomialLikelihood has a special structure; the first type parameter NBParam defines in what parametrization the latent function is used, and contains the other (scalar) parameters. NBParam itself has two subtypes:

                                                • NBParamProb for parametrizations where f -> p, the probability of success of a Bernoulli event
                                                • NBParamMean for parametrizations where f -> μ, the expected number of events

                                                NBParam predefined types

                                                NBParamProb types with p = invlink(f) the probability of success

                                                NBParamMean types with μ = invlink(f) the mean/expected number of events

                                                • NBParamI: Mean is linked to f and variance is given by μ(1 + α)
                                                • NBParamII: Mean is linked to f and variance is given by μ(1 + α * μ)
                                                • NBParamPower: Mean is linked to f and variance is given by μ(1 + α * μ^ρ)

                                                To create a new parametrization, you need to:

                                                • create a new type struct MyNBParam{T} <: NBParam; myparams::T; end;
                                                • dispatch (l::NegativeBinomialLikelihood{<:MyNBParam})(f::Real), which must return a NegativeBinomial from Distributions.jl.

                                                NegativeBinomial follows the parametrization of NBParamSuccess, i.e. the first argument is the number of successes and the second argument is the probability of success.

                                                Examples

                                                julia> NegativeBinomialLikelihood(NBParamSuccess(10), logistic)(2.0)
                                                 NegativeBinomial{Float64}(r=10.0, p=0.8807970779778824)
                                                 julia> NegativeBinomialLikelihood(NBParamFailure(10), logistic)(2.0)
                                                diff --git a/v0.4.6/index.html b/v0.4.6/index.html
                                                index 2bba0fb..44202e5 100644
                                                --- a/v0.4.6/index.html
                                                +++ b/v0.4.6/index.html
                                                @@ -459,5 +459,6 @@
                                                     });
                                                 
                                                 
                                                +
                                                 

                                                GPLikelihoods

                                                GPLikelihoods.jl provides a practical interface to connect Gaussian and non-conjugate likelihoods to Gaussian Processes. The API is very basic: Every AbstractLikelihood object is a functor taking a Real or an AbstractVector as an input and returning a Distribution from Distributions.jl.

                                                Single-latent vs multi-latent likelihoods

                                                Most likelihoods, like the GaussianLikelihood, only require one latent Gaussian process. Passing a Real will therefore return a UnivariateDistribution, and passing an AbstractVector{<:Real} will return a multivariate product of distributions.

                                                julia> f = 2.0;
                                                julia> GaussianLikelihood()(f) == Normal(2.0, 1e-3)true
                                                julia> fs = [2.0, 3.0, 1.5];
                                                julia> GaussianLikelihood()(fs) isa AbstractMvNormaltrue

                                                Some likelihoods, like the CategoricalLikelihood, require multiple latent Gaussian processes, and an AbstractVector{<:Real} needs to be passed. To obtain a product of distributions an AbstractVector{<:AbstractVector{<:Real}} has to be passed (we recommend using ColVecs and RowVecs from KernelFunctions.jl if you need to transform an AbstractMatrix).

                                                julia> fs = [2.0, 3.0, 4.5];
                                                julia> CategoricalLikelihood()(fs) isa Categoricaltrue
                                                julia> Fs = [rand(3) for _ in 1:4];
                                                julia> CategoricalLikelihood()(Fs) isa Product{<:Any,<:Categorical}true

                                                Constrained parameters

                                                The function values f of the latent Gaussian process live in the real domain $\mathbb{R}$. For some likelihoods, the domain of the distribution parameter p that is modulated by the latent Gaussian process is constrained to some subset of $\mathbb{R}$, e.g. only positive values or values in an interval.

                                                To connect these two domains, a transformation from f to p is required. For this, we provide the Link type, which can be passed to the likelihood constructors. (Alternatively, functions can also directly be passed and will be wrapped in a Link.)

                                                We typically call this passed transformation the invlink. This comes from the statistics literature, where the "link" is defined as f = link(p), whereas here we need p = invlink(f).

                                                For more details about which likelihoods require a Link check out their docs.

                                                A classical example is the BernoulliLikelihood for classification, with the probability parameter $p \in [0, 1]$. The default is to use a logistic transformation, but one could also use the inverse of the probit link:

                                                julia> f = 2.0;
                                                julia> BernoulliLikelihood()(f) == Bernoulli(logistic(f))true
                                                julia> BernoulliLikelihood(NormalCDFLink())(f) == Bernoulli(normcdf(f))true

                                                Note that we passed the inverse of the probit function which is the normcdf function.

                                                diff --git a/v0.4.6/search/index.html b/v0.4.6/search/index.html index 8dfc789..c59aba2 100644 --- a/v0.4.6/search/index.html +++ b/v0.4.6/search/index.html @@ -459,5 +459,6 @@ }); +

                                                Loading search...

                                                  diff --git a/v0.4.7/api/index.html b/v0.4.7/api/index.html index d4f39a1..d6cd2e7 100644 --- a/v0.4.7/api/index.html +++ b/v0.4.7/api/index.html @@ -459,6 +459,7 @@ }); +

                                                  API

                                                  Likelihoods

                                                  GPLikelihoods.BernoulliLikelihoodType
                                                  BernoulliLikelihood(l=logistic)

                                                  Bernoulli likelihood is to be used if we assume that the uncertainity associated with the data follows a Bernoulli distribution. The link l needs to transform the input f to the domain [0, 1]

                                                  \[ p(y|f) = \operatorname{Bernoulli}(y | l(f))\]

                                                  On calling, this would return a Bernoulli distribution with l(f) probability of true.

                                                  source
                                                  GPLikelihoods.CategoricalLikelihoodType
                                                  CategoricalLikelihood(l=BijectiveSimplexLink(softmax))

                                                  Categorical likelihood is to be used if we assume that the uncertainty associated with the data follows a Categorical distribution.

                                                  Assuming a distribution with n categories:

                                                  n-1 inputs (bijective link)

                                                  One can work with a bijective transformation by wrapping a link (like softmax) into a BijectiveSimplexLink and only needs n-1 inputs:

                                                  \[ p(y|f_1, f_2, \dots, f_{n-1}) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_{n-1}, 0))\]

                                                  The default constructor is a bijective link around softmax.

                                                  n inputs (non-bijective link)

                                                  One can also pass directly the inputs without concatenating a 0:

                                                  \[ p(y|f_1, f_2, \dots, f_n) = \operatorname{Categorical}(y | l(f_1, f_2, \dots, f_n))\]

                                                  This variant is over-parametrized, as there are n-1 independent parameters embedded in a n dimensional parameter space. For more details, see the end of the section of this Wikipedia link where it corresponds to Variant 1 and 2.

                                                  source
                                                  GPLikelihoods.GammaLikelihoodType
                                                  GammaLikelihood(α::Real=1.0, l=exp)

                                                  Gamma likelihood with fixed shape α.

                                                  \[ p(y|f) = \operatorname{Gamma}(y | α, l(f))\]

                                                  On calling, this returns a Gamma distribution with shape α and scale invlink(f).

                                                  source
                                                  GPLikelihoods.GaussianLikelihoodType
                                                  GaussianLikelihood(σ²)

                                                  Gaussian likelihood with σ² variance. This is to be used if we assume that the uncertainity associated with the data follows a Gaussian distribution.

                                                  \[ p(y|f) = \operatorname{Normal}(y | f, σ²)\]

                                                  On calling, this would return a normal distribution with mean f and variance σ².

                                                  source
                                                  GPLikelihoods.HeteroscedasticGaussianLikelihoodType
                                                  HeteroscedasticGaussianLikelihood(l=exp)

                                                  Heteroscedastic Gaussian likelihood. This is a Gaussian likelihood whose mean and variance are functions of latent processes.

                                                  \[ p(y|[f, g]) = \operatorname{Normal}(y | f, sqrt(l(g)))\]

                                                  On calling, this would return a normal distribution with mean f and variance l(g). Where l is link going from R to R^+

                                                  source
                                                  GPLikelihoods.PoissonLikelihoodType
                                                  PoissonLikelihood(l=exp)

                                                  Poisson likelihood with rate defined as l(f).

                                                  \[ p(y|f) = \operatorname{Poisson}(y | θ=l(f))\]

                                                  This is to be used if we assume that the uncertainity associated with the data follows a Poisson distribution.

                                                  source

                                                  Negative Binomial

                                                  GPLikelihoods.NegativeBinomialLikelihoodType
                                                  NegativeBinomialLikelihood(param::NBParam, invlink::Union{Function,Link})

                                                  There are many possible parametrizations for the Negative Binomial likelihood. We follow the convention laid out in p.137 of [^Hilbe'11] and provide some common parametrizations. The NegativeBinomialLikelihood has a special structure; the first type parameter NBParam defines in what parametrization the latent function is used, and contains the other (scalar) parameters. NBParam itself has two subtypes:

                                                  • NBParamProb for parametrizations where f -> p, the probability of success of a Bernoulli event
                                                  • NBParamMean for parametrizations where f -> μ, the expected number of events

                                                  NBParam predefined types

                                                  NBParamProb types with p = invlink(f) the probability of success or failure

                                                  NBParamMean types with μ = invlink(f) the mean/expected number of events

                                                  • NBParamI: Mean is linked to f and variance is given by μ(1 + α)
                                                  • NBParamII: Mean is linked to f and variance is given by μ(1 + α * μ)
                                                  • NBParamPower: Mean is linked to f and variance is given by μ(1 + α * μ^ρ)

                                                  To create a new parametrization, you need to:

                                                  • create a new type struct MyNBParam{T} <: NBParam; myparams::T; end;
                                                  • dispatch (l::NegativeBinomialLikelihood{<:MyNBParam})(f::Real), which must return a NegativeBinomial from Distributions.jl.

                                                  NegativeBinomial follows the parametrization of NBParamSuccess, i.e. the first argument is the number of successes and the second argument is the probability of success.

                                                  Examples

                                                  julia> NegativeBinomialLikelihood(NBParamSuccess(10), logistic)(2.0)
                                                   NegativeBinomial{Float64}(r=10.0, p=0.8807970779778824)
                                                   julia> NegativeBinomialLikelihood(NBParamFailure(10), logistic)(2.0)
                                                  diff --git a/v0.4.7/index.html b/v0.4.7/index.html
                                                  index fdd0281..0609216 100644
                                                  --- a/v0.4.7/index.html
                                                  +++ b/v0.4.7/index.html
                                                  @@ -459,5 +459,6 @@
                                                       });
                                                   
                                                   
                                                  +
                                                   

                                                  GPLikelihoods

                                                  GPLikelihoods.jl provides a practical interface to connect Gaussian and non-conjugate likelihoods to Gaussian Processes. The API is very basic: Every AbstractLikelihood object is a functor taking a Real or an AbstractVector as an input and returning a Distribution from Distributions.jl.

                                                  Single-latent vs multi-latent likelihoods

                                                  Most likelihoods, like the GaussianLikelihood, only require one latent Gaussian process. Passing a Real will therefore return a UnivariateDistribution, and passing an AbstractVector{<:Real} will return a multivariate product of distributions.

                                                  julia> f = 2.0;
                                                  julia> GaussianLikelihood()(f) == Normal(2.0, 1e-3)true
                                                  julia> fs = [2.0, 3.0, 1.5];
                                                  julia> GaussianLikelihood()(fs) isa AbstractMvNormaltrue

                                                  Some likelihoods, like the CategoricalLikelihood, require multiple latent Gaussian processes, and an AbstractVector{<:Real} needs to be passed. To obtain a product of distributions an AbstractVector{<:AbstractVector{<:Real}} has to be passed (we recommend using ColVecs and RowVecs from KernelFunctions.jl if you need to transform an AbstractMatrix).

                                                  julia> fs = [2.0, 3.0, 4.5];
                                                  julia> CategoricalLikelihood()(fs) isa Categoricaltrue
                                                  julia> Fs = [rand(3) for _ in 1:4];
                                                  julia> CategoricalLikelihood()(Fs) isa Product{<:Any,<:Categorical}true

                                                  Constrained parameters

                                                  The function values f of the latent Gaussian process live in the real domain $\mathbb{R}$. For some likelihoods, the domain of the distribution parameter p that is modulated by the latent Gaussian process is constrained to some subset of $\mathbb{R}$, e.g. only positive values or values in an interval.

                                                  To connect these two domains, a transformation from f to p is required. For this, we provide the Link type, which can be passed to the likelihood constructors. (Alternatively, functions can also directly be passed and will be wrapped in a Link.)

                                                  We typically call this passed transformation the invlink. This comes from the statistics literature, where the "link" is defined as f = link(p), whereas here we need p = invlink(f).

                                                  For more details about which likelihoods require a Link check out their docs.

                                                  A classical example is the BernoulliLikelihood for classification, with the probability parameter $p \in [0, 1]$. The default is to use a logistic transformation, but one could also use the inverse of the probit link:

                                                  julia> f = 2.0;
                                                  julia> BernoulliLikelihood()(f) == Bernoulli(logistic(f))true
                                                  julia> BernoulliLikelihood(NormalCDFLink())(f) == Bernoulli(normcdf(f))true

                                                  Note that we passed the inverse of the probit function which is the normcdf function.

                                                  diff --git a/v0.4.7/search/index.html b/v0.4.7/search/index.html index 2799ea2..636e3f9 100644 --- a/v0.4.7/search/index.html +++ b/v0.4.7/search/index.html @@ -459,5 +459,6 @@ }); +

                                                  Loading search...