Package psychopy :: Module data :: Class FitWeibull
[frames] | no frames]

Class FitWeibull

source code


Fit a Weibull function (either 2AFC or YN) of the form:

y = chance + (1.0-chance)*(1-exp( -(xx/alpha)**(beta) ))

and with inverse:

x = alpha * (-log((1.0-y)/(1-chance)))**(1.0/beta)

After fitting the function you can evaluate an array of x-values with fit.eval(x), retrieve the inverse of the function with fit.inverse(y) or retrieve the parameters from fit.params (a list with [alpha, beta])

Instance Methods
 
eval(self, xx=None, params=None)
Returns fitted yy for any given xx value(s).
source code
 
inverse(self, yy, params=None)
Returns fitted xx for any given yy value(s).
source code

Inherited from _baseFunctionFit: __init__

Method Details

eval(self, xx=None, params=None)

source code 

Returns fitted yy for any given xx value(s). Uses the original xx values (from which fit was calculated) if none given.

If params is specified this will override the current model params.

Overrides: _baseFunctionFit.eval
(inherited documentation)

inverse(self, yy, params=None)

source code 

Returns fitted xx for any given yy value(s).

If params is specified this will override the current model params.

Overrides: _baseFunctionFit.inverse
(inherited documentation)