Books and articles about SQL Rambler's Top100 —менить €зык на: –усский 26 May 2017 08:26:23


www.sql-ex.ru
Skip Navigation Links  

 

Print  Print version

Main page

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

Σ (ti*ti) = stt

Σ (yi*ti) = syt

Σ (ti) = st

Σ (yi) = sy

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)

Main page

Print  Print version


Usage of any materials of this site is possible
only under condition of mandatory allocation of the direct link to a site
http://www.sqlbooks.ru
on each page where used materials are placed.

 Main   Articles    Books 
–ейтинг@Mail.ru Rambler's Top100 Alt ”пражнени€ по SQL: обучение, тестирование, сертификаци€ по €зыку SQL Copyright c 2002-2006. All rights reserved.