loading..
Русский    English
07:42

Least-square method

Let us have the set of values yi, every one of which corresponds to any moment of time ti (i = 1, 2,…, N). We need to find dependency y = f(t) if the sum of squared divergences of points of curve from the appropriate point yi is the minimal in the class of approximating functions. That is

(1)  Σ(f(ti) - yi)2 à min

We will find the solution in the class of the linear functions (straight lines): y = at + b. Then the term (1) we can write as the following

Σ(a*ti +b - yi)2 à min

The necessary condition of the existence of minimum is the equality to zero of two partial derivatives on a and b accordingly:

Σ((a*ti +b - yi)*ti) =0

Σ(a*ti +b - yi) = 0

In designations

Σti2 = stt 

Σ(yi*ti) = syt

Σ(ti) = st

Σ(yi) = sy

Σb = bN               

the system can be rewritten as the following

a*stt + b*st - syt = 0

a*st +b*N - sy = 0

Solving this system of two linear equations for a and b we will get

a = (syt*N - sy*st)/(N*stt - st*st)

b = (stt*sy - syt*st)/(N*stt - st*st)

Bookmark and Share
Tags
aggregate functions Airport ALL AND AS keyword ASCII AVG Battles Bezhaev Bismarck C.J.Date calculated columns Cartesian product CASE cast CHAR CHARINDEX Chebykin check constraint classes COALESCE common table expressions comparison predicates Computer firm CONSTRAINT CONVERT correlated subqueries COUNT CROSS APPLY CTE data type conversion data types database schema DATEADD DATEDIFF DATENAME DATEPART DATETIME date_time functions DDL DEFAULT DEFAULT VALUES DELETE DISTINCT DML duplicates edge equi-join EXCEPT exercise (-2) More tags
The book was updated
month ago
©SQL-EX,2008 [Evolution] [Feedback] [About] [Links] [Team]
All right reserved.