ANALISIS DE REGRESION
LINEAL Y MULTIPLE
Docente:
Mercedes Aida Osorio Maza
mosorio@uni.edu.pe
2017 - I
TEORIA
TEMAS A DESARROLLAR
Anlisis de Regresin Lineal Simple;
Coeficiente de determinacin, Coeficiente
de correlacin.
Anlisis de Regresin Polinomial de 1er y
2do grado.
Regresin Lineal Mltiple.
Regresin Lineal Mltiple con 2 variables
independientes.
ANLISIS DE REGRESIN
Consiste en emplear mtodos estadsticos que determinen
matemticamente un modelo de la curva que ms se ajusta a
los datos.
Es decir: y= f (xi )
Donde:
y = variable dependiente
x = variable independiente
f = funcin
Para elegir la relacin funcional que ms se ajusta a los
datos lo 1ro que debemos hacer es el diagrama de
dispersin.
DIAGRAMA DE DISPERSIN
Es la grfica de los valores (xi , yi) este diagrama permite
visualizar la tendencia que siguen los puntos ya sea lineal,
exponencial, etc.
Otros diagramas de dispersin:
yi A Bx i i
Donde:
y i Variable dependiente
x i Variable indenpendiente
A, B Coeficient es
i Error
Si tenemos un diagrama de dispersin lineal y si asumimos
un modelo de estimacin de la forma:
Tendremos:
yi a bx i
yi a bx i (Modelo Muestral)
i
yi A Bx i (Modelo Poblaciona l)
i2 yi yi min.
2
Es decir:
n
y1 y1 y 2 y 2 ..................yi yi yi yi
2 2 2 2 2
i
i 1
i2 i2
0 0 Ecuaciones Normales
a b
Obtenemos las Ecuaciones Normales:
n n
y
i 1
i na b x i
i 1
2 da Ecuacin Normal
n n n
x y
i 1
i i a x i b x 0
i 1 i 1
2
i
2.- ANLISIS DE REGRESIN EXPONENCIAL
y ab x
y* a * b * x
La estimacin de a* y b* se halla igual que la regresin
lineal simple de las ecuaciones:
y* na * b * x i
2
Ecuaciones normales
xy* a * x b * x
i i
i
y *
na * b * i
x *
i i
x * *
y a * i i
x b x *2
COEFICIENTE DE DETERMINACIN (r2)
y - y
2
r 2
i
y i - y
2
y i Valor observado
y i Valor estimado en base al modelo y i a bx i
Grficamente:
Se sabe:
y i Valor Observado
y i Valor Estimado
yi - y Desviacin yi con respecto al promedio y.
yi - y desviacin de yi con respecto al promedio y.
i yi yi
Luego:
iy - y 2
iy - y 2
i
2
.
yi Bo B1x B2 x 2 B3 x 3 .................. i
Bo , B1 , B2 ,..............., etc.
i 1
2
i min
Luego:
i2
0
Bo
B0 n B1 x B2 x 2 ................ y
B0 x B1 x B2 x .......... yx Ecuaciones Normales
2 3
2
B0 x B1 x B2 x ........ yx
2 3 4
(As sucesivamente)
4.1) REGRESIN POLINOMIAL (2do Grado)
Grficamente:
B0 n B1 x B2 x 2 y Los estimadores
B0 x B1 x B2 x yx B0 , B1 , B2 se hallan
2 3
B0 x 2 B1 x 3 B2 x 4 yx2 de las Ecuaciones Normales
Del modelo:
yi Bo B1x i B2 x i2 i
Matricialmente ser:
y i xB i
y i y i i
Luego:
Ejemplo (n = 4)
y1 1 x1 x12 i
y 2
B0
2 1 x2 x 2 i
2
B1
y 3 1 x3 x3 i
B2
2
y 4 1 x4 x 4 i
Para poder hallar los parmetros, aplicamos el mtodo de los
mnimos cuadrados.
12 y xB y xB
0 0
Bi Bi
xx B xy NOTA : Si
B xx xy yi xB i i yi xB
1
n
xi i
x 2
x x x i
i
x 2
i
x 3
x i2 i
x 3
i
x 4
yi
x y xi yi
xi2 yi
B 0
B xx xy B1
1
B 2
yi xB y/o yi Bo B1x i B2 x i2
5.- ANLISIS DE REGRESIN
LINEAL MULTIPLE
Sean x1, x2, ..................., xP, p variables independientes, y
una variable aleatoria que depende de las k variables
independientes.
El mtodo matemtico de regresin lineal mltiple es:
i min.
2
Si:
yi B0 B1x1 B2 x 2 ........Bp x p
n n n
Q i yi yi
2 2
i 1 i 1 i 1
Luego:
Q
0.
Bk
Nos dar estimadores mnimos cuadrados
Q Q
0, 0,..................
B1 B2
5.1) REGRESIN LINEAL MULTIPLE
(2 Variables Independientes)
Si:
Q 2I yi yi yi B0 B1x1 B2 x 2
n n n
2 2
i 1 i 1 i 1
nB0 B1 x1 B2 x 2 yi
B0 x1 B1 x12 B2 x1x 2 x1 yi
B0 x 2 B1 x1x 2 B2 x 22 x 2 yi
Expresando matricialmente :
yi xB i i
Ejemplo (n = 4)
y1 1 x11 x 21 1
y 1 B0
2 x12 x 22 2
B1
y 3 1 x13 x 23 3
B2
y 4 1 x14 x 24 4
Luego:
y1 B0 B1x11 B 2 x 21 1
y 2 B0 B1x12 B2 x 22 2
y 3 B0 B1x13 B 2 x 23 3
y 4 B0 B1x14 B 2 x 24 4
Los valores de B i se hallan de:
i2
Bi
i2
y xB y xB
0
Bi Bi
Luego:
xx B xy
B xx xy
1
Hallamos(xx)
1 x11 x 221
1 1 1 1
x 222
x x11 x14 1 x12
x12 x13 x
1 x13 x 223
x 221 x 2
22 x 2
23 x 224 2
1 x14 x 24
Luego: n n
n x 1i x 2i
n i 1
n n
i 1
xx x1i 1i
x 2
x x
1i 2i
i 1 i 1 i 1
n n n
x 2i x x x 2i
i 1
1i 2i
i 1 i 1
y1
1 1 1 1 y
x x11 x12 x13 x14 y 2
y3
x 221 x 222 x 223 x 224
y4
Luego:
yi
x y x1i y i
x 22i y i
Entonces:
Bi
xx xy
1
Matriz Inversa.
(Metodo Gauss - Jordan y / o cofactores)
y i y 2
2
ry.12 i 1
n
y
i 1
i y 2
4.5
3.5
3 Series1
y = 191.2e-1386x
LN(P)
Lineal (Series1)
R = 0.879
Polinmica (Series1)
2.5 Exponencial (Series1)
y = -3631.x + 14.04
R = 0.940
2
1.5
y = -5E+12x 4 + 5E+10x 3 - 2E+08x 2 + 45703x - 321.3
R = 0.941
1
0.0026 0.0027 0.0028 0.0029 0.003 0.0031 0.0032 0.0033 0.0034 0.0035 0.0036
1/T
DIAGRAMA DE DISPERSIN CUADRATICA
8
7 7
5 5
4
Presin(P)
3 3
y = 0.000x3 - 0.114x2 + 39.08x - 4444.
R = 0.998
2
y = 0.004x2 - 3.196x + 546.3 1.8
R = 0.975
1 1.1
Series1
0.7
0.4
Polinmica (Series1)
0.15 0.17 0.2
0 0 Polinmica (Series1)
325 335 345 355 365 375 385
-1
Temperatura(T)
VIDEO INTRODUCTORIO DE ANLISIS DE
REGRESIN LINEAL Y MLTIPLE
VIDEO DE RESOLUCIN DE EJERCICIOS DE
ANLISIS DE REGRESIN LINEAL Y
MLTIPLE