dist

package
v1.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2022 License: MIT Imports: 3 Imported by: 6

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

View Source
var Bernoulli bernoulli
View Source
var Beta beta

Beta distribution, singleton instance

View Source
var Binomial binomial
View Source
var Cauchy cauchy

Cauchy distribution, singleton instance

View Source
var D d

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

View Source
var Exponential, Expon exponential

Exponential distribution, singleton instance (Expon is kept for backward compatibility)

View Source
var Gamma gamma

Gamma distribution, singleton instance

View Source
var Normal normal

Normal distribution, singleton instance

Functions

This section is empty.

Types

type Categorical added in v0.5.1

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) LogZ added in v1.0.7

func (dist Categorical) LogZ(alpha []float64) float64

LogZ computes the normalization constant.

func (Categorical) Logp added in v0.5.1

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

Logp computes log pmf of a single observation.

func (Categorical) Logps added in v0.5.1

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

Logps computes log pmf of a vector of observations.

func (Categorical) Observe added in v0.5.1

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) LogZ added in v1.0.7

func (dist Dirichlet) LogZ(alpha []float64) float64

LogZ computes the normalization constant.

func (Dirichlet) Logp

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

Logp computes log pdf of a single observation.

func (Dirichlet) Logps

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

Logps computes log pdf 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL