Package BIP :: Package Bayes :: Package general :: Module Bayes :: Class _BayesVar
[hide private]
[frames] | no frames]

Class _BayesVar

source code

object --+
         |
        _BayesVar

Bayesian random variate.

Instance Methods [hide private]
 
__init__(self, disttype, pars, rang, resolution=1024)
Initializes random variable.
source code
 
_flavorize(self, pt, ptbase)
Add methods from distribution type
source code
 
_update(self)
Calculate likelihood function
source code
 
addData(self, data=[])
Adds dataset to variable's data store
source code
 
getPriorSample(self, n)
Returns a sample from the prior distribution
source code
 
getPriorDist(self)
Returns the prior PDF.
source code
 
getPosteriorSample(self, n)
Return a sample of the posterior distribution.
source code
 
_Likelihood(self, typ)
Defines parametric family of the likelihood function.
source code
 
_postFromConjugate(dname, *pars)
Returns posterior distribution function using conjugate prior theory
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, disttype, pars, rang, resolution=1024)
(Constructor)

source code 

Initializes random variable.

:parameters:

  • `disttype`: must be a valid RNG from scipy.stats
  • `pars`: are the parameters of the distribution.
  • `rang`: range of the variable support.
  • `resolution`: resolution of the support.
Overrides: object.__init__

getPriorSample(self, n)

source code 

Returns a sample from the prior distribution

:Parameters:

  • `n`: Sample size.

getPosteriorSample(self, n)

source code 

Return a sample of the posterior distribution. Uses SIR algorithm.

:Parameters:

  • `n`: Sample size.

_Likelihood(self, typ)

source code 

Defines parametric family of the likelihood function. Returns likelihood function.

:Parameters:

  • `typ`: must be a string.