Linear Algebra Curve Fitting. Last Class: Curve Fitting.

Slides:



Advertisements
Similar presentations
Pattern Recognition and Machine Learning
Advertisements

Polynomial Curve Fitting BITS C464/BITS F464 Navneet Goyal Department of Computer Science, BITS-Pilani, Pilani Campus, India.
Pattern Recognition and Machine Learning
Pattern Recognition and Machine Learning: Kernel Methods.
Data mining and statistical learning - lecture 6
Data mining in 1D: curve fitting
1cs542g-term High Dimensional Data  So far we’ve considered scalar data values f i (or interpolated/approximated each component of vector values.
Signal , Weight Vector Spaces and Linear Transformations
Signal , Weight Vector Spaces and Linear Transformations
Chapter 5 Orthogonality
3D Geometry for Computer Graphics. 2 The plan today Least squares approach  General / Polynomial fitting  Linear systems of equations  Local polynomial.
Curve-Fitting Regression
Reduced Support Vector Machine
NOTES ON MULTIPLE REGRESSION USING MATRICES  Multiple Regression Tony E. Smith ESE 502: Spatial Data Analysis  Matrix Formulation of Regression  Applications.
Machine Learning CUNY Graduate Center Lecture 3: Linear Regression.
Lecture 12 Projection and Least Square Approximation Shang-Hua Teng.
Bioinformatics Challenge  Learning in very high dimensions with very few samples  Acute leukemia dataset: 7129 # of gene vs. 72 samples  Colon cancer.
Lecture 12 Least Square Approximation Shang-Hua Teng.
ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW II.
6 6.3 © 2012 Pearson Education, Inc. Orthogonality and Least Squares ORTHOGONAL PROJECTIONS.
Basic Mathematics for Portfolio Management. Statistics Variables x, y, z Constants a, b Observations {x n, y n |n=1,…N} Mean.
1cs542g-term Notes  Extra class next week (Oct 12, not this Friday)  To submit your assignment: me the URL of a page containing (links to)
Summarized by Soo-Jin Kim
Introduction Mohammad Beigi Department of Biomedical Engineering Isfahan University
PATTERN RECOGNITION AND MACHINE LEARNING
Machine Learning CUNY Graduate Center Lecture 3: Linear Regression.
MA2213 Lecture 5 Linear Equations (Direct Solvers)
CHAPTER FIVE Orthogonality Why orthogonal? Least square problem Accuracy of Numerical computation.
11 CSE 4705 Artificial Intelligence Jinbo Bi Department of Computer Science & Engineering
4.1 Vector Spaces and Subspaces 4.2 Null Spaces, Column Spaces, and Linear Transformations 4.3 Linearly Independent Sets; Bases 4.4 Coordinate systems.
AN ORTHOGONAL PROJECTION
PATTERN RECOGNITION AND MACHINE LEARNING CHAPTER 3: LINEAR MODELS FOR REGRESSION.
Section 5.1 Length and Dot Product in ℝ n. Let v = ‹v 1­­, v 2, v 3,..., v n › and w = ‹w 1­­, w 2, w 3,..., w n › be vectors in ℝ n. The dot product.
Geometry of Shape Manifolds
Bias and Variance of the Estimator PRML 3.2 Ethem Chp. 4.
Lecture 16 - Approximation Methods CVEN 302 July 15, 2002.
1 EEE 431 Computational Methods in Electrodynamics Lecture 18 By Dr. Rasime Uyguroglu
Review of fundamental 1 Data mining in 1D: curve fitting by LLS Approximation-generalization tradeoff First homework assignment.
Over-fitting and Regularization Chapter 4 textbook Lectures 11 and 12 on amlbook.com.
Bias and Variance of the Estimator PRML 3.2 Ethem Chp. 4.
Machine Learning CUNY Graduate Center Lecture 6: Linear Regression II.
Matrix Factorization & Singular Value Decomposition Bamshad Mobasher DePaul University Bamshad Mobasher DePaul University.
ETHEM ALPAYDIN © The MIT Press, Lecture Slides for.
PATTERN RECOGNITION AND MACHINE LEARNING CHAPTER 1: INTRODUCTION.
REVIEW Linear Combinations Given vectors and given scalars
MTH108 Business Math I Lecture 20.
Introduction The central problems of Linear Algebra are to study the properties of matrices and to investigate the solutions of systems of linear equations.
Probability Theory and Parameter Estimation I
Ch3: Model Building through Regression
Algebra II Explorations Review ( )
CSE 4705 Artificial Intelligence
CH 5: Multivariate Methods
Special Topics In Scientific Computing
Bias and Variance of the Estimator
Matrices Definition: A matrix is a rectangular array of numbers or symbolic elements In many applications, the rows of a matrix will represent individuals.
Collaborative Filtering Matrix Factorization Approach
Linear regression Fitting a straight line to observations.
Signal & Weight Vector Spaces
Linear Algebra Lecture 39.
Pattern Recognition and Machine Learning
Biointelligence Laboratory, Seoul National University
Contact: Machine Learning – (Linear) Regression Wilson Mckerrow (Fenyo lab postdoc) Contact:
Signal & Weight Vector Spaces
Elementary Linear Algebra
Maths for Signals and Systems Linear Algebra in Engineering Lecture 6, Friday 21st October 2016 DR TANIA STATHAKI READER (ASSOCIATE PROFFESOR) IN SIGNAL.
Machine learning overview
Topic 11: Matrix Approach to Linear Regression
Support Vector Machines 2
Approximation of Functions
Approximation of Functions
Presentation transcript:

Linear Algebra Curve Fitting

Last Class: Curve Fitting

Sum-of-Squares Error Function

0 th Order Polynomial

1 st Order Polynomial

3 rd Order Polynomial

9 th Order Polynomial

Over-fitting Root-Mean-Square (RMS) Error:

Polynomial Coefficients

Data Set Size: 9 th Order Polynomial

Data Set Size: 9 th Order Polynomial

Regularization Penalize large coefficient values

Regularization:

Regularization: vs.

Polynomial Coefficients

Methodology Regression Machine Training Regression Machine Update weights w and degree M s.t. min error Regression

Questions ● How to find the curve that best fits the points? ● i.e., how to solve the minimization problem? ● Answer 1: use gnuplot or any other pre-built software (homework) ● Answer 2: recall linear algebra (will see with more details in upcoming class) ● Why solve this particular minimization problem? e.g., why solve this minimization problem rather than doing linear interpolation? Principled answer follows...

Linear Algebra ● To find curve that best fits points: apply basic concepts from linear algebra ● What is linear algebra? ● The study of vector spaces ● What are vector spaces? ● Set of elements that can be ● Summed ● Multiplied by scalar Operation is well defined

Linear Algebra=Study of Vectors ● Examples of vectors ● [0,1,0,2] ● ● Signals ● Signals are vectors!

Dimension of Vector Space ● Basis = set of element that span space ● Dimension of line = 1 ● basis = (1,0) ● Dimension of plane = 2 ● basis = {(1,0), (0,1)} ● Dimension of space = 3 ● basis = {(1,0,0), (0,1,0), (0,0,1)} ● Dimension of Space = # Elements Basis

Functions are Vectors I ● Vectors Functions ● Size Size ● x=[x1,x2] y=f(t) ● |x|^2=x1^2+x2^2 |y|^2 = ● Inner product Inner Product ● y=[y1,y2] z=g(t) ● x y = x1 y1 + x2 y2

Signals are Vectors II ● Vectors Functions ● x=[x1,x2] y=f(t) ● BasisBasis ● {[1,0],[1,0]} {1, sin wt, cos wt, sin 2wt, cos 2wt,...} ● Components Components ● x1 coefficients of basis x2 functions

A Very Special Basis ● Vectors Functions ● x=[x1,x2] y=f(t) ● BasisBasis ● {[1,0],[1,0]} {1, sin wt, cos wt, sin 2wt, cos 2wt,...} ● Components Components ● x1 coefficients of basis x2 functions Basis in which each element Is a vector, formed by set of M samples of a function (Subspace of R^M)

Representations Coeff. Basis Representation traditional function sampled function [1,2] [0,1] [1,0] {1, sin(wt), … } [0,2,0] {[1,1,1,1], [1,2,3,4], [1,4,9,16]}

Approximating a Vector I ● e = g - c x ● g' x = |g| |x| cos  ● |x|^2 = x' x ● |g| cos  c |x| e g c x x e1 g c1 x x e2 g c2 x x

Approximating a Vector II ● e = g - c x ● g' x = |g| |x| cos  ● |x|^2 = x' x ● |g| cos  c |x| ● Major result: c = g' x (x' x)^(-1) e g c x x

Approximating a Vector III ● e = g - c x ● g' x = |g| |x| cos  ● |x|^2 = x' x ● |g| cos  c |x| ● c =g'x / |x|^2 ● Major result: c = g' x ((x' x)^(-1))' e g c x Coefficient to compute Given target point (basis matrix coords) Given basis matrix x

Approximating a Vector IV ● e = g - x c ● g' x = |g| |x| cos  ● |x|^2 = x' x ● g' x  x c ● Major result: c = g' x ((x' x)^(-1))' c=vector of computed coefficients g=vector of target points x=basis matrix - each column is a basis elem. - each column is a polynomial evaluated at desired points i-th line of matrix x

Approximating a Vector IV ● e = g - x c ● g' x = |g| |x| cos  ● |x|^2 = x' x ● g' x  x c ● Major result: c = g' x ((x' x)^(-1))' Coefficient to compute Given target point (vector space V) Given basis matrix (elements in basis matrix are in vector space U contained in V) c=vector of computed coefficients g=vector of target points x=basis matrix - each column is a basis elem. - each column is a polynomial evaluated at desired points

Least Square Error Solution! ● As most machine learning problems, least square is equivalent to basis conversion! ● Major result: c = g' x ((x' x)^(-1))' c=vector of computed coefficients g=vector of target points x=basis matrix - each column is a basis elem. - each column is a polynomial evaluated at desired points Coefficients to compute (point in R^M) Given points (element in R^N)

Least Square Error Solution! Space of points in R^N Space of functions in R^M Machine learning algorithm maps to closest

Regularized Least Square ● Major result: c = g' x (( I+x' x)^(-1))' c=vector of computed coefficients g=vector of target points x=basis matrix - each column is a basis elem. - each column is a polynomial evaluated at desired points

Least Squares and Gauss ● How to solve the least square problem? ● Carl Friedrich Gauss solution in 1794 (age 18) ● Why solving the least square problem? ● Carl Friedrich Gauss solution in 1822 (age 46) ● Least square solution is optimal in the sense that it is the best linear unbiased estimator of the coefficients of the polynomials ● Assumptions: errors have zero mean and equal variances ●