INNER CODE UNIT · Python
set
mszell/geospatialdatascience · unit11_mobilityindividual/stats_utils.py:214
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 )
{params}
_parameters_ -> List of elements of the Class "Parameter"
_y_ -> List of observations: [ y0, y1, ... ]