Lineární regrese dvou proměnných metodou nejmenších čtverců

Lineární funkce dvou proměnných s konstantním členem.

z = a x + b y + c i = 1 n ( z i ( a x i + b y i + c ) ) 2 = ! min . a i = 1 n x i 2 + b i = 1 n x i y i + c i = 1 n x i = i = 1 n x i z i a i = 1 n x i y i + b i = 1 n y i 2 + c i = 1 n y i = i = 1 n y i z i a i = 1 n x i + b i = 1 n y i 2 + cn = i = 1 n z i | i = 1 n x i 2 i = 1 n x i y i i = 1 n x i i = 1 n x i y i i = 1 n y i 2 i = 1 n y i i = 1 n x i i = 1 n y i n | | a b c | = | i = 1 n z i x i i = 1 n z i y i i = 1 n z i | z=a cdot x + b cdot y + c newline drarrow newline sum from{i=1} to{n} (z_i-(a cdot x_i + b cdot y_i+c))^2=csup{!} `min. newline drarrow newline a sum from{i=1} to{n} x_i^2 + b sum from{i=1} to{n} x_i y_i+ c sum from{i=1} to{n} x_i= sum from{i=1} to{n} x_i z_i newline a sum from{i=1} to{n} x_i y_i + b sum from{i=1} to{n} y_i^2+ c sum from{i=1} to{n} y_i= sum from{i=1} to{n} y_i z_i newline a sum from{i=1} to{n} x_i + b sum from{i=1} to{n} y_i^2+ cn= sum from{i=1} to{n} z_i newline drarrow newline left lline matrix{ sum from{i=1} to{n} x_i^2 # sum from{i=1} to{n} x_i cdot y_i # sum from{i=1} to{n} x_i ## sum from{i=1} to{n} x_i cdot y_i # sum from{i=1} to{n} y_i^2 # sum from{i=1} to{n} y_i ## sum from{i=1} to{n} x_i # sum from{i=1} to{n} y_i # n }right rline cdot left lline stack{a#b#c} right rline = left lline stack{sum from{i=1} to{n} {z_i cdot x_i}#sum from{i=1} to{n} {z_i cdot y_i}#sum from{i=1} to{n} z_i} right rline

Lineární funkce dvou proměnných s konstantním členem rovným nule

z = a x + b y i = 1 n ( z i ( a x i + b y i ) ) 2 = ! min . | i = 1 n x i 2 i = 1 n x i y i i = 1 n x i y i i = 1 n y i 2 | | a b | = | i = 1 n z i x i i = 1 n z i y i | z=a cdot x + b cdot y newline drarrow newline sum from{i=1} to{n} {(z_i-(a cdot x_i + b cdot y_i))^2}` = csup{!} `min. newline drarrow newline left lline matrix{ sum from{i=1} to{n} {x_i^2} # sum from{i=1} to{n} {x_i cdot y_i} ## sum from{i=1} to{n} {x_i cdot y_i} # sum from{i=1} to{n} {y_i^2}} right rline cdot left lline binom{a}{b} right rline = left lline binom{sum from{i=1} to{n} {z_i cdot x_i}}{sum from{i=1} to{n} {z_i cdot y_i}} right rline


Kontakt

Ing. Pavel Rybka

Doubek 11
Doubek
251 01


+420-607 482 089