Distributions

Sampling Distribution

This is a distribution that is used in Monte Carlo sampling, so it (with all statistics) will be approximated by sample points from Markov chain obtained by MCMC algorithms. There is only one requirement which must be satisfied: it must be possible to calculate the density of such distribution at any point.

Tabela 9.13. SamplingDistribution methods

Method name and syntax Description of parameters Output Output type
pdf(x)
x - the point in which to calculate the density function (double[]). the value of probability density function at the specified point double
dim()
  dimension of the distributionint

Standard Multivariate Distribution

StandardMultivariateDistribution is an adaptor for any MultivariateDistribution object, which allows any multiavariate distribution from DistributionLibrary to be sampled by MCMC algorithms.

The constructor has the following syntax:

StandardMultivariateDistribution(distribution)

where distribution is a MultivariateDistribution object.

The methods are the same as in case of MultivariateDistribution.

Likelihood function

The likelihood function is the conditional probability function considered as a function of parameters and , where is the observed outcome of an experiment. In other words, when is viewed as a function of with fixed , it is a probability density function. On the other hand, when it viewed as a function of with fixed (i.e. it refers to past events with known outcomes), it is a likelihood function.

LogLikelihood

LogLikelihood is the ancestor of likelihood classes. It is defined in the likelihood module of the AdvancedMiner system.

Tabela 9.14. LogLikelihood methods

Method name and syntax Description of parameters Output Output type
getLog()
 the likelihood value in logarithmic formdouble
getParameters()
  the values of parameters for which the likelihood is calculated double[]
setParameters(theta)theta - an array of parameters for which the likelihood should be calculated (double[])  void
getDim()
  the dimension of the likelihood, i.e. the number of parameters. int

LogitLogLikelihood

The cosntructor has the following syntax:

LogitLogLikelihood(x, y, theta)

Tabela 9.15. LogitLogLikelihood constructor settings

Parameter nameParameter typeDescription
xdouble[][] a two dimesional array of observations: the 1st. dimension is the number of obervation, the 2nd. dimenion is the number of attribute
ydouble[]an array of targets, containing either the values of 1 or 0
thetadouble[] an array containing the likelihood coefficients.

The method for LogitLogLikelihood are the same as for LogLikelihood. In particular the method getLog() works as a logit function and the value it returns is calculated as

Helper distributions

Sampling Likelihood Distribution

SamplingLikelihoodDistribution is an adapter which allows any likelihood function to be treated as a sampling distributions and used in Monte Carlo algorithms. It is used in BayesianInterference for likelihood sampling to obtain the posterior distribution.

The constructor has the following syntax:

SamplingLikelihoodDistribution(likelihood[, log])                
                    

Tabela 9.16. SamplingLikelihoodDistribution constructor settings

Parameter nameParameter typeDescription
likelihoodLogLikelihood object the likelihood function which has to be sampled
logboolean specifies whether the pdf() should return likelihood (false, default) or loglikelihood (true) values.

SamplingLikelihoodDistribution methods are the same as in the case of SamplingDistribution.

Sampling Posterior Distribution

The density of the posterior distribution is calculated as the product of likelihood and prior density:

The constructor hast the following syntax:

SamplingPosteriorDistribution(likelihood, prior[, log])                        
                    

Tabela 9.17. SamplingPosteriorDistribution constructor settings

Parameter nameParameter typeDescription
likelihood a LogLikelihood object the likelihood function
prior a MultivariateDistribution object the a-priori distribution
logboolean specifies whether the pdf() should return the a-posteriori density in normal (false, default) or logarithmic (true) form.

SamplingPosteriorDistribution methods are the same as in the case of SamplingDistribution.

Distribution from Markov Chain

This class transforms the samples from a Markov chain (or a number of Markov chains) into a regular multivariate distribution.

The constructor hast the following syntax:

DistributionFromMarkovChain(chains)                        
                    

where chains is a MarkovChain object or an array of MarkovChain objects (i.e. MarkovChain[]).

On addition to methods inherited from MultivariateDistribution, DistributionFromMarkovChain hast the following methods:

Tabela 9.18. DistributionFromMarkovChain methods

Method name and syntax Description of parameters Output Output type
marginalDistribution(pos)
pos - the position for which the marginal distribution should be returned (int) the marginal distribution for the specified attribute UnivariateDistribution