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

Class FitNakaRushton

source code


Fit a Naka-Rushton function of the form:

yy = rMin + (rMax-rMin) * xx**n/(xx**n+c50**n)

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 [rMin, rMax, c50, n])

Note that this differs from most of the other functions in not using a value for the expected minimum. Rather, it fits this as one of the parameters of the model.

Instance Methods
 
__init__(self, xx, yy, sems=1.0, guess=None, display=1) source code
 
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
Method Details

__init__(self, xx, yy, sems=1.0, guess=None, display=1)
(Constructor)

source code 
Overrides: _baseFunctionFit.__init__

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)