JENIS-JENIS DATA
Diskrit Kontinyu
Hasil Eksperimen Fungsi analitik
Perhitungan
DARI KONTINYU KE DISKRIT
DARI DISKRIT KE KONTINYU
regresi
INTERPOLASI
Seringkali kita
menginginkan mengetahui
nilai antara x1 dan x2, atau
x2 dan x3.
Perlu buat suatu fungsi..
Bagaimana agar fungsi
tersebut mendekati
kebenaran.
Titik-titik data dapat
dihubungkan dengan sekian
banyak fungsi.
2. Mendapatkan koefisien
INTERPOLASI POLINOMIAL
p(x)=a0+a1x+a2x2+a3x3+…+anxn
Polinom yg menginterpolasi
Kedua titik itu adalah garis
lurus yg berbentuk:
p ( x ) a0 a 1 x
a0 y0 a1 x0
a0 y1 a1 x1
y0 a1 x0 y1 a1 x1 y1 y0
a0 y1 ( ) x1
x1 x0
y1 y0
a1
x1 x0 y1 y0
a0 y0 ( ) x0
x1 x0
p ( x ) a0 a 1 x
y1 y0 y y0
p ( x ) y0 ( ) x0 ( 1 ) x
x1 x0 x1 x0
( x x0 )( y1 y0 )
y0
x1 x0
CONTOH SOAL:
Penduduk Amerika pada tahun :
1960 sebesar 180 juta
p ( x) f
x x x x
j 1
f
x x x x
j 2 j j2
2
x x x x
j
j j 1 x x x x
j j 1
j 1
j 1 j j j 1
f
x x x x
j j 1
x x x x
j 2
j 2 j j2 j 1
a0 a1 x0 a x y0 2
2 0
a0 a1 x1 a x y1 2
2 1
a0 a1 x2 a x y2 2
2 2
a0 8 a1 64 a2 2.0794
a0 9 a1 81 a2 2.1972
a0 9.5 a1 90.25 a2 2.2513
Dengan eliminasi gaus didapat :
a0 0.6762 , a1 0.2266 , a2 0.00064
p2 ( x) a0 a1 x a2 x 2
p2 ( x) 0.6762 0.2266 x 0.00064 x 2
p2 (9.2) 2.2192
INTERPOLASI CUBIC
a0 a1 x0 a x a x y0
2
2 0
3
3 0
a0 a1 x1 a x a x y1
2
2 1
3
3 1
a0 a1 x2 a x a x y2
2
2 2
3
3 2
( x x1 ) ( x x0 )
L0 ( x) , dan L1 ( x)
( x0 x1 ) ( x1 x0 )
n
pn ( x) yi Li ( x) y0 L0 ( x) y1 L1 ( x) ... yn Ln ( x)
i 0
Bentuk umum derajat n
n (x x j )
Li ( x)
j 0
j i
( xi x j )
n (x x j )
Li ( x)
j 0
j i
( xi x j )
karena polinom melewati semua data, maka suku di mana x x j
maka suku tersebut :
(x j x j )
, bila i j , maka suku ini bernilai 0
( xi x j )
(x j x j ) ( xi x j )
jika i j 1
( xi x j ) ( xi x j )
n
p ( x) yi Li ( x) y0 L0 ( x) y1 L1 ( x ) ... yn Ln ( x)
i 0
sehingga
p ( x0 ) y0 L0 ( x0 ) y1 L1 ( x0 ) ... yn Ln ( x0 )
y0 1 y1 0 ... yn 0
y0
p ( x1 ) y1 Dengan kata lain, polinom interpolasi melewati setiap titik
data
p ( xn ) y n
CONTOH
Hampiri fungsi f(x)=cos x dengan polinom lagrange
sampai derajat 3.
n (x x j )
Li ( x )
j 0
j i
( xi x j )
( x x1 ) ( x x2 ) ( x x3 ) ( x x0 ) ( x x2 ) ( x x3 )
p3 ( x) y0 y1
( x0 x1 ) ( x0 x2 ) ( x0 x3 ) ( x1 x0 ) ( x1 x2 ) ( x1 x3 )
( x x0 ) ( x x1 ) ( x x3 ) ( x x0 ) ( x x1 ) ( x x2 )
y2 y3
( x2 x0 ) ( x2 x1 ) ( x2 x3 ) ( x3 x0 ) ( x3 x1 ) ( x3 x2 )
p3 (0.5) 0.877221
sedangkan cos(0.5) 0.877583
POLINOM NEWTON
( y1 y0 )
p ( x ) y0 ( x x0 )
( x1 x0 )
p1 ( x ) a0 a1 ( x x0 )
a0 y0 f ( x0 )
y1 y0
a1
x1 x0
p2 ( x) a0 a1 ( x x0 ) a2 ( x x0 )( x x1 )
atau
p2 ( x) p1 ( x) a2 ( x x0 )( x x1 )
p3 ( x) a0 a1 ( x x0 ) a2 ( x x0 )( x x1 ) a3 ( x x0 )( x x1 )( x x2 )
atau
p3 ( x) p2 ( x) a3 ( x x0 )( x x1 )( x x2 )
pn ( x) pn 1 ( x) an ( x x0 )( x x1 )...( x xn 1 )
dengan nilai
a0 f ( x0 )
f ( xi ) f ( x j )
a1 f [ x1 , x0 ] f [ xi , x j ]
xi x j
f [ xi , x j ] f [ x j , xk ]
a2 f [ x2 , x1 , x0 ] f [ xi , x j , xk ]
xi xk
f [ xn , xn 1,..., x1 ] f [ xn 1 , xn 2,..., x0 ]
an f [ xn , xn 1,..., x0 ]
xn x0
CONTOH:
Dapatkan polinomial newton yg menginterpolasi titik-
titik (2,2), (3,1), dan (5,2)
POLINOM NEWTON GREGORY
Kasus khusus dari polinom Newton di mana titik-titik berjarak sama
Bentuk umum: n f ( x0 ) n f 0
f xn ,..., x1 , x0 n
n!h n!h n
Polinomialnya:
f 0 2 f 0 n f 0
Pn ( x) f ( x0 ) ( x x0 ) ( x x0 )( x x1 ) ... ( x x0 )( x x1 )...(x xn 1 )
1!h 2!h 2 n!h n
Nilai x yg diinterpolasikan : x x0
x x0 sh , s
h
f 0 2 f0
2
n f0
n
Pn ( x) f ( x0 ) sh s ( s 1)h ... s ( s 1)( s 2)...( s n 1)h
1!h 2!h 2 n!h n
f 0 2 f 0 n f 0
Pn ( x) f ( x0 ) s s( s 1) ... s ( s 1)( s 2)...( s n 1)
1! 2! n!
POLINOM NEWTON GREGORY
CONTOH SOAL
Dari tabel di bawah perkirakan harga f(1.83) dengan
polinomial Newton Gregory derajat 4
i 0 1 2 3 4
xi 1.0 3.0 5.0 7.0 9.0
fi 0 1.0986 1.6094 1.9459 2.1972
i 0 1 2 3 4
xi 1.0 3.0 5.0 7.0 9.0
fi 0 1.0986 1.6094 1.9459 2.1972
f 0 2 f0
2
n f0
n
Pn ( x) f ( x0 ) sh s ( s 1)h ... s ( s 1)( s 2)...( s n 1)h
1!h 2!h 2 n!h n
f 0 2 f 0 n f 0
Pn ( x) f ( x0 ) s s ( s 1) ... s ( s 1)( s 2)...( s n 1)
1! 2! n!