INNER CODE UNIT · Python
Parameter
mszell/geospatialdatascience · unit11_mobilityindividual/stats_utils.py:210
class Parameter:
def __init__(self, value):
self.value = value
def set(self, value):
self.value = value
def __call__(self):
return self.value
def LSfit(function, parameters, y, x):
"""
*** ATTENTION! ***
*** _x_ and _y_ MUST be NUMPY arrays !!! ***
*** and use NUMPY FUNCTIONS, e.g. np.exp() and not math.exp() ***
_function_ -> Used to calculate the sum of the squares:
min sum( (y - function(x, parameters))**2 )