Package mvpa :: Package clfs :: Module stats :: Class FixedDist
[hide private]
[frames] | no frames]

Class FixedDist

source code


Proxy/Adaptor class for SciPy distributions.

All distributions from SciPy's 'stats' module can be used with this class.

>>> import numpy as N
>>> from scipy import stats
>>> from mvpa.clfs.stats import FixedDist
>>>
>>> dist = FixedDist(stats.norm(loc=2, scale=4))
>>> dist.cdf(2)
array(0.5)
>>>
>>> dist.cdf(N.arange(5))
array([ 0.30853754,  0.40129367,  0.5       ,  0.59870633,  0.69146246])
>>>
>>> dist = FixedDist(stats.norm(loc=2, scale=4), tail='right')
>>> dist.cdf(N.arange(5))
array([ 0.69146246,  0.59870633,  0.5       ,  0.40129367,  0.30853754])
Instance Methods [hide private]
 
__init__(self, dist, **kwargs)
Cheap initialization.
source code
 
fit(self, measure, wdata, vdata=None)
Does nothing since the distribution is already fixed.
source code
 
cdf(self, x)
Return value of the cumulative distribution function at x.
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, dist, **kwargs)
(Constructor)

source code 
Cheap initialization.
Overrides: object.__init__

fit(self, measure, wdata, vdata=None)

source code 
Does nothing since the distribution is already fixed.
Overrides: Distribution.fit

cdf(self, x)

source code 
Return value of the cumulative distribution function at x.
Overrides: Distribution.cdf