SlideShare a Scribd company logo
1 of 14
Download to read offline
Método dos Quadrados Mínimos
Lista 4 no Canvas
Método dos Quadrados Mínimos (ou Mínimos
Quadrados)
Vimos que a interpolação polinomial pode ser usada
para aproximar uma função por outra. Usamos quando:
1) não temos a expressão da função (só um conjunto de
pontos tabelados) ou
2) temos a expressão mas ela é bem complicada
E queremos obter valores dentro do intervalo de
tabelamento.
A interpolação polinomial respeita a igualdade
pn(xi) = f(xi) onde xi são os pontos escolhidos para a
aproximação.
Porém a interpolação não é aconselhável quando:
a) queremos prever um valor fora do intervalo de tabelamento ou
b) queremos por exemplo usar 10 pontos para aproximar por uma reta.
Como fazer isso? Se a reta só precisa de 2 pontos?
Nesses casos vamos usar M.Q.M. → método de ajuste de curvas
0
2
4
6
8
10
12
14
16
18
0 2 4 6 8 10 12
x f(x)
1 1,3
2 3,5
3 4,2
4 5
5 7
6 8,8
7 10,1
8 12,5
9 13
10 15,6
Caso Discreto:
Dados os pontos tabelados (x1,f(x1)), (x2,f(x2)) , ..., (xm,f(xm)) queremos determinar os
coeficientes 1, 2,..., n tal que g(x) se aproxime ao máximo de f(x) nos pontos k = 1, .., m
sendo g x = 𝛼1. 𝑔1 𝑥 + 𝛼2. 𝑔2 𝑥 + ⋯ + 𝛼𝑛. 𝑔𝑛 𝑥
• E quem são essas funções gi(x)? São as funções que iremos escolher para aproximar pelo
M.Q.M.
• Como escolher? Na maioria dos casos olhando o gráfico de dispersão e em alguns casos, se já
soubermos o comportamento dos dados, usamos a função pré-escolhida para aproximar.
• Olhando o exemplo anterior conseguimos ver que o comportamento do gráfico se parece
com uma reta. Nesse caso teremos g(x) = 𝛼1. 𝑥 + 𝛼2. 1 ou seja,
g1(x) = x e g2(x) = 1.
• E como achar os ’s?
• A ideia do M.Q.M. é que g(x) seja o mais próximo possível de f(x) nos pontos tabelados. Isso
significa que a diferença entre g(x) e f(x) em cada ponto xk deve ser mínima, ou seja,
𝑑𝑘 = f 𝑥𝑘 − g 𝑥𝑘 deve ser mínima.
• O M.Q.M. consiste em minimizar a soma dos quadrados dessas diferenças, isto é:
෍
𝑘=1
𝑚
𝑓 𝑥𝑘 − 𝑔(𝑥𝑘) 2
Vamos chamar essa diferença de F(1, 2,..., n). Então:
F(α1, α2, … , α𝑛) = ෍
𝑘=1
𝑚
𝑓 𝑥𝑘 − 𝑔(𝑥𝑘) 2
F(α1, α2, … , α𝑛) = ෍
𝑘=1
𝑚
𝑓 𝑥𝑘 − 𝛼1. 𝑔1 𝑥𝑘 − 𝛼2. 𝑔2 𝑥𝑘 − ⋯ − 𝛼𝑛. 𝑔𝑛 𝑥𝑘
2
Sabemos que para obter um ponto de mínimo de F(1, 2,..., n) temos que
determinar seus pontos críticos, isto é,
𝜕𝐹 𝛼1,𝛼2,…,𝛼𝑛
𝜕𝛼𝑖
= 0 para i = 1,2,...,n [1]
• Ao desenvolvermos [1] para cada derivada parcial de i (usando regra da cadeia)
teremos:
𝜕𝐹 𝛼1,𝛼2,…,𝛼𝑛
𝜕𝛼𝑖
= 2. σ𝑘=1
𝑚
𝑓 𝑥𝑘 − 𝛼1. 𝑔1 𝑥𝑘 − ⋯ − 𝛼𝑛. 𝑔𝑛 𝑥𝑘 . (−𝑔𝑖(𝑥𝑘))
• Ao desenvolvermos [1] para cada derivada parcial de i (usando regra da cadeia) teremos:
𝜕𝐹 𝛼1,𝛼2,…,𝛼𝑛
𝜕𝛼𝑖
= 2. σ𝑘=1
𝑚
𝑓 𝑥𝑘 − 𝛼1. 𝑔1 𝑥𝑘 − ⋯ − 𝛼𝑛. 𝑔𝑛 𝑥𝑘 . (−𝑔𝑖(𝑥𝑘))
Fazendo para todos os ’s e agrupando teremos um sistema linear em  com n equações e n
incógnitas (os ’s )
A. = b onde A = [aij]nxn e b = [bi] são dados por:
𝑎𝑖𝑗 = ෍
𝑘=1
𝑚
𝑔𝑖 𝑥𝑘 . 𝑔𝑗 𝑥𝑘 = 𝑎𝑗𝑖
(matriz A é simétrica)
𝑏𝑖 = ෍
𝑘=1
𝑚
𝑔𝑖 𝑥𝑘 . 𝑓(𝑥𝑘)
• E os ’s serão obtidos resolvendo um sistema linear por algum método que já conhecem.
• Vamos ver um Exemplo.
• Exemplo: Considere a tabela:
Aproximar f(x) usando M.Q.M.
a) uma reta
b) um polinômio de grau 2 completo (ou parábola completa)
130
135
140
145
150
155
160
0 0,05 0,1 0,15 0,2 0,25 0,3 0,35
f(x)
x f(x)
0 132
0,2 148
0,3 157
a) para o caso da reta temos que g(x) = 1.x + 2.1 então g1(x) = x e g2(x) = 1
Vamos montar um sistema 2x2 (sempre é um sistema quadrado)
𝑎11 𝑎12
𝑎21 𝑎22
.
1
2
=
𝑏1
𝑏2
Vamos calcular
𝑎11 =
𝑎12 =
𝑎22 =
b1 =
b2 =
a) para o caso da reta temos que g(x) = 1.x + 2.1 então g1(x) = x e g2(x) = 1
Vamos montar um sistema 2x2 (sempre é um sistema quadrado)
𝑎11 𝑎12
𝑎21 𝑎22
.
1
2
=
𝑏1
𝑏2
Vamos calcular
𝑎11 = ෍
𝑘=1
3
𝑔1 𝑥𝑘 . 𝑔1 𝑥𝑘 = ෍
𝑘=1
3
𝑥𝑘. 𝑥𝑘 = 0.0 + 0,2.0,2 + 0,3.0,3 = 0,13
𝑎12 = ෍
𝑘=1
3
𝑔1 𝑥𝑘 . 𝑔2 𝑥𝑘 = ෍
𝑘=1
3
𝑥𝑘. 1 = 0.1 + 0,2.1 + 0,3.1 = 0,5 = 𝑎21
𝑎22 = ෍
𝑘=1
3
𝑔2 𝑥𝑘 . 𝑔2 𝑥𝑘 = ෍
𝑘=1
3
1. 1 = 1.1 + 1.1 + 1.1 = 3
b1 = ෍
𝑘=1
3
𝑓 𝑥𝑘 . 𝑔1 𝑥𝑘 = ෍
𝑘=1
3
𝑓 𝑥𝑘 . 𝑥𝑘 = 132.0 + 148.0,2 + 157.0,3 = 76,7
b2 = σ𝑘=1
3
𝑓 𝑥𝑘 . 𝑔2 𝑥𝑘 = σ𝑘=1
3
𝑓 𝑥𝑘 . 1 = 132.1 + 148.1 + 157.1 = 437
0,13 0,5
0,5 3
.
1
2
=
76,7
437
Resolvendo o sistema linear:
0,13. 1+0,5. 2 = 76,7
0,5. 1+ 3. 2 = 437
Por adição (L1 *-6 + L2) -0,28. 1 = -23,2  1=82,86 e 2=131,86.
Então a reta que melhor aproxima aqueles pontos é g(x) = 82,86.x + 131,86
b) para o caso da parábola completa temos que g(x) = 1.x2 + 2.x + 3.1 então
g1(x) = x2 , g2(x) = x e g3(x) = 1
Vamos montar um sistema 3x3
𝑎11 𝑎12 𝑎13
𝑎21 𝑎22 𝑎23
𝑎31 𝑎32 𝑎33
.
1
2
3
=
𝑏1
𝑏2
𝑏3
E calcular cada valor
0,0097 0,035 0,13
0,035 0,13 0,5
0,13 0,5 3
.
1
2
3
=
20,05
76,7
437
Atenção: o número de casas decimais influencia muito na resposta. Usando 4
casas decimais o resultado é: g(x) = 27,4217.x2 + 75,1006.x + 131,9653
Vamos ver usando Excel
Excel – monta tabela/marca os dados/ inserir gráfico de
dispersão/clicar em um dos pontos do gráfico com lado direito do
mouse/adicionar linha de tendência + escolher modelo de ajuste +
mostrar equação no gráfico + mostrar R2.
R2 – coeficiente de determinação. Mede a qualidade do ajuste
obtido, ou seja, mede o ajustamento de um modelo em relação aos
valores plotados. Varia de 0≤R2≤1. Quanto mais perto de 1 melhor o
ajuste!!
Vejam que no Excel o item b) do exemplo vai dar
g(x) = 33,333.x2 + 73,333.x + 132
Temos vários tipos de ajuste no Excel.
Obs: Exs da Lista 4 - com parábola incompleta só usaremos 2
alfas (Ex1, Ex2 b), Ex 4)

More Related Content

What's hot

Methods3 types of functions1
Methods3  types of functions1Methods3  types of functions1
Methods3 types of functions1kmcmullen
 
6.4 Graphing Polynomials (Relative Max/Min, Zeros)
6.4 Graphing Polynomials (Relative Max/Min, Zeros)6.4 Graphing Polynomials (Relative Max/Min, Zeros)
6.4 Graphing Polynomials (Relative Max/Min, Zeros)swartzje
 
Quadratic functions
Quadratic functionsQuadratic functions
Quadratic functionsIvy Estrella
 
6.2 vertex form
6.2 vertex form6.2 vertex form
6.2 vertex formhisema01
 
Area between curves
Area between curvesArea between curves
Area between curvesShaun Wilson
 
Area between curves
Area between curvesArea between curves
Area between curvesdjfromal
 
Functions 1 - Math Academy - JC H2 maths A levels
Functions 1 - Math Academy - JC H2 maths A levelsFunctions 1 - Math Academy - JC H2 maths A levels
Functions 1 - Math Academy - JC H2 maths A levelsMath Academy Singapore
 
Definite Integral Review
Definite Integral ReviewDefinite Integral Review
Definite Integral ReviewSharon Henry
 
Areas between curves
Areas between curvesAreas between curves
Areas between curvesMoloyGorai
 
Area Under the Curve
Area Under the CurveArea Under the Curve
Area Under the Curvealexbeja
 
Lesson 10 techniques of integration
Lesson 10 techniques of integrationLesson 10 techniques of integration
Lesson 10 techniques of integrationLawrence De Vera
 
3 Forms Of A Quadratic Function
3 Forms Of A Quadratic Function3 Forms Of A Quadratic Function
3 Forms Of A Quadratic Functionguestc8e5bb
 
Quadratics Final
Quadratics FinalQuadratics Final
Quadratics Finalpelican24
 

What's hot (17)

Methods3 types of functions1
Methods3  types of functions1Methods3  types of functions1
Methods3 types of functions1
 
6.4 Graphing Polynomials (Relative Max/Min, Zeros)
6.4 Graphing Polynomials (Relative Max/Min, Zeros)6.4 Graphing Polynomials (Relative Max/Min, Zeros)
6.4 Graphing Polynomials (Relative Max/Min, Zeros)
 
Quadratic functions
Quadratic functionsQuadratic functions
Quadratic functions
 
6.2 vertex form
6.2 vertex form6.2 vertex form
6.2 vertex form
 
Quadratic
QuadraticQuadratic
Quadratic
 
Area between curves
Area between curvesArea between curves
Area between curves
 
Graphing polynomials
Graphing polynomialsGraphing polynomials
Graphing polynomials
 
Area between curves
Area between curvesArea between curves
Area between curves
 
Functions 1 - Math Academy - JC H2 maths A levels
Functions 1 - Math Academy - JC H2 maths A levelsFunctions 1 - Math Academy - JC H2 maths A levels
Functions 1 - Math Academy - JC H2 maths A levels
 
L6 continuity
L6 continuityL6 continuity
L6 continuity
 
Definite Integral Review
Definite Integral ReviewDefinite Integral Review
Definite Integral Review
 
Areas between curves
Areas between curvesAreas between curves
Areas between curves
 
Area Under the Curve
Area Under the CurveArea Under the Curve
Area Under the Curve
 
Lesson 10 techniques of integration
Lesson 10 techniques of integrationLesson 10 techniques of integration
Lesson 10 techniques of integration
 
3 Forms Of A Quadratic Function
3 Forms Of A Quadratic Function3 Forms Of A Quadratic Function
3 Forms Of A Quadratic Function
 
Secant Method
Secant MethodSecant Method
Secant Method
 
Quadratics Final
Quadratics FinalQuadratics Final
Quadratics Final
 

Similar to Mqm em

Natural and Clamped Cubic Splines
Natural and Clamped Cubic SplinesNatural and Clamped Cubic Splines
Natural and Clamped Cubic SplinesMark Brandao
 
WEEK-4-Piecewise-Function-and-Rational-Function.pptx
WEEK-4-Piecewise-Function-and-Rational-Function.pptxWEEK-4-Piecewise-Function-and-Rational-Function.pptx
WEEK-4-Piecewise-Function-and-Rational-Function.pptxExtremelyDarkness2
 
Analytic Geometry Period 1
Analytic Geometry Period 1Analytic Geometry Period 1
Analytic Geometry Period 1ingroy
 
Matlab lab manual
Matlab lab manualMatlab lab manual
Matlab lab manualnmahi96
 
Numeros reales y_plano_numerico1.1_compressed
Numeros reales y_plano_numerico1.1_compressedNumeros reales y_plano_numerico1.1_compressed
Numeros reales y_plano_numerico1.1_compressedAntonelaSantana1
 
Calculus And Its Applications 10th Edition Bittinger Solutions Manual
Calculus And Its Applications 10th Edition Bittinger Solutions ManualCalculus And Its Applications 10th Edition Bittinger Solutions Manual
Calculus And Its Applications 10th Edition Bittinger Solutions Manualfujumazaja
 
De la grafica a la funcion
De la grafica a la funcionDe la grafica a la funcion
De la grafica a la funcionAna Faraco
 
INTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxINTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxDevaraj Chilakala
 
Maths iii quick review by Dr Asish K Mukhopadhyay
Maths iii quick review by Dr Asish K MukhopadhyayMaths iii quick review by Dr Asish K Mukhopadhyay
Maths iii quick review by Dr Asish K MukhopadhyayDr. Asish K Mukhopadhyay
 
Solutions Manual for College Algebra Concepts Through Functions 3rd Edition b...
Solutions Manual for College Algebra Concepts Through Functions 3rd Edition b...Solutions Manual for College Algebra Concepts Through Functions 3rd Edition b...
Solutions Manual for College Algebra Concepts Through Functions 3rd Edition b...RhiannonBanksss
 
C2 st lecture 2 handout
C2 st lecture 2 handoutC2 st lecture 2 handout
C2 st lecture 2 handoutfatima d
 
6.7 quadratic inequalities
6.7 quadratic inequalities6.7 quadratic inequalities
6.7 quadratic inequalitiesJessica Garcia
 
Introduction to Functions
Introduction to FunctionsIntroduction to Functions
Introduction to FunctionsMelanie Loslo
 

Similar to Mqm em (20)

Prova global 2 correção
Prova global 2 correçãoProva global 2 correção
Prova global 2 correção
 
Natural and Clamped Cubic Splines
Natural and Clamped Cubic SplinesNatural and Clamped Cubic Splines
Natural and Clamped Cubic Splines
 
Act_Fin_RMT
Act_Fin_RMTAct_Fin_RMT
Act_Fin_RMT
 
WEEK-4-Piecewise-Function-and-Rational-Function.pptx
WEEK-4-Piecewise-Function-and-Rational-Function.pptxWEEK-4-Piecewise-Function-and-Rational-Function.pptx
WEEK-4-Piecewise-Function-and-Rational-Function.pptx
 
Act_Fin_IAMT
Act_Fin_IAMTAct_Fin_IAMT
Act_Fin_IAMT
 
Analytic Geometry Period 1
Analytic Geometry Period 1Analytic Geometry Period 1
Analytic Geometry Period 1
 
Matlab lab manual
Matlab lab manualMatlab lab manual
Matlab lab manual
 
Numeros reales y_plano_numerico1.1_compressed
Numeros reales y_plano_numerico1.1_compressedNumeros reales y_plano_numerico1.1_compressed
Numeros reales y_plano_numerico1.1_compressed
 
Calculus And Its Applications 10th Edition Bittinger Solutions Manual
Calculus And Its Applications 10th Edition Bittinger Solutions ManualCalculus And Its Applications 10th Edition Bittinger Solutions Manual
Calculus And Its Applications 10th Edition Bittinger Solutions Manual
 
De la grafica a la funcion
De la grafica a la funcionDe la grafica a la funcion
De la grafica a la funcion
 
INTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxINTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptx
 
Quadratic equations
Quadratic equationsQuadratic equations
Quadratic equations
 
Maths iii quick review by Dr Asish K Mukhopadhyay
Maths iii quick review by Dr Asish K MukhopadhyayMaths iii quick review by Dr Asish K Mukhopadhyay
Maths iii quick review by Dr Asish K Mukhopadhyay
 
Solutions Manual for College Algebra Concepts Through Functions 3rd Edition b...
Solutions Manual for College Algebra Concepts Through Functions 3rd Edition b...Solutions Manual for College Algebra Concepts Through Functions 3rd Edition b...
Solutions Manual for College Algebra Concepts Through Functions 3rd Edition b...
 
C2 st lecture 2 handout
C2 st lecture 2 handoutC2 st lecture 2 handout
C2 st lecture 2 handout
 
6.7 quadratic inequalities
6.7 quadratic inequalities6.7 quadratic inequalities
6.7 quadratic inequalities
 
Introduction to Functions
Introduction to FunctionsIntroduction to Functions
Introduction to Functions
 
Recurrence
RecurrenceRecurrence
Recurrence
 
Anderson expresiones
Anderson expresionesAnderson expresiones
Anderson expresiones
 
Ca 1.6
Ca 1.6Ca 1.6
Ca 1.6
 

Recently uploaded

Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 

Recently uploaded (20)

Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 

Mqm em

  • 1. Método dos Quadrados Mínimos Lista 4 no Canvas
  • 2. Método dos Quadrados Mínimos (ou Mínimos Quadrados) Vimos que a interpolação polinomial pode ser usada para aproximar uma função por outra. Usamos quando: 1) não temos a expressão da função (só um conjunto de pontos tabelados) ou 2) temos a expressão mas ela é bem complicada E queremos obter valores dentro do intervalo de tabelamento. A interpolação polinomial respeita a igualdade pn(xi) = f(xi) onde xi são os pontos escolhidos para a aproximação.
  • 3. Porém a interpolação não é aconselhável quando: a) queremos prever um valor fora do intervalo de tabelamento ou b) queremos por exemplo usar 10 pontos para aproximar por uma reta. Como fazer isso? Se a reta só precisa de 2 pontos? Nesses casos vamos usar M.Q.M. → método de ajuste de curvas 0 2 4 6 8 10 12 14 16 18 0 2 4 6 8 10 12 x f(x) 1 1,3 2 3,5 3 4,2 4 5 5 7 6 8,8 7 10,1 8 12,5 9 13 10 15,6
  • 4. Caso Discreto: Dados os pontos tabelados (x1,f(x1)), (x2,f(x2)) , ..., (xm,f(xm)) queremos determinar os coeficientes 1, 2,..., n tal que g(x) se aproxime ao máximo de f(x) nos pontos k = 1, .., m sendo g x = 𝛼1. 𝑔1 𝑥 + 𝛼2. 𝑔2 𝑥 + ⋯ + 𝛼𝑛. 𝑔𝑛 𝑥 • E quem são essas funções gi(x)? São as funções que iremos escolher para aproximar pelo M.Q.M. • Como escolher? Na maioria dos casos olhando o gráfico de dispersão e em alguns casos, se já soubermos o comportamento dos dados, usamos a função pré-escolhida para aproximar. • Olhando o exemplo anterior conseguimos ver que o comportamento do gráfico se parece com uma reta. Nesse caso teremos g(x) = 𝛼1. 𝑥 + 𝛼2. 1 ou seja, g1(x) = x e g2(x) = 1. • E como achar os ’s? • A ideia do M.Q.M. é que g(x) seja o mais próximo possível de f(x) nos pontos tabelados. Isso significa que a diferença entre g(x) e f(x) em cada ponto xk deve ser mínima, ou seja, 𝑑𝑘 = f 𝑥𝑘 − g 𝑥𝑘 deve ser mínima. • O M.Q.M. consiste em minimizar a soma dos quadrados dessas diferenças, isto é:
  • 5. ෍ 𝑘=1 𝑚 𝑓 𝑥𝑘 − 𝑔(𝑥𝑘) 2 Vamos chamar essa diferença de F(1, 2,..., n). Então: F(α1, α2, … , α𝑛) = ෍ 𝑘=1 𝑚 𝑓 𝑥𝑘 − 𝑔(𝑥𝑘) 2 F(α1, α2, … , α𝑛) = ෍ 𝑘=1 𝑚 𝑓 𝑥𝑘 − 𝛼1. 𝑔1 𝑥𝑘 − 𝛼2. 𝑔2 𝑥𝑘 − ⋯ − 𝛼𝑛. 𝑔𝑛 𝑥𝑘 2 Sabemos que para obter um ponto de mínimo de F(1, 2,..., n) temos que determinar seus pontos críticos, isto é, 𝜕𝐹 𝛼1,𝛼2,…,𝛼𝑛 𝜕𝛼𝑖 = 0 para i = 1,2,...,n [1]
  • 6. • Ao desenvolvermos [1] para cada derivada parcial de i (usando regra da cadeia) teremos: 𝜕𝐹 𝛼1,𝛼2,…,𝛼𝑛 𝜕𝛼𝑖 = 2. σ𝑘=1 𝑚 𝑓 𝑥𝑘 − 𝛼1. 𝑔1 𝑥𝑘 − ⋯ − 𝛼𝑛. 𝑔𝑛 𝑥𝑘 . (−𝑔𝑖(𝑥𝑘))
  • 7. • Ao desenvolvermos [1] para cada derivada parcial de i (usando regra da cadeia) teremos: 𝜕𝐹 𝛼1,𝛼2,…,𝛼𝑛 𝜕𝛼𝑖 = 2. σ𝑘=1 𝑚 𝑓 𝑥𝑘 − 𝛼1. 𝑔1 𝑥𝑘 − ⋯ − 𝛼𝑛. 𝑔𝑛 𝑥𝑘 . (−𝑔𝑖(𝑥𝑘)) Fazendo para todos os ’s e agrupando teremos um sistema linear em  com n equações e n incógnitas (os ’s ) A. = b onde A = [aij]nxn e b = [bi] são dados por: 𝑎𝑖𝑗 = ෍ 𝑘=1 𝑚 𝑔𝑖 𝑥𝑘 . 𝑔𝑗 𝑥𝑘 = 𝑎𝑗𝑖 (matriz A é simétrica) 𝑏𝑖 = ෍ 𝑘=1 𝑚 𝑔𝑖 𝑥𝑘 . 𝑓(𝑥𝑘)
  • 8. • E os ’s serão obtidos resolvendo um sistema linear por algum método que já conhecem. • Vamos ver um Exemplo. • Exemplo: Considere a tabela: Aproximar f(x) usando M.Q.M. a) uma reta b) um polinômio de grau 2 completo (ou parábola completa) 130 135 140 145 150 155 160 0 0,05 0,1 0,15 0,2 0,25 0,3 0,35 f(x) x f(x) 0 132 0,2 148 0,3 157
  • 9. a) para o caso da reta temos que g(x) = 1.x + 2.1 então g1(x) = x e g2(x) = 1 Vamos montar um sistema 2x2 (sempre é um sistema quadrado) 𝑎11 𝑎12 𝑎21 𝑎22 . 1 2 = 𝑏1 𝑏2 Vamos calcular 𝑎11 = 𝑎12 = 𝑎22 =
  • 11. a) para o caso da reta temos que g(x) = 1.x + 2.1 então g1(x) = x e g2(x) = 1 Vamos montar um sistema 2x2 (sempre é um sistema quadrado) 𝑎11 𝑎12 𝑎21 𝑎22 . 1 2 = 𝑏1 𝑏2 Vamos calcular 𝑎11 = ෍ 𝑘=1 3 𝑔1 𝑥𝑘 . 𝑔1 𝑥𝑘 = ෍ 𝑘=1 3 𝑥𝑘. 𝑥𝑘 = 0.0 + 0,2.0,2 + 0,3.0,3 = 0,13 𝑎12 = ෍ 𝑘=1 3 𝑔1 𝑥𝑘 . 𝑔2 𝑥𝑘 = ෍ 𝑘=1 3 𝑥𝑘. 1 = 0.1 + 0,2.1 + 0,3.1 = 0,5 = 𝑎21 𝑎22 = ෍ 𝑘=1 3 𝑔2 𝑥𝑘 . 𝑔2 𝑥𝑘 = ෍ 𝑘=1 3 1. 1 = 1.1 + 1.1 + 1.1 = 3
  • 12. b1 = ෍ 𝑘=1 3 𝑓 𝑥𝑘 . 𝑔1 𝑥𝑘 = ෍ 𝑘=1 3 𝑓 𝑥𝑘 . 𝑥𝑘 = 132.0 + 148.0,2 + 157.0,3 = 76,7 b2 = σ𝑘=1 3 𝑓 𝑥𝑘 . 𝑔2 𝑥𝑘 = σ𝑘=1 3 𝑓 𝑥𝑘 . 1 = 132.1 + 148.1 + 157.1 = 437 0,13 0,5 0,5 3 . 1 2 = 76,7 437 Resolvendo o sistema linear: 0,13. 1+0,5. 2 = 76,7 0,5. 1+ 3. 2 = 437 Por adição (L1 *-6 + L2) -0,28. 1 = -23,2  1=82,86 e 2=131,86. Então a reta que melhor aproxima aqueles pontos é g(x) = 82,86.x + 131,86
  • 13. b) para o caso da parábola completa temos que g(x) = 1.x2 + 2.x + 3.1 então g1(x) = x2 , g2(x) = x e g3(x) = 1 Vamos montar um sistema 3x3 𝑎11 𝑎12 𝑎13 𝑎21 𝑎22 𝑎23 𝑎31 𝑎32 𝑎33 . 1 2 3 = 𝑏1 𝑏2 𝑏3 E calcular cada valor 0,0097 0,035 0,13 0,035 0,13 0,5 0,13 0,5 3 . 1 2 3 = 20,05 76,7 437 Atenção: o número de casas decimais influencia muito na resposta. Usando 4 casas decimais o resultado é: g(x) = 27,4217.x2 + 75,1006.x + 131,9653 Vamos ver usando Excel
  • 14. Excel – monta tabela/marca os dados/ inserir gráfico de dispersão/clicar em um dos pontos do gráfico com lado direito do mouse/adicionar linha de tendência + escolher modelo de ajuste + mostrar equação no gráfico + mostrar R2. R2 – coeficiente de determinação. Mede a qualidade do ajuste obtido, ou seja, mede o ajustamento de um modelo em relação aos valores plotados. Varia de 0≤R2≤1. Quanto mais perto de 1 melhor o ajuste!! Vejam que no Excel o item b) do exemplo vai dar g(x) = 33,333.x2 + 73,333.x + 132 Temos vários tipos de ajuste no Excel. Obs: Exs da Lista 4 - com parábola incompleta só usaremos 2 alfas (Ex1, Ex2 b), Ex 4)