Next: , Previous: , Up: Residual optimization   [Index]


2.13 Function LinearRegression

Function File: LinearRegression (F, y)
Function File: LinearRegression (F, y, w)
Function File: [p, e_var, r, p_var, fit_var] = LinearRegression (…)

general linear regression

determine the parameters p_j (j=1,2,...,m) such that the function f(x) = sum_(j=1,...,m) p_j*f_j(x) is the best fit to the given values y_i by f(x_i) for i=1,...,n, i.e. minimize sum_(i=1,...,n)(y_i-sum_(j=1,...,m) p_j*f_j(x_i))^2 with respect to p_j

parameters:

return values:

To estimate the variance of the difference between future y values and fitted y values use the sum of e_var and fit_var

Caution: do NOT request fit_var for large data sets, as a n by n matrix is generated

See also (octave)ols, (octave)gls, (octave)regress, leasqr, nonlin_curvefit, (octave)polyfit, wpolyfit, pronyfit.


Next: , Previous: , Up: Residual optimization   [Index]