Anda di halaman 1dari 16

REGRESI

CHOIRUL ANAM
DEFINISI
Regresi adalah teknik untuk mendapatkan
fungsi yang dapat mewakili atau menyatakan
pola tertentu.
Karena fungsi yang diperoleh adalah fungsi
pendekatan, maka dapat dikatakan bahwa
regresi adalah suatu teknik untuk memperoleh
fungsi pendekatan yang jaraknya paling kecil
pada semua data.
0
2
4
6
8
10
12
0 2 4 6 8 10 12
Data asli
Regresi
Metode Least Square
Bila terdapat (xi,yi) maka regresi akan menghasilkan fungsi
y=f(x)
Jarak antara kuadrat antara fungsi pendekatan dengan titik
data untuk titik x yang sama:



Untuk memperoleh jarak terkecil digunakan teknik diferensial.
Yaitu terjadi pada :


ak adalah parameter dari fungsi pendekatan
( )

=
=
n
i
i i
y y S
1
2
0 =
c
c
k
a
S
REGRESI LINIER
Regresi linier merupakan suatu teknik regresi
dengan suatu fungsi pendekatan linier
Dengan regresi linier akan diperoleh fungsi
linier
b ax y + =
Berdasarkan Metode Least Square, dengan
jarak


Dengan a dan b adalah parameter fungsi linier,
maka
( )

=
=
n
i
i i
b ax y S
1
2
0 dan 0 =
c
c
=
c
c
b
S
a
S


= =
= = =
= +
= +
n
i
n
i
i i
n
i
n
i
n
i
i i i i
y nb x a
y x x b x a
1 1
1 1 1
2
dan
Secara
matriks
(
(
(
(

=
(

(
(
(
(


=
=
=
= =
n
i
i
n
i
i i
n
i
i
n
i
i
n
i
i
y
y x
b
a
b x
x x
1
1
1
1 1
2
Dengan aturan Cramer


= =
= = =
=
= =
=
= =
|
.
|

\
|

=
(
(
(
(

(
(
(
(

=
n
i
n
i
i i
n
i
n
i
i i
n
i
i i
n
i
i
n
i
i
n
i
i
n
i
i
n
i
i
n
i
i i
x x n
y x y x n
n x
x x
n y
x y x
a
1
2
1
2
1 1 1
1
1 1
2
1
1 1




= =
= = = =
=
= =
= =
= =
|
.
|

\
|

=
(
(
(
(

(
(
(
(

=
n
i
n
i
i i
n
i
n
i
i i i
n
i
i
n
i
i
n
i
i
n
i
i
n
i
i
n
i
i
n
i
i
n
i
i i
n
i
i
x x n
x y x y x
n x
x x
y x
y x x
b
1
2
1
2
1 1 1 1
2
1
1 1
2
1 1
1 1
2
( )
( )

= = =
= = =
=
=
= +
= + +
=
= |
.
|

\
|

c
c
=
c
c
n
i
n
i
n
i
i i i i
n
i
n
i
n
i
i i i i
n
i
i i i
n
i
i i
y x x b x a
x b x a y x
b ax y x
b ax y
a
a
S
1 1 1
2
1 1 1
2
1
1
2
0
0 2
0
0
( )
( )

= =
= = =
=
=
= +
= + +
=
= |
.
|

\
|

c
c
=
c
c
n
i
n
i
i i
n
i
n
i
n
i
i i i
n
i
i i
n
i
i i
y nb x a
b x a y
b ax y
b ax y
b
b
S
1 1
1 1 1
1
1
2
0
0 2
0
0
Contoh
X 1 2 3 4 5 6 7 8 9 10
Y 0 2 1 4 5 4 6 8 8 10
933 , 0
) 55 ( ) 385 )( 10 (
) 55 )( 350 ( ) 48 )( 385 (
) (
) )( (
042 , 1
) 55 ( ) 385 )( 10 (
) 48 )( 55 ( ) 350 )( 10 (
) (
) )( (
350 100 72 64 42 24 25 16 3 4 0
385 100 81 64 49 36 25 16 9 4 1
48 10 8 8 6 4 5 4 1 2 0
55
2
1 1
2
2
1 1 1 1
2
2
1 1
2
2
1 1 1
1
1
2
1
1
=

=
=

=
= + + + + + + + + + =
= + + + + + + + + + =
= + + + + + + + + + =
=



= =
= = = =
= =
= = =
=
=
=
=
n
i
n
i
i i
n
i
n
i
i
n
i
i i i
n
i
i
n
i
n
i
i i
n
i
n
i
i
n
i
i i i
n
i
i i
n
i
i
n
i
i
n
i
i
x x n
x y x y x
b
x x n
y x y x n
a
maka
y x
x
y
x
933 , 0 042 , 1 = x y
0
2
4
6
8
10
12
0 2 4 6 8 10 12
Data asli
Regresi
933 , 0 042 , 1 = x y
X 1 2 3 4 5 6 7 8 9 10
Y 0 2 1 4 5 4 6 8 8 10
REGRESI POLINOMIAL
Regresi polinomial adalah suatu bentuk
regresi dengan fungsi pendekatan berupa
fungsi polinomial sebagai berikut:
0 1
2
2
1
1
.... ) ( a x a x a x a x a x f
m
m
m
m
+ + + + + =

Metode Least Square:


(
(
(
(
(
(
(
(
(
(
(
(
(

=
(
(
(
(
(
(
(
(

(
(
(
(
(
(
(
(
(
(
(
(
(






=
=
=
=

= = =

=
= = = = =
+
= = = =
+
=
+
=

= =
+
=

= =
+
=
+
=

=
n
i
i
n
i
i i
n
i
i i
n
i
i
m
i
n
i
i
m
i
m
m
n
i
i
n
i
i
n
i
m
i
n
i
m
i
n
i
i
n
i
i
n
i
i
n
i
m
i
n
i
m
i
n
i
i
n
i
i
n
i
i
n
i
m
i
n
i
m
i
n
i
m
i
n
i
m
i
n
i
m
i
n
i
m
i
n
i
m
i
n
i
m
i
n
i
m
i
n
i
m
i
n
i
m
i
n
i
m
i
y
y x
y x
y x
y x
a
a
a
a
a
n x x x x
x x x x x
x x x x x
x x x x x
x x x x x
1
1
1
1
2
1
1
1
0
1
2
1
1 1
2
1
1
1
1 1
2
1
3
1 1
1
1
2
1
3
1
4
1
1
1
2
1
1
1 1
1
1
2 2
1
1 2
1 1
1
1
2
1
1 2
1
2
...
...
...
...
...
... ... ... ... ... ...
...
...
Jika m=1
(
(
(
(

=
(

(
(
(
(


=
=
=
= =
n
i
i
n
i
i i
n
i
i
n
i
i
n
i
i
y
y x
a
a
n x
x x
1
1
0
1
1
1 1
2
0 1
) ( a x a x f + =
Fungsi pendekatan
Jika m=2
(
(
(
(
(
(
(

=
(
(
(

(
(
(
(
(
(
(




=
=
=
= =
= = =
= = =
n
i
i
n
i
i i
n
i
i i
n
i
i
n
i
i
n
i
i
n
i
i
n
i
i
n
i
i
n
i
i
n
i
i
y
y x
y x
a
a
a
n x x
x x x
x x x
1
1
1
2
0
1
2
1 1
2
1 1
2
1
3
1
2
1
3
1
4
0 1
2
2
) ( a x a x a x f + + =
Fungsi pendekatan
Contoh
X 1 2 3 4 5 6 7 8
Y 4 2 0 1 3 4 6 10

=
=
=
=
=
=
=
1181
173
8772
1296
204
30
36
2
4
3
2
y x
xy
x
x
x
y
x
06 , 0 998 , 1 52 , 4
2 1 0
= = = a a a
(
(
(

=
(
(
(

(
(
(

30
173
1181
8 36 204
36 204 1296
204 1296 8772
0
1
2
a
a
a
52 , 4 998 , 1 06 , 0
2
+ = x x y
TERIMA KASIH

Anda mungkin juga menyukai