Back to godoc.org
bitbucket.org/dtolpin/infergo/dist

package dist

v0.8.4
Latest Go to latest
Published: Apr 8, 2020 | License: MIT | Module: bitbucket.org/dtolpin/infergo

Overview

Package dist provides differentiatable distribution models. The package is automatically differentiated by deriv during build.

Index

Variables

var Beta beta

Beta distribution, singleton instance

var Cauchy cauchy

Cauchy distribution, singleton instance

var D d

D is a singletone variable of type d. General log-likelihood handling functions are dispatched on d.

var Expon expon

Exponential distribution, singleton instance

var Gamma gamma

Gamma distribution, singleton instance

var Normal normal

Normal distribution, singleton instance

type Categorical

type Categorical struct {
	N int // number of categories
}

Categorical distribution

var Cat Categorical

Categorical distribution, singleton instance; Observe cannot be called on this instance, but Logp and Logps can.

func (Categorical) Logp

func (dist Categorical) Logp(
	alpha []float64, y float64,
) float64

Logp computes logpdf of a single observation.

func (Categorical) Logps

func (dist Categorical) Logps(
	alpha []float64, y ...float64,
) float64

Logps computes logpdf of a vector of observations.

func (Categorical) Observe

func (dist Categorical) Observe(x []float64) float64

Observe implements the Model interface

type Dirichlet

type Dirichlet struct {
	N int // number of dimensions
}

Dirichlet distribution

var Dir Dirichlet

Dirichlet distribution, singleton instance; Observe cannot be called on this instance, but Logp and Logps can.

func (Dirichlet) Logp

func (dist Dirichlet) Logp(alpha []float64, y []float64) float64

Logp computes logpdf of a single observation.

func (Dirichlet) Logps

func (dist Dirichlet) Logps(alpha []float64, y ...[]float64) float64

Logps computes logpdf of a vector of observations.

func (Dirichlet) Observe

func (dist Dirichlet) Observe(x []float64) float64

Observe implements the Model interface. The parameters are alpha and observations, flattened.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier