altar.distributions.Base

Module Contents

Classes

class altar.distributions.Base.Base(name, locator, **kwds)

Bases: altar.component

The base class for probability distributions

parameters
doc = the number of model parameters that belong to me
offset
doc = the starting point of my parameters in the overall model state
pdf
abstract initialize(self, rng)

Initialize with the given random number generator

initializeSample(self, theta)

Fill my portion of {theta} with initial random values from my distribution.

priorLikelihood(self, theta, likelihood)

Fill my portion of {likelihood} with the likelihoods of the samples in {theta}

abstract verify(self, theta, mask)

Check whether my portion of the samples in {theta} are consistent with my constraints, and update {mask}, a vector with zeroes for valid samples and non-zero for invalid ones

sample(self)

Sample the distribution using a random number generator

density(self, x)

Compute the probability density of the distribution at {x}

vector(self, vector)

Fill {vector} with random values

matrix(self, matrix)

Fill {matrix} with random values

restrict(self, theta)

Return my portion of the {theta}