fit(idata,
fitting_fcns,
ff_info=None,
wt=None)
| source code
|
Fits data to a linear combination of fitting_fcns.
- Parameters:
fitting_fcns (an array of functions.) - the basis functions for the linear regression. The fitting
functions return vectors (which must match the data). Fitting
functions are called as f(info, ff_info, len(vector)). Vectors
may have different lengths, as long as the corresponding data and
fit vectors agree.
idata (an array of (vector, info).)
- Returns: tuple
- The returned value is a tuple of: the coefficients of the optimal
solution (as an array), the residual (a single float number), the
rank of the fit (int), an array of the singular values, and the
best fit to the data. The returned value follows
Num.LA.linear_least_squares(), except that residual is always
calculated and is a scalar.
|