SlideShare a Scribd company logo
1 of 52
Download to read offline
Curve Fitting,
General Linear Least
Square And Non Linear
Regression
Kiki Kananda
2021
Matematika Teknik I
Institut Teknologi Sumatera
Curve Fitting
Regresi
Regresi adalah suatu teknik untuk
mendapatkan fungsi secara umum yang
dapat mewakili atau menyatakan pola data
Regresi adalah suatu teknik untuk
memperoleh fungsi pendekatan yang
jaraknya paling kecil dari semua data
Bila terdapat data (xi,yi) maka regresi
akan menghasilkan fungsi pendekatan
ŷ = f(x)
Regresi
Jarak antara fungsi
pendekatan dengan data
untuk x yang sama
(Persamaan Sebaran)
adalah
Untuk memperoleh jarak
terdekat digunakan teknik
differensial yang
menyatakan jarak
terdekat atau minimum
pada:
0



k
a
S




n
i
i
y
i
y
S
1
2
)
ˆ
(
Regresi
Persamaan dan Model sebagai obyek regresi
Secara empiris, persamaan matematis tertentu
yang sering digunakan di antaranya adalah
(a). Persamaan ‘garis lurus’ (linier):
y = ax + b
(b). Persamaan parabolis (kuadratis):
(c). Persamaan polinomial (secara umum):
(d). Persamaan multilinier:
(e). Persamaan tak linear
r
qx
px
y 

 2
0
1
2
2
...
1
1 a
x
a
x
a
m
x
m
a
m
x
m
a
y 







2
2
1
1
0 x
a
x
a
a
y 


Regresi Linear
Regresi linier adalah suatu teknik regresi
dengan fungsi pendekatan linier.
Dengan kata lain pada regresi linier akan
diperoleh fungsi linier y=ax + b, yang
paling dekat dengan data.
 

 2
)
( b
ax
y
S
Regresi Linier
Maka, persamaan differensial yang harus
terpenuhi:
Setelah syarat terpenuhi, maka akan
terbentuk persamaan matrik berikut:
0



a
S
0



b
S
























y
xy
b
a
n
x
x
x2
Ordinary least square methode
 or
Quantification of Error of Linear
Regression
 Standard deviation and standard
error
 r 2 is called the coefficient of determination and r is the
correlation coefficient (=√r 2)
 For a perfect fit, Sr = 0 and r 2 = 1, signifying that the line
explains 100% of the variability of the data.
Examples of linear regression with (a) small
and (b) large residual errors
Ex.1
 Ex.1 cont.
Diketahui data sebagai berikut:
Tentukan persamaan regresi linearnya?
Jawab:
Koefisien matriknya yaitu:
Dengan n=10
20
8
8
6
4
5
4
1
2
1
10
9
8
7
6
5
4
3
2
1
y
x
  55
x   59
y
385
2 
 x   451
xy
Ex2:
Sehingga didapatkan konstanta a dan b dengan
rumus:
Maka, persamaan regresi linearnya yaitu:
Lanjutkan Hitung standard deviasi Sy standard
eror Sy/x dan r
















2
)
(
2 x
x
n
y
x
xy
n
a 
















2
)
(
2
2
x
x
n
xy
x
y
x
b
53333
.
1
1 
a 53333
.
2
0 

 a
b
53333
.
2
53333
.
1 
 x
y
Regresi Linier
0
2
4
6
8
10
12
1 2 3 4 5 6 7 8 9 10
Hasil Regresi
Data Asli
Flowchart
MULAI
Input data (xi, yi)
Hitung a dan b menggunakan
rumus:
Masukkan nilai a dan b dalam
persamaan y=ax + b
Selesai
2 2
( )
n xy x y
a
n x x
 

  

 
 
  
 
2
2 2
( )
x y x xy
b
n x x
 

  

 
 
   
 
LINEARIZATION OF NONLINEAR RELATIONSHIPS
(a) The exponential equation, (b) the power equation, and (c) the saturation-growth-rate
equation. Parts (d), (e), and (f ) are linearized versions of these equations that result from
simple transformations.
From Ex1
Least-squares fit of a power
model to the data from Ex1
 (a) The fit of the
transformed data.
 (b) The power equation fit
along with the data.
Continue Ex 2 for
transformed data
Problems 1
1. (a) determine intercept, slope, standard eror
and correlation coefficient
(b).determine the slope in the least square fit for a
straight line with a zero intercept, and plot
2. (a) determine intercept, slope, standard eror
and correlation coefficient
(b) Linearized the model using transformations
(c) Plot the straight line and linearized data point
General Linear Least Square And
Non Linear Regression
Regresi Polinomial
 Regresi polynomial adalah suatu bentuk regresi
dengan fungsi pendekatan yang berupa fungsi
polinomial
 Dengan fungsi sebaran:
 Persamaan differensial yang harus terpenuhi:
 Standard error
 




 2
)
0
...
1
( a
m
x
m
a
m
x
m
a
y
S
0



m
a
S
0
1




m
a
S
0
0



a
S
(a) Data that are ill-
suited for linear least-
squares regression. (b)
Indication that a
parabola is preferable.
Regresi Polinomial
Berdasarkan metode Least Square,
dengan jarak fungsi pendekatan dan data
diperoleh model regresi dalam bentuk
matrik sebagai berikut:


























































































































































n
i
i
y
n
i
i
y
i
x
n
i
i
y
i
x
i
y
n
i
m
i
x
i
y
n
i
m
i
x
a
a
a
m
a
m
a
N
n
i
i
x
n
i
i
x
n
i
m
i
x
n
i
m
i
x
n
i
i
x
n
i
i
x
n
i
i
x
n
i
m
i
x
n
i
m
i
x
n
i
i
x
n
i
i
x
n
i
i
x
n
i
m
i
x
n
i
m
i
x
n
i
m
i
x
n
i
m
i
x
n
i
m
i
x
n
i
m
i
x
n
i
m
i
x
n
i
m
i
x
n
i
m
i
x
n
i
m
i
x
n
i
m
i
x
n
i
m
i
x
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
Regresi Polinomial
Jika m = 1, maka persamaan matriknya:
Jika m = 2, maka persamaan matriknya:













































n
i
i
y
n
i
i
y
i
x
a
a
n
n
i
i
x
n
i
i
x
n
i
i
x
1
1
0
1
1
1
1
2







































































n
i
i
y
n
i
i
y
i
x
n
i
i
y
i
x
a
a
a
n
n
i
i
x
n
i
i
x
n
i
i
x
n
i
i
x
n
i
i
x
n
i
i
x
n
i
i
x
n
i
i
x
1
1
1
2
0
1
2
1
1
2
1
1
2
1
3
1
2
1
3
1
4
Regresi Polinomial
Ex.3:
Dapatkan persamaan kuadrat yang paling
sesuai dengan data berikut:
Jawab:
10
6
4
3
1
0
2
4
8
7
6
5
4
3
2
1
y
x







































































n
i
i
y
n
i
i
y
i
x
n
i
i
y
i
x
a
a
a
n
n
i
i
x
n
i
i
x
n
i
i
x
n
i
i
x
n
i
i
x
n
i
i
x
n
i
i
x
n
i
i
x
1
1
1
2
0
1
2
1
1
2
1
1
2
1
3
1
2
1
3
1
4
Regresi Polinomial
Konstanta Matriknya adalah:
Maka, model matriknya:
  36
x
  30
y
  204
2
x  1296
3
x   8772
4
x
 173
xy  1181
2y
x

























30
173
1181
0
1
2
8
36
204
36
204
1296
204
1296
8772
a
a
a
Regresi Polinomial
Dengan menggunakan elimininasi Gauss
Jordan diperoleh:
Maka, persamaan kuadrat yang diperoleh
adalah:
52
,
4
0 

a 998
,
1
1 
a 06
,
0
2 

a
52
,
4
998
,
1
2
06
,
0 


 x
x
y
Ex.4
Flowchart
MULAI
Input data (xi, yi)
Bentuk Matrik Regresi Polinomial:
Hitung Koefisien Matrik
Selesai
Selesaikan Persamaan Matrik
dengan metode eliminasi gauss
Problem 2
Fit a cubic polynomial to the following data:
Regresi Multilinier
Bentuk umum dari persamaan multilinier
adalah
Dengan fungsi sebaran:
Persamaan differensial yang harus
terpenuhi:
)
...
2
2
1
1
0
)
,...,
2
,
1
( m
x
m
a
x
a
x
a
a
n
x
x
x
y 




2
)
...
2
2
1
1
0
(
 




 m
x
m
a
x
a
x
a
a
i
y
S
0
0



a
S
0
1



a
S
0
2



a
S
0



m
a
S
Regresi Multilinier
Setelah persyaratan terpenuhi, maka akan
terbentuk matrik :






























































i
y
i
m
x
i
y
i
x
i
y
x
i
x
y
m
a
a
a
a
i
m
x
i
x
mi
x
i
x
mi
x
i
m
x
mi
x
i
x
i
x
i
x
i
x
i
x
mi
x
i
x
i
x
i
x
i
x
i
x
i
m
x
i
x
i
x
n
2
1
1
...
2
1
0
2
...
2
1
...
...
...
...
...
2
...
2
2
1
2
2
1
...
2
1
2
1
1
...
2
1
Regresi Multilinier
Ex.5:
Gunakan regresi
multilinier untuk
menyesuaikan data
berikut:
x1
x2
y
0 0 5
2 1 10
2,5 2 9
1 3 0
4 6 3
7 2 27
Regresi Multilinier
Persamaan matriknya sebagai berikut:
y x1
x2
x1
2 x2
2 x1
x2
x1
y x2
y
5 0 0 0 0 0 0 0
10 2 1 4 1 2 20 10
9 2,5 2 6,25 4 5 22,5 18
0 1 3 1 9 3 0 0
3 4 6 16 36 24 12 18
27 7 2 49 4 14 189 54
∑ = 54 ∑ = 16,5 ∑ = 14 ∑ = 76,25 ∑ = 54 ∑ = 48 ∑ = 243,5 ∑ = 100






































y
x
y
x
y
a
a
a
x
x
x
x
x
x
x
x
x
x
n
2
1
2
1
0
2
2
2
1
2
2
1
2
1
1
2
1
Regresi Multilinier
Maka, Persamaan matriknya adalah:
Setelah menggunakan eliminasi gauss,
didapatkan:
Jadi, persamaan multiliniernya adalah:

























100
5
,
243
54
2
1
0
54
48
14
48
25
,
76
5
,
16
14
5
,
16
6
a
a
a
5
0 
a 4
1 
a 3
2 

a
2
3
1
4
5 x
x
y 


Flowchart
MULAI
Input data (xi, yi)
Bentuk Matrik Regresi Multilinier
Hitung Koefisien Matrik
Selesai
Selesaikan Persamaan Matrik
dengan metode eliminasi gauss
Problem 3
The following data were collected for the steady flow of
water in a concrete circular pipe:
Regresi Tak Linier
Seperti halnya dengan regresi lainnya,
regresi tak linear didasarkan pada
penentuan seperti nilai-nilai parameter
yang meminimumkan jumlah kuadrat dari
sisanya
Namun, untuk kasus tak linear
penyelesaiannya haruslah berjalan dengan
cara iterasi yang penyelesaian-
penyelesaian yang beruntun sering kali
tergantung pada tebakan-tebakan awal
parameter
Regresi Tak Linier
Persamaan Tak Linier yaitu:
Persamaan umumnya yaitu:
Dalam bentuk matrik yaitu:
i
e
m
a
a
a
i
x
f
i
y 
 )
,...,
1
,
0
;
(
i
e
a
a
j
i
x
f
a
a
j
i
x
f
j
i
x
f
i
y 








 1
1
)
(
0
0
)
(
)
(
      
E
A
j
Z
D 


Regresi Tak Linier
Dimana:
Maka, persamaan untuk model regresinya
yaitu:
 

































1
0
1
2
0
2
1
1
0
1
...
...
a
fn
a
f
a
f
a
f
a
f
a
f
Z
n
j
 














)
(
...
)
2
(
2
)
1
(
1
xn
f
n
y
x
f
y
x
f
y
D  










1
0
a
a
A
   
      
D
T
j
Z
A
j
Z
T
j
Z 

Regresi Tak Linier
Solusi dari persamaan matrik tersebut
adalah {ΔA}, yang akan digunakan untuk
memperbaiki tebakan awal tersebut
dengan rumus:
Prosedur ini diulang sampai nilai ε
dibawah kriteria penghentian yang dapat
diterima
0
)
(
0
)
1
(
0 a
j
a
j
a 



1
)
(
1
)
1
(
1 a
j
a
j
a 



%
100
)
1
(
)
(
)
1
(





j
k
a
j
k
a
j
k
a
k
a
Regresi Tak Linier
Ex.6:
Cocokkan fungsi
pada data:
dengan tebakan awal a0 dan a1 =1
Jawab:
x1 y
0,25 0,28
0,75 0,57
1,25 0,68
1,75 0,74
2,25 0,79
 
x
a
e
a
a
a
x
f 1
1
)
,
;
( 0
1
0



x
a
xe
a
a
f 1
0
1




x
a
e
a
f 1
1
0





Regresi Tak Linier
Sehingga konstanta-konstanta matriknya
adalah:
 













2371
,
0
8946
,
0
3041
,
0
8262
,
0
3581
,
0
7135
,
0
3543
,
0
5276
,
0
1947
,
0
2212
,
0
0
Z     






4404
,
0
9489
,
0
9489
,
0
3193
,
2
0
0 Z
T
Z
   
  









1678
,
19
4821
,
7
4281
,
7
6397
,
3
1
0
0 Z
T
Z
 






































1046
,
0
0862
,
0
0335
,
0
0424
,
0
0588
,
0
8946
,
0
79
,
0
8262
,
0
74
,
0
7135
,
0
68
,
0
5276
,
0
57
,
0
2212
,
0
28
,
0
D
Regresi Tak Linier
Maka nilai {ΔA} dapat dihitung
menggunakan persamaan regresi tak
linier, yaitu
Sehingga
   









0365
,
0
1533
,
0
0 D
T
Z
 








5019
,
0
2714
,
0
A



























5019
,
1
7286
,
0
5019
,
0
2714
,
0
0
,
1
0
,
1
1
0
a
a
Flowchart
Konverge
n
(εk < ε )
MULAI
Input data (xi, yi), Tebakan
awal, ε
Bentuk Matrik Regresi Taklinier
Hitung Koefisien Matrik
Selesai
Selesaikan Persamaan Matrik
dengan metode eliminasi gauss
No
Yes
Regresi Tak Linier
Selain menggunakan metode regresi tak linear,
akar-akar persamaan tak linear juga dapat dicari
dengan mengubah persamaan tersebut ke
bentuk polynomial seperti contoh di bawah ini:
1. Persamaan y =
ln (y) = ln (a) + b ln( x)
misalkan y’ = ln (y), a’ = ln (a), x’ = ln
(x). Sehingga persamaannya menjadi:
y’ = a’ + bx’
b
ax
Regresi Tak Linier
2. Persamaan y =
ln (y) = ln (a) + bx
Yang dapat dituliskan dalam bentuk
polynomial:
y’ = a’ + bx
bx
ae
Problem 4
References
Chapra, Steven C. Applied numerical methods with
MATLAB for engineers and scientists / Steven C.
Chapra. 3rd ed.
Basuki, Ahmad dan Nana Ramadijanti. 2005.Metode
Numerik dan Algoritma Komputasi. Yogyakarta:
Andi
Hoffman, Joe D.1993.Numerical Methods For
Enginers And Scientist. Singapore: McGraw-Hill
Kelompok 7:Asmaria Syahrosi, dkk, Menum

More Related Content

Similar to 15_Least Square for matemathical engineering for student and teacher

3 regresi and-korelasi_berganda.ppt
3 regresi and-korelasi_berganda.ppt3 regresi and-korelasi_berganda.ppt
3 regresi and-korelasi_berganda.ppt
aliff_aimann
 
Regresi Kuadrat Terkecil
Regresi Kuadrat TerkecilRegresi Kuadrat Terkecil
Regresi Kuadrat Terkecil
indra herlangga
 
Mengatasi multikolonieritas
Mengatasi multikolonieritasMengatasi multikolonieritas
Mengatasi multikolonieritas
Eka Siskawati
 
362112547 kuadratik-dan-kubik
362112547 kuadratik-dan-kubik362112547 kuadratik-dan-kubik
362112547 kuadratik-dan-kubik
Chevi Rahayu
 
Penyelesaian sistem persamaan linear dengan
Penyelesaian  sistem persamaan  linear  denganPenyelesaian  sistem persamaan  linear  dengan
Penyelesaian sistem persamaan linear dengan
BAIDILAH Baidilah
 
Pengantar statistika slide 3
Pengantar statistika slide 3Pengantar statistika slide 3
Pengantar statistika slide 3
Az'End Love
 
Bd07rgeresi practice
Bd07rgeresi practiceBd07rgeresi practice
Bd07rgeresi practice
Anan Nur
 
sistem persamaan linear
sistem persamaan linearsistem persamaan linear
sistem persamaan linear
mfebri26
 
247928590-Regresi-non-linear presentasi.pptx
247928590-Regresi-non-linear presentasi.pptx247928590-Regresi-non-linear presentasi.pptx
247928590-Regresi-non-linear presentasi.pptx
amsah376
 

Similar to 15_Least Square for matemathical engineering for student and teacher (20)

Metode Numerik Penyelesaian Persamaan Linier Simultan
Metode Numerik Penyelesaian Persamaan Linier SimultanMetode Numerik Penyelesaian Persamaan Linier Simultan
Metode Numerik Penyelesaian Persamaan Linier Simultan
 
3 regresi and-korelasi_berganda.ppt
3 regresi and-korelasi_berganda.ppt3 regresi and-korelasi_berganda.ppt
3 regresi and-korelasi_berganda.ppt
 
Regresi Kuadrat Terkecil
Regresi Kuadrat TerkecilRegresi Kuadrat Terkecil
Regresi Kuadrat Terkecil
 
Matdas.pptx
Matdas.pptxMatdas.pptx
Matdas.pptx
 
Materi Aljabar Fungsi Kuadrat
Materi Aljabar Fungsi KuadratMateri Aljabar Fungsi Kuadrat
Materi Aljabar Fungsi Kuadrat
 
Mengatasi multikolonieritas
Mengatasi multikolonieritasMengatasi multikolonieritas
Mengatasi multikolonieritas
 
362112547 kuadratik-dan-kubik
362112547 kuadratik-dan-kubik362112547 kuadratik-dan-kubik
362112547 kuadratik-dan-kubik
 
Penyelesaian sistem persamaan linear dengan
Penyelesaian  sistem persamaan  linear  denganPenyelesaian  sistem persamaan  linear  dengan
Penyelesaian sistem persamaan linear dengan
 
Pengantar statistika slide 3
Pengantar statistika slide 3Pengantar statistika slide 3
Pengantar statistika slide 3
 
Kuliah statistika lanjut
Kuliah statistika lanjutKuliah statistika lanjut
Kuliah statistika lanjut
 
Bd07rgeresi practice
Bd07rgeresi practiceBd07rgeresi practice
Bd07rgeresi practice
 
Pertemuan v sistem persamaan linier
Pertemuan v sistem persamaan linierPertemuan v sistem persamaan linier
Pertemuan v sistem persamaan linier
 
006 elips kesalahan
006 elips kesalahan006 elips kesalahan
006 elips kesalahan
 
MATERI PERTEMUAN 2.pdf
MATERI PERTEMUAN 2.pdfMATERI PERTEMUAN 2.pdf
MATERI PERTEMUAN 2.pdf
 
sistem persamaan linear
sistem persamaan linearsistem persamaan linear
sistem persamaan linear
 
Sistem Persamaan Linear dan Kuadrat
Sistem Persamaan Linear dan KuadratSistem Persamaan Linear dan Kuadrat
Sistem Persamaan Linear dan Kuadrat
 
247928590-Regresi-non-linear presentasi.pptx
247928590-Regresi-non-linear presentasi.pptx247928590-Regresi-non-linear presentasi.pptx
247928590-Regresi-non-linear presentasi.pptx
 
Program linier
Program linierProgram linier
Program linier
 
Bab 5-sistem-persamaan-linear-dan-kuadrat
Bab 5-sistem-persamaan-linear-dan-kuadratBab 5-sistem-persamaan-linear-dan-kuadrat
Bab 5-sistem-persamaan-linear-dan-kuadrat
 
03 - Metode Numerik yah.pptx
03 - Metode Numerik yah.pptx03 - Metode Numerik yah.pptx
03 - Metode Numerik yah.pptx
 

Recently uploaded

Obat Aborsi Bandung ( Ampuh ) 082223109953 Jual Cytotec Asli Obat Telat Bulan...
Obat Aborsi Bandung ( Ampuh ) 082223109953 Jual Cytotec Asli Obat Telat Bulan...Obat Aborsi Bandung ( Ampuh ) 082223109953 Jual Cytotec Asli Obat Telat Bulan...
Obat Aborsi Bandung ( Ampuh ) 082223109953 Jual Cytotec Asli Obat Telat Bulan...
Obat Aborsi Bandung ( Ampuh ) 082223109953 Obat Telat Bulan Di Bandung
 
KELOMPOK 6- DINAMIKA DAN TANTANGAN PANCASILA SEBAGAI IDEOLOGI.pdf
KELOMPOK 6- DINAMIKA DAN TANTANGAN PANCASILA SEBAGAI IDEOLOGI.pdfKELOMPOK 6- DINAMIKA DAN TANTANGAN PANCASILA SEBAGAI IDEOLOGI.pdf
KELOMPOK 6- DINAMIKA DAN TANTANGAN PANCASILA SEBAGAI IDEOLOGI.pdf
InnesKana26
 
Jual Cytotec Di Sinjai Ori 👙082122229359👙Pusat Peluntur Kandungan Konsultasi
Jual Cytotec Di Sinjai Ori 👙082122229359👙Pusat Peluntur Kandungan KonsultasiJual Cytotec Di Sinjai Ori 👙082122229359👙Pusat Peluntur Kandungan Konsultasi
Jual Cytotec Di Sinjai Ori 👙082122229359👙Pusat Peluntur Kandungan Konsultasi
ssupi412
 
Jual Cytotec Di Majalengka Ori👗082322223014👗Pusat Peluntur Kandungan Konsultasi
Jual Cytotec Di Majalengka Ori👗082322223014👗Pusat Peluntur Kandungan KonsultasiJual Cytotec Di Majalengka Ori👗082322223014👗Pusat Peluntur Kandungan Konsultasi
Jual Cytotec Di Majalengka Ori👗082322223014👗Pusat Peluntur Kandungan Konsultasi
ssupi412
 
Jual Obat Aborsi Tasikmalaya ( Asli Ampuh No.1 ) 082223109953 Tempat Klinik J...
Jual Obat Aborsi Tasikmalaya ( Asli Ampuh No.1 ) 082223109953 Tempat Klinik J...Jual Obat Aborsi Tasikmalaya ( Asli Ampuh No.1 ) 082223109953 Tempat Klinik J...
Jual Obat Aborsi Tasikmalaya ( Asli Ampuh No.1 ) 082223109953 Tempat Klinik J...
Jual Obat Aborsi Tasikmalaya ( Asli Ampuh No.1 ) 082223109953
 
Aksi Nyata Mencegah Kekerasan Seksual.pptx
Aksi Nyata Mencegah Kekerasan Seksual.pptxAksi Nyata Mencegah Kekerasan Seksual.pptx
Aksi Nyata Mencegah Kekerasan Seksual.pptx
meirahayu651
 
Jual Obat Aborsi Samarinda ( Asli Ampuh No.1 ) 082223109953 Tempat Klinik Jua...
Jual Obat Aborsi Samarinda ( Asli Ampuh No.1 ) 082223109953 Tempat Klinik Jua...Jual Obat Aborsi Samarinda ( Asli Ampuh No.1 ) 082223109953 Tempat Klinik Jua...
Jual Obat Aborsi Samarinda ( Asli Ampuh No.1 ) 082223109953 Tempat Klinik Jua...
Jual Obat Aborsi Samarinda ( Asli Ampuh No.1 ) 082223109953
 
Jual Pil Penggugur Kandungan 085225524732 Obat Aborsi Cytotec Asli
Jual Pil Penggugur Kandungan 085225524732 Obat Aborsi Cytotec AsliJual Pil Penggugur Kandungan 085225524732 Obat Aborsi Cytotec Asli
Jual Pil Penggugur Kandungan 085225524732 Obat Aborsi Cytotec Asli
Jual Cytotec Asli 085225524732 Obat Penggugur Kandungan
 
Telaah Kurikulum dan Buku Teks Mata Pelajaran Bahasa Indonesia Sekolah Dasar ...
Telaah Kurikulum dan Buku Teks Mata Pelajaran Bahasa Indonesia Sekolah Dasar ...Telaah Kurikulum dan Buku Teks Mata Pelajaran Bahasa Indonesia Sekolah Dasar ...
Telaah Kurikulum dan Buku Teks Mata Pelajaran Bahasa Indonesia Sekolah Dasar ...
buktifisikskp23
 

Recently uploaded (20)

PPT SEMINAR PROPOSAL KLASIFIKASI CNN.pptx
PPT SEMINAR PROPOSAL KLASIFIKASI CNN.pptxPPT SEMINAR PROPOSAL KLASIFIKASI CNN.pptx
PPT SEMINAR PROPOSAL KLASIFIKASI CNN.pptx
 
Obat Aborsi Bandung ( Ampuh ) 082223109953 Jual Cytotec Asli Obat Telat Bulan...
Obat Aborsi Bandung ( Ampuh ) 082223109953 Jual Cytotec Asli Obat Telat Bulan...Obat Aborsi Bandung ( Ampuh ) 082223109953 Jual Cytotec Asli Obat Telat Bulan...
Obat Aborsi Bandung ( Ampuh ) 082223109953 Jual Cytotec Asli Obat Telat Bulan...
 
384986085-Bahaya-Narkoba-Bagi-Kesehatan-Jiwa-Remaja.ppt
384986085-Bahaya-Narkoba-Bagi-Kesehatan-Jiwa-Remaja.ppt384986085-Bahaya-Narkoba-Bagi-Kesehatan-Jiwa-Remaja.ppt
384986085-Bahaya-Narkoba-Bagi-Kesehatan-Jiwa-Remaja.ppt
 
KELOMPOK 6- DINAMIKA DAN TANTANGAN PANCASILA SEBAGAI IDEOLOGI.pdf
KELOMPOK 6- DINAMIKA DAN TANTANGAN PANCASILA SEBAGAI IDEOLOGI.pdfKELOMPOK 6- DINAMIKA DAN TANTANGAN PANCASILA SEBAGAI IDEOLOGI.pdf
KELOMPOK 6- DINAMIKA DAN TANTANGAN PANCASILA SEBAGAI IDEOLOGI.pdf
 
Jual Cytotec Di Sinjai Ori 👙082122229359👙Pusat Peluntur Kandungan Konsultasi
Jual Cytotec Di Sinjai Ori 👙082122229359👙Pusat Peluntur Kandungan KonsultasiJual Cytotec Di Sinjai Ori 👙082122229359👙Pusat Peluntur Kandungan Konsultasi
Jual Cytotec Di Sinjai Ori 👙082122229359👙Pusat Peluntur Kandungan Konsultasi
 
Jual Cytotec Di Majalengka Ori👗082322223014👗Pusat Peluntur Kandungan Konsultasi
Jual Cytotec Di Majalengka Ori👗082322223014👗Pusat Peluntur Kandungan KonsultasiJual Cytotec Di Majalengka Ori👗082322223014👗Pusat Peluntur Kandungan Konsultasi
Jual Cytotec Di Majalengka Ori👗082322223014👗Pusat Peluntur Kandungan Konsultasi
 
TUGAS TELAAH jurnal dengan COHORT-1.docx
TUGAS TELAAH jurnal dengan COHORT-1.docxTUGAS TELAAH jurnal dengan COHORT-1.docx
TUGAS TELAAH jurnal dengan COHORT-1.docx
 
Jual Obat Aborsi Tasikmalaya ( Asli Ampuh No.1 ) 082223109953 Tempat Klinik J...
Jual Obat Aborsi Tasikmalaya ( Asli Ampuh No.1 ) 082223109953 Tempat Klinik J...Jual Obat Aborsi Tasikmalaya ( Asli Ampuh No.1 ) 082223109953 Tempat Klinik J...
Jual Obat Aborsi Tasikmalaya ( Asli Ampuh No.1 ) 082223109953 Tempat Klinik J...
 
PEMANTAUAN HEMODINAMIK.dalam keperawatan pptx
PEMANTAUAN HEMODINAMIK.dalam keperawatan pptxPEMANTAUAN HEMODINAMIK.dalam keperawatan pptx
PEMANTAUAN HEMODINAMIK.dalam keperawatan pptx
 
Katalog-Kurikulum-Non-Pendas-UT-2023-2024_SC-23-MEI-2023-revisi-171023_compre...
Katalog-Kurikulum-Non-Pendas-UT-2023-2024_SC-23-MEI-2023-revisi-171023_compre...Katalog-Kurikulum-Non-Pendas-UT-2023-2024_SC-23-MEI-2023-revisi-171023_compre...
Katalog-Kurikulum-Non-Pendas-UT-2023-2024_SC-23-MEI-2023-revisi-171023_compre...
 
Teknis-Audit-Internal untuk penerapan ISO 17025
Teknis-Audit-Internal untuk penerapan ISO 17025Teknis-Audit-Internal untuk penerapan ISO 17025
Teknis-Audit-Internal untuk penerapan ISO 17025
 
Aksi Nyata Mencegah Kekerasan Seksual.pptx
Aksi Nyata Mencegah Kekerasan Seksual.pptxAksi Nyata Mencegah Kekerasan Seksual.pptx
Aksi Nyata Mencegah Kekerasan Seksual.pptx
 
PPT ANALISIS KEUANGAN PEMERINTAH (1).pptx
PPT ANALISIS KEUANGAN PEMERINTAH  (1).pptxPPT ANALISIS KEUANGAN PEMERINTAH  (1).pptx
PPT ANALISIS KEUANGAN PEMERINTAH (1).pptx
 
materi konsep dan Model TRIASE Bencana.pptx
materi konsep dan Model TRIASE Bencana.pptxmateri konsep dan Model TRIASE Bencana.pptx
materi konsep dan Model TRIASE Bencana.pptx
 
Jual Obat Aborsi Samarinda ( Asli Ampuh No.1 ) 082223109953 Tempat Klinik Jua...
Jual Obat Aborsi Samarinda ( Asli Ampuh No.1 ) 082223109953 Tempat Klinik Jua...Jual Obat Aborsi Samarinda ( Asli Ampuh No.1 ) 082223109953 Tempat Klinik Jua...
Jual Obat Aborsi Samarinda ( Asli Ampuh No.1 ) 082223109953 Tempat Klinik Jua...
 
contoh judul tesis untuk mahasiswa pascasarjana
contoh judul tesis untuk mahasiswa pascasarjanacontoh judul tesis untuk mahasiswa pascasarjana
contoh judul tesis untuk mahasiswa pascasarjana
 
Jual Pil Penggugur Kandungan 085225524732 Obat Aborsi Cytotec Asli
Jual Pil Penggugur Kandungan 085225524732 Obat Aborsi Cytotec AsliJual Pil Penggugur Kandungan 085225524732 Obat Aborsi Cytotec Asli
Jual Pil Penggugur Kandungan 085225524732 Obat Aborsi Cytotec Asli
 
Menganalisis T Test dengan menggunakan SPSS
Menganalisis T Test dengan menggunakan SPSSMenganalisis T Test dengan menggunakan SPSS
Menganalisis T Test dengan menggunakan SPSS
 
apotek jual obat aborsi Bogor Wa 082223109953 obat aborsi Cytotec Di Bogor
apotek jual obat aborsi Bogor Wa 082223109953 obat aborsi Cytotec Di Bogorapotek jual obat aborsi Bogor Wa 082223109953 obat aborsi Cytotec Di Bogor
apotek jual obat aborsi Bogor Wa 082223109953 obat aborsi Cytotec Di Bogor
 
Telaah Kurikulum dan Buku Teks Mata Pelajaran Bahasa Indonesia Sekolah Dasar ...
Telaah Kurikulum dan Buku Teks Mata Pelajaran Bahasa Indonesia Sekolah Dasar ...Telaah Kurikulum dan Buku Teks Mata Pelajaran Bahasa Indonesia Sekolah Dasar ...
Telaah Kurikulum dan Buku Teks Mata Pelajaran Bahasa Indonesia Sekolah Dasar ...
 

15_Least Square for matemathical engineering for student and teacher

  • 1. Curve Fitting, General Linear Least Square And Non Linear Regression Kiki Kananda 2021 Matematika Teknik I Institut Teknologi Sumatera
  • 3. Regresi Regresi adalah suatu teknik untuk mendapatkan fungsi secara umum yang dapat mewakili atau menyatakan pola data Regresi adalah suatu teknik untuk memperoleh fungsi pendekatan yang jaraknya paling kecil dari semua data Bila terdapat data (xi,yi) maka regresi akan menghasilkan fungsi pendekatan ŷ = f(x)
  • 4. Regresi Jarak antara fungsi pendekatan dengan data untuk x yang sama (Persamaan Sebaran) adalah Untuk memperoleh jarak terdekat digunakan teknik differensial yang menyatakan jarak terdekat atau minimum pada: 0    k a S     n i i y i y S 1 2 ) ˆ (
  • 6. Persamaan dan Model sebagai obyek regresi Secara empiris, persamaan matematis tertentu yang sering digunakan di antaranya adalah (a). Persamaan ‘garis lurus’ (linier): y = ax + b (b). Persamaan parabolis (kuadratis): (c). Persamaan polinomial (secara umum): (d). Persamaan multilinier: (e). Persamaan tak linear r qx px y    2 0 1 2 2 ... 1 1 a x a x a m x m a m x m a y         2 2 1 1 0 x a x a a y   
  • 7. Regresi Linear Regresi linier adalah suatu teknik regresi dengan fungsi pendekatan linier. Dengan kata lain pada regresi linier akan diperoleh fungsi linier y=ax + b, yang paling dekat dengan data.     2 ) ( b ax y S
  • 8. Regresi Linier Maka, persamaan differensial yang harus terpenuhi: Setelah syarat terpenuhi, maka akan terbentuk persamaan matrik berikut: 0    a S 0    b S                         y xy b a n x x x2
  • 9. Ordinary least square methode  or
  • 10. Quantification of Error of Linear Regression  Standard deviation and standard error  r 2 is called the coefficient of determination and r is the correlation coefficient (=√r 2)  For a perfect fit, Sr = 0 and r 2 = 1, signifying that the line explains 100% of the variability of the data.
  • 11. Examples of linear regression with (a) small and (b) large residual errors
  • 14. Diketahui data sebagai berikut: Tentukan persamaan regresi linearnya? Jawab: Koefisien matriknya yaitu: Dengan n=10 20 8 8 6 4 5 4 1 2 1 10 9 8 7 6 5 4 3 2 1 y x   55 x   59 y 385 2   x   451 xy Ex2:
  • 15. Sehingga didapatkan konstanta a dan b dengan rumus: Maka, persamaan regresi linearnya yaitu: Lanjutkan Hitung standard deviasi Sy standard eror Sy/x dan r                 2 ) ( 2 x x n y x xy n a                  2 ) ( 2 2 x x n xy x y x b 53333 . 1 1  a 53333 . 2 0    a b 53333 . 2 53333 . 1   x y
  • 16. Regresi Linier 0 2 4 6 8 10 12 1 2 3 4 5 6 7 8 9 10 Hasil Regresi Data Asli
  • 17. Flowchart MULAI Input data (xi, yi) Hitung a dan b menggunakan rumus: Masukkan nilai a dan b dalam persamaan y=ax + b Selesai 2 2 ( ) n xy x y a n x x                 2 2 2 ( ) x y x xy b n x x                 
  • 18. LINEARIZATION OF NONLINEAR RELATIONSHIPS (a) The exponential equation, (b) the power equation, and (c) the saturation-growth-rate equation. Parts (d), (e), and (f ) are linearized versions of these equations that result from simple transformations.
  • 20. Least-squares fit of a power model to the data from Ex1  (a) The fit of the transformed data.  (b) The power equation fit along with the data. Continue Ex 2 for transformed data
  • 21. Problems 1 1. (a) determine intercept, slope, standard eror and correlation coefficient (b).determine the slope in the least square fit for a straight line with a zero intercept, and plot 2. (a) determine intercept, slope, standard eror and correlation coefficient (b) Linearized the model using transformations (c) Plot the straight line and linearized data point
  • 22. General Linear Least Square And Non Linear Regression
  • 23. Regresi Polinomial  Regresi polynomial adalah suatu bentuk regresi dengan fungsi pendekatan yang berupa fungsi polinomial  Dengan fungsi sebaran:  Persamaan differensial yang harus terpenuhi:  Standard error        2 ) 0 ... 1 ( a m x m a m x m a y S 0    m a S 0 1     m a S 0 0    a S
  • 24. (a) Data that are ill- suited for linear least- squares regression. (b) Indication that a parabola is preferable.
  • 25. Regresi Polinomial Berdasarkan metode Least Square, dengan jarak fungsi pendekatan dan data diperoleh model regresi dalam bentuk matrik sebagai berikut:                                                                                                                                                           n i i y n i i y i x n i i y i x i y n i m i x i y n i m i x a a a m a m a N n i i x n i i x n i m i x n i m i x n i i x n i i x n i i x n i m i x n i m i x n i i x n i i x n i i x n i m i x n i m i x n i m i x n i m i x n i m i x n i m i x n i m i x n i m i x n i m i x n i m i x n i m i x n i m i x 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
  • 26. Regresi Polinomial Jika m = 1, maka persamaan matriknya: Jika m = 2, maka persamaan matriknya:                                              n i i y n i i y i x a a n n i i x n i i x n i i x 1 1 0 1 1 1 1 2                                                                        n i i y n i i y i x n i i y i x a a a n n i i x n i i x n i i x n i i x n i i x n i i x n i i x n i i x 1 1 1 2 0 1 2 1 1 2 1 1 2 1 3 1 2 1 3 1 4
  • 27. Regresi Polinomial Ex.3: Dapatkan persamaan kuadrat yang paling sesuai dengan data berikut: Jawab: 10 6 4 3 1 0 2 4 8 7 6 5 4 3 2 1 y x                                                                        n i i y n i i y i x n i i y i x a a a n n i i x n i i x n i i x n i i x n i i x n i i x n i i x n i i x 1 1 1 2 0 1 2 1 1 2 1 1 2 1 3 1 2 1 3 1 4
  • 28. Regresi Polinomial Konstanta Matriknya adalah: Maka, model matriknya:   36 x   30 y   204 2 x  1296 3 x   8772 4 x  173 xy  1181 2y x                          30 173 1181 0 1 2 8 36 204 36 204 1296 204 1296 8772 a a a
  • 29. Regresi Polinomial Dengan menggunakan elimininasi Gauss Jordan diperoleh: Maka, persamaan kuadrat yang diperoleh adalah: 52 , 4 0   a 998 , 1 1  a 06 , 0 2   a 52 , 4 998 , 1 2 06 , 0     x x y
  • 30. Ex.4
  • 31.
  • 32. Flowchart MULAI Input data (xi, yi) Bentuk Matrik Regresi Polinomial: Hitung Koefisien Matrik Selesai Selesaikan Persamaan Matrik dengan metode eliminasi gauss
  • 33. Problem 2 Fit a cubic polynomial to the following data:
  • 34. Regresi Multilinier Bentuk umum dari persamaan multilinier adalah Dengan fungsi sebaran: Persamaan differensial yang harus terpenuhi: ) ... 2 2 1 1 0 ) ,..., 2 , 1 ( m x m a x a x a a n x x x y      2 ) ... 2 2 1 1 0 (        m x m a x a x a a i y S 0 0    a S 0 1    a S 0 2    a S 0    m a S
  • 35. Regresi Multilinier Setelah persyaratan terpenuhi, maka akan terbentuk matrik :                                                               i y i m x i y i x i y x i x y m a a a a i m x i x mi x i x mi x i m x mi x i x i x i x i x i x mi x i x i x i x i x i x i m x i x i x n 2 1 1 ... 2 1 0 2 ... 2 1 ... ... ... ... ... 2 ... 2 2 1 2 2 1 ... 2 1 2 1 1 ... 2 1
  • 36. Regresi Multilinier Ex.5: Gunakan regresi multilinier untuk menyesuaikan data berikut: x1 x2 y 0 0 5 2 1 10 2,5 2 9 1 3 0 4 6 3 7 2 27
  • 37. Regresi Multilinier Persamaan matriknya sebagai berikut: y x1 x2 x1 2 x2 2 x1 x2 x1 y x2 y 5 0 0 0 0 0 0 0 10 2 1 4 1 2 20 10 9 2,5 2 6,25 4 5 22,5 18 0 1 3 1 9 3 0 0 3 4 6 16 36 24 12 18 27 7 2 49 4 14 189 54 ∑ = 54 ∑ = 16,5 ∑ = 14 ∑ = 76,25 ∑ = 54 ∑ = 48 ∑ = 243,5 ∑ = 100                                       y x y x y a a a x x x x x x x x x x n 2 1 2 1 0 2 2 2 1 2 2 1 2 1 1 2 1
  • 38. Regresi Multilinier Maka, Persamaan matriknya adalah: Setelah menggunakan eliminasi gauss, didapatkan: Jadi, persamaan multiliniernya adalah:                          100 5 , 243 54 2 1 0 54 48 14 48 25 , 76 5 , 16 14 5 , 16 6 a a a 5 0  a 4 1  a 3 2   a 2 3 1 4 5 x x y   
  • 39. Flowchart MULAI Input data (xi, yi) Bentuk Matrik Regresi Multilinier Hitung Koefisien Matrik Selesai Selesaikan Persamaan Matrik dengan metode eliminasi gauss
  • 40. Problem 3 The following data were collected for the steady flow of water in a concrete circular pipe:
  • 41. Regresi Tak Linier Seperti halnya dengan regresi lainnya, regresi tak linear didasarkan pada penentuan seperti nilai-nilai parameter yang meminimumkan jumlah kuadrat dari sisanya Namun, untuk kasus tak linear penyelesaiannya haruslah berjalan dengan cara iterasi yang penyelesaian- penyelesaian yang beruntun sering kali tergantung pada tebakan-tebakan awal parameter
  • 42. Regresi Tak Linier Persamaan Tak Linier yaitu: Persamaan umumnya yaitu: Dalam bentuk matrik yaitu: i e m a a a i x f i y   ) ,..., 1 , 0 ; ( i e a a j i x f a a j i x f j i x f i y           1 1 ) ( 0 0 ) ( ) (        E A j Z D   
  • 43. Regresi Tak Linier Dimana: Maka, persamaan untuk model regresinya yaitu:                                    1 0 1 2 0 2 1 1 0 1 ... ... a fn a f a f a f a f a f Z n j                 ) ( ... ) 2 ( 2 ) 1 ( 1 xn f n y x f y x f y D             1 0 a a A            D T j Z A j Z T j Z  
  • 44. Regresi Tak Linier Solusi dari persamaan matrik tersebut adalah {ΔA}, yang akan digunakan untuk memperbaiki tebakan awal tersebut dengan rumus: Prosedur ini diulang sampai nilai ε dibawah kriteria penghentian yang dapat diterima 0 ) ( 0 ) 1 ( 0 a j a j a     1 ) ( 1 ) 1 ( 1 a j a j a     % 100 ) 1 ( ) ( ) 1 (      j k a j k a j k a k a
  • 45. Regresi Tak Linier Ex.6: Cocokkan fungsi pada data: dengan tebakan awal a0 dan a1 =1 Jawab: x1 y 0,25 0,28 0,75 0,57 1,25 0,68 1,75 0,74 2,25 0,79   x a e a a a x f 1 1 ) , ; ( 0 1 0    x a xe a a f 1 0 1     x a e a f 1 1 0     
  • 46. Regresi Tak Linier Sehingga konstanta-konstanta matriknya adalah:                2371 , 0 8946 , 0 3041 , 0 8262 , 0 3581 , 0 7135 , 0 3543 , 0 5276 , 0 1947 , 0 2212 , 0 0 Z            4404 , 0 9489 , 0 9489 , 0 3193 , 2 0 0 Z T Z                 1678 , 19 4821 , 7 4281 , 7 6397 , 3 1 0 0 Z T Z                                         1046 , 0 0862 , 0 0335 , 0 0424 , 0 0588 , 0 8946 , 0 79 , 0 8262 , 0 74 , 0 7135 , 0 68 , 0 5276 , 0 57 , 0 2212 , 0 28 , 0 D
  • 47. Regresi Tak Linier Maka nilai {ΔA} dapat dihitung menggunakan persamaan regresi tak linier, yaitu Sehingga              0365 , 0 1533 , 0 0 D T Z           5019 , 0 2714 , 0 A                            5019 , 1 7286 , 0 5019 , 0 2714 , 0 0 , 1 0 , 1 1 0 a a
  • 48. Flowchart Konverge n (εk < ε ) MULAI Input data (xi, yi), Tebakan awal, ε Bentuk Matrik Regresi Taklinier Hitung Koefisien Matrik Selesai Selesaikan Persamaan Matrik dengan metode eliminasi gauss No Yes
  • 49. Regresi Tak Linier Selain menggunakan metode regresi tak linear, akar-akar persamaan tak linear juga dapat dicari dengan mengubah persamaan tersebut ke bentuk polynomial seperti contoh di bawah ini: 1. Persamaan y = ln (y) = ln (a) + b ln( x) misalkan y’ = ln (y), a’ = ln (a), x’ = ln (x). Sehingga persamaannya menjadi: y’ = a’ + bx’ b ax
  • 50. Regresi Tak Linier 2. Persamaan y = ln (y) = ln (a) + bx Yang dapat dituliskan dalam bentuk polynomial: y’ = a’ + bx bx ae
  • 52. References Chapra, Steven C. Applied numerical methods with MATLAB for engineers and scientists / Steven C. Chapra. 3rd ed. Basuki, Ahmad dan Nana Ramadijanti. 2005.Metode Numerik dan Algoritma Komputasi. Yogyakarta: Andi Hoffman, Joe D.1993.Numerical Methods For Enginers And Scientist. Singapore: McGraw-Hill Kelompok 7:Asmaria Syahrosi, dkk, Menum