 1 More Mathematics: Finding Minimum. Numerical Optimization Find the minimum of If a given function is continuous and differentiable, find the root.

Slides:



Advertisements
Similar presentations
Applied Informatics Štefan BEREŽNÝ
Advertisements

Component Analysis (Review)
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Curve Fitting ~ Least Squares Regression Chapter.
Chapter 10 Curve Fitting and Regression Analysis
Mathematics and Graphing in Chemistry Lab 1. Outline Mathematics in Chemistry Units Rounding Digits of Precision (Addition and Subtraction) Significant.
1er. Escuela Red ProTIC - Tandil, de Abril, 2006 Principal component analysis (PCA) is a technique that is useful for the compression and classification.
Definition  Regression Model  Regression Equation Y i =  0 +  1 X i ^ Given a collection of paired data, the regression equation algebraically describes.
P M V Subbarao Professor Mechanical Engineering Department
Regression Analysis Using Excel. Econometrics Econometrics is simply the statistical analysis of economic phenomena Here, we just summarize some of the.
Chapter 1 Computing Tools Data Representation, Accuracy and Precision Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
An introduction to Principal Component Analysis (PCA)
Lecture 3 Cameron Kaplan
Linear Transformations
Chapter 5 Orthogonality
L16: Micro-array analysis Dimension reduction Unsupervised clustering.
The Terms that You Have to Know! Basis, Linear independent, Orthogonal Column space, Row space, Rank Linear combination Linear transformation Inner product.
Ordinary least squares regression (OLS)
Basic Mathematics for Portfolio Management. Statistics Variables x, y, z Constants a, b Observations {x n, y n |n=1,…N} Mean.
ON MULTIVARIATE POLYNOMIAL INTERPOLATION
Analysis of Individual Variables Descriptive – –Measures of Central Tendency Mean – Average score of distribution (1 st moment) Median – Middle score (50.
Linear regression models in matrix terms. The regression function in matrix terms.
Relationships Among Variables
Autar Kaw Humberto Isaza
Lecture 3-2 Summarizing Relationships among variables ©
Linear Regression.
October 8, 2013Computer Vision Lecture 11: The Hough Transform 1 Fitting Curve Models to Edges Most contours can be well described by combining several.
Preview of Calculus.
Answering Descriptive Questions in Multivariate Research When we are studying more than one variable, we are typically asking one (or more) of the following.
Least-Squares Regression
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Curve Fitting ~ Least Squares Regression Chapter.
Relationship of two variables
Summarized by Soo-Jin Kim
Machine Learning CUNY Graduate Center Lecture 3: Linear Regression.
Chapter 9 Superposition and Dynamic Programming 1 Chapter 9 Superposition and dynamic programming Most methods for comparing structures use some sorts.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 4 Curve Fitting.
Applications The General Linear Model. Transformations.
Statistics and Linear Algebra (the real thing). Vector A vector is a rectangular arrangement of number in several rows and one column. A vector is denoted.
Correlation is a statistical technique that describes the degree of relationship between two variables when you have bivariate data. A bivariate distribution.
Section 2.7 – Absolute Value The table shows the numbers of hours students spent online the day before a test and the scores on the test. Make a scatter.
MECN 3500 Inter - Bayamon Lecture 9 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
1 Chapter 12 Simple Linear Regression. 2 Chapter Outline  Simple Linear Regression Model  Least Squares Method  Coefficient of Determination  Model.
3.2 Least Squares Regression Line. Regression Line Describes how a response variable changes as an explanatory variable changes Formula sheet: Calculator.
© Copyright McGraw-Hill Correlation and Regression CHAPTER 10.
What is the determinant of What is the determinant of
Chapter 10: Determining How Costs Behave 1 Horngren 13e.
Principle Component Analysis and its use in MA clustering Lecture 12.
OLS Regression What is it? Closely allied with correlation – interested in the strength of the linear relationship between two variables One variable is.
MathematicalMarketing Slide 5.1 OLS Chapter 5: Ordinary Least Square Regression We will be discussing  The Linear Regression Model  Estimation of the.
Presented by: Muhammad Wasif Laeeq (BSIT07-1) Muhammad Aatif Aneeq (BSIT07-15) Shah Rukh (BSIT07-22) Mudasir Abbas (BSIT07-34) Ahmad Mushtaq (BSIT07-45)
Computer Graphics Mathematical Fundamentals Lecture 10 Taqdees A. Siddiqi
Correlation and Regression. O UTLINE Introduction  10-1 Scatter plots.  10-2 Correlation.  10-3 Correlation Coefficient.  10-4 Regression.
Fundamentals of Data Analysis Lecture 11 Methods of parametric estimation.
Lecture XXVII. Orthonormal Bases and Projections Suppose that a set of vectors {x 1,…,x r } for a basis for some space S in R m space such that r  m.
Introduction to Vectors and Matrices
Linear Algebra Review.
Principal Component Analysis
Practice. Practice Practice Practice Practice r = X = 20 X2 = 120 Y = 19 Y2 = 123 XY = 72 N = 4 (4) 72.
Principal Component Analysis (PCA)
Fitting Curve Models to Edges
REGRESSION.
ECE 417 Lecture 4: Multivariate Gaussians
EMIS 7300 SYSTEMS ANALYSIS METHODS FALL 2005
5.4 General Linear Least-Squares
Least-Squares Regression
Correlation and Regression
Discrete Least Squares Approximation
Numerical Analysis Lecture 17.
Maths for Signals and Systems Linear Algebra in Engineering Lectures 13 – 14, Tuesday 8th November 2016 DR TANIA STATHAKI READER (ASSOCIATE PROFFESOR)
Introduction to Vectors and Matrices
Principal Component Analysis
Presentation transcript:

 1 More Mathematics: Finding Minimum

Numerical Optimization Find the minimum of If a given function is continuous and differentiable, find the root of the derivative How could we do this by using loops? =) 2

Why we need numerical optimization? The derivative of a function is not always available. The bisection algorithm cannot be used to find a minimum of a function. Root finding for a multi-variate function is usually out of interest because in general a root value is not a point but a hyperspace. Many many many real problems are reduced to the optimization. 3

Line (or linear) search At the minimum, Find any x with sufficiently small h. The precision is limited by the chosen h 4

Application of minimization The definition of an average A number that minimizes the squared sum of deviations. 5

Application of minimization Example

7

Application of minimization What is the minimum of the absolute sum of deviation do you think? 8

Minimization of multi-variate functions A linear search can find only a minimum of a uni-variate or one-dimensional function. What if we have two dimensional or more variables? For example, find the average of point sets. Automatic face tracking Linear regression 9

Linear Regression Sample Data 10 Hours Spent Studying Math SAT Score

Linear Regression Scatter Plot X-axis : Hours spent for the math study Y-axis: The math SAT score 11

Linear Regression The goal is to find the best line to describe the trend of a given data. 12

Linear Regression Let’s take a mathematical approach The equation of a line graph: The slope is a, and the intercept is b. The unknowns are a and b not x and y. The line is a set of points that satisfies 13

Line Equation between Two Points 14 The line equation between two points Why? The two points must satisfy the system of linear equations:

Line Equation between Two Points These two equations arranged into The slope is computed as Putting a into the one of those equation results in b. 15

16

Is This Enough? The quantitative answer is Yes. But, the qualitative answer is no. By the quantitative analysis, it shows a similar trend with the given data. By the qualitative analysis, we should ask first what is the measure of accuracy (or goodness)? 17

Accuracy of the line graph How can we measure the accuracy of the line graph? In 1-dimensional case, we computed the deviation. We should remember the slide following. 18

Application of minimization Example Closely look at the It is the square of the distance between x_i and x.

Accuracy of the line graph We can use the distance between each data point and a line we are seeking with for loop. The distance between a point and a line is given as Why?

Accuracy of the line graph As we computed the average by numerical minimization, Let us compute the best slope and intercept that minimizes the distance between each point and the line.

Namely, the best data line How to compute the minimum of F(a,b) with respect to a and b? What is the derivative of F(a,b)? There should be two derivative functions One with respect to a Another with respect to b 22

23

SciPY Helps! There are provided functions for minimization (or optimization) with scipy package. Please refer the document There are functions not using the derivative, fprime. fmin(func, x0) fmin_powell(func, x0) Most optimization can be more efficient using derivatives. 24

 25 Demo for scipy.optimize

Understanding the landscape The space of a and b Which plot do you think most appropriate or helpful? Let us use contourf() function 26

 27 Ain't over til it's over

Matrix Diagonalization A matrix – vector operation creates another vector. Did you have any curiosity where vectors go? Where a circle goes? 28

Matrix Diagonalization 29 Matrix – Matrix multiplication Easy to compute row vectors individually How to create a matrix? NP.hstack(), NP.vstack()

 30 Recitation for Matrix Diagonalization

Matrix Diagonalization A circle has transformed into an ellipse! 31

Matrix Diagonalization Each matrix maps a vector into another vector by multiplication. Create a sequence of vectors by multiplication. After linear scaling with the maximum element in A^j x 32

33

Matrix Diagonalization Observation Every vector converges to a major vector. The major principal direction is The minor principal direction is orthogonal to the major principal direction. The minor principal direction is not obvious in the plot though but indeed exists. 34

Diagonal Matrix A diagonal matrix has its elements only at the diagonal indices. Playing with normal (or unit) vectors. 35

36 What is the major principal vector in this plot?

Matrix Diagonalization What is the difference between A and D? The off-diagonal elements are different. In the previous example, we multiplied 32 sample points from a circle to the matrix A. What was the minimum scaling? What was the maximum scaling? 37

Matrix Diagonalization: Question In the previous example, we multiplied 32 sample points from a circle to the matrix A. What was the minimum scaling after multiplying A to xy? What was the maximum scaling after multiplying A to xy? What degrees were corresponding points rotated? 38