Пример #1
0
 def residual(self, allvalues, data, coords):
     '''Find residual as sum of squared differences of function and data
     
     Arguments:
     allvalues -- boolean, currently ignored 
     data      -- used to subtract from evaluated function
     coords    -- coordinates over which the function is evaluated
     '''
     return _dnp.residual(self.makeDataset(coords), data)
Пример #2
0
 def residual(self, allvalues, data, weights, coords):
     '''Find residual as sum of squared differences of function and data
     
     Arguments:
     allvalues -- boolean, currently ignored 
     data      -- used to subtract from evaluated function
     weights   -- weighting for each squared difference, can be None
     coords    -- coordinates over which the function is evaluated
     '''
     if len(coords) == 0:  # workaround deprecated method
         coords = (weights, )
         weights = None
     return _dnp.residual(self.calculateValues(coords), data, weights)
Пример #3
0
 def residual(self, allvalues, data, weights, coords):
     '''Find residual as sum of squared differences of function and data
     
     Arguments:
     allvalues -- boolean, currently ignored 
     data      -- used to subtract from evaluated function
     weights   -- weighting for each squared difference, can be None
     coords    -- coordinates over which the function is evaluated
     '''
     if len(coords) == 0: # workaround deprecated method
         coords = (weights,)
         weights = None
     return _dnp.residual(self.calculateValues(coords), data, weights)
Пример #4
0
 def residual(self, allvalues, data, coords):
     '''Find residual as sum of squared differences of function and data
     
     Arguments:
     allvalues -- boolean, currently ignored 
     data      -- used to subtract from evaluated function
     coords    -- coordinates over which the function is evaluated
     '''
     try:
         l = [ p for p in self.parameterValues ]
         l.append([ _dnp.Sciwrap(c) for c in coords])
         l.append(self.args)
         d = self.func(*l)
         return _dnp.residual(d, data)
     except ValueError:
         raise ValueError, 'Problem with function \"' + self.name + '\" with params  ' + self.parameterValues
Пример #5
0
 def residual(self, allvalues, data, weights, *coords):
     '''Find residual as sum of squared differences of function and data
     
     Arguments:
     allvalues -- boolean, currently ignored
     data      -- used to subtract from evaluated function
     weights   -- weighting for each squared difference, can be None
     coords    -- coordinates over which the function is evaluated
     '''
     if len(coords) == 0:  # workaround deprecated method
         coords = (weights, )
         weights = None
     try:
         l = [p for p in self.parameterValues]
         l.append([_sciwrap(c) for c in coords])
         l.append(self.args)
         d = self.func(*l)
         return _dnp.residual(d, data, weights)
     except ValueError:
         raise ValueError, "Problem with function '" + self.name + "' with params  " + self.parameterValues
Пример #6
0
 def residual(self, allvalues, data, weights, *coords):
     '''Find residual as sum of squared differences of function and data
     
     Arguments:
     allvalues -- boolean, currently ignored
     data      -- used to subtract from evaluated function
     weights   -- weighting for each squared difference, can be None
     coords    -- coordinates over which the function is evaluated
     '''
     if len(coords) == 0: # workaround deprecated method
         coords = (weights,)
         weights = None
     try:
         l = [p for p in self.parameterValues]
         l.append([_sciwrap(c) for c in coords])
         l.append(self.args)
         d = self.func(*l)
         return _dnp.residual(d, data, weights)
     except ValueError:
         raise ValueError("Problem with function '" + self.name + "' with params  " + self.parameterValues)