EvaluatedDensity#

class cuqi.density.EvaluatedDensity(value, **kwargs)#

An evaluated density representing a constant number exposed through the logd method.

EvaluatedDensity is a density that has been evaluated for a particular value/observation of the underlying random variable. It simply returns the value of the log density function evaluated at that value. The density has a fixed dimension of 1 and cannot be conditioned on any parameters.

Parameters:

value (float) – The fixed scalar value of the log density function evaluated at the particular value of the underlying random variable. This value will be returned if the EvaluatedDensity is queried for its log density function.

__init__(value, **kwargs)#

Methods

__init__(value, **kwargs)

disable_FD()

Disable finite difference approximation for logd gradient.

enable_FD([epsilon])

Enable finite difference approximation for logd gradient.

get_parameter_names()

Returns the names of the parameters that the density can be evaluated at or conditioned on.

gradient(*args, **kwargs)

Returns the gradient of the log density at x.

logd(*args, **kwargs)

Evaluates the un-normalized log density function given a set of parameters.

Attributes

FD_enabled

Returns True if finite difference approximation of the logd gradient is enabled.

FD_epsilon

Spacing for the finite difference approximation of the logd gradient.

dim

name

Name of the random variable associated with the density.