Selected from presentations by Jim Ramsay, McGill University, Hongliang Fei, and Brian Quanz Basis Basics.

Slides:



Advertisements
Similar presentations
Numerical Methods.  Polynomial interpolation involves finding a polynomial of order n that passes through the n+1 points.  Several methods to obtain.
Advertisements

Interpolation A method of constructing a function that crosses through a discrete set of known data points. .
Newton’s Divided Difference Polynomial Method of Interpolation
CS 445/645 Fall 2001 Hermite and Bézier Splines. Specifying Curves Control Points –A set of points that influence the curve’s shape Knots –Control points.
Data mining and statistical learning - lecture 6
MATH 685/ CSI 700/ OR 682 Lecture Notes
Basis Expansion and Regularization Presenter: Hongliang Fei Brian Quanz Brian Quanz Date: July 03, 2008.
Chapter 18 Interpolation The Islamic University of Gaza
1 Chapter 4 Interpolation and Approximation Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation.
1 Curve-Fitting Spline Interpolation. 2 Curve Fitting Regression Linear Regression Polynomial Regression Multiple Linear Regression Non-linear Regression.
1 Direct Method of Interpolation Electrical Engineering Majors Authors: Autar Kaw, Jai Paul
ES 240: Scientific and Engineering Computation. InterpolationPolynomial  Definition –a function f(x) that can be written as a finite series of power functions.
Jim Ramsay McGill University Basis Basics. Overview  What are basis functions?  What properties should they have?  How are they usually constructed?
Curve-Fitting Interpolation
Direct Method of Interpolation
Human Growth: From data to functions. Challenges to measuring growth We need repeated and regular access to subjects for up to 20 years. We need repeated.
Chapter 6 Numerical Interpolation
8/15/ Differentiation-Discrete Functions Major: All Engineering Majors Authors: Autar Kaw, Sri Harsha Garapati.
Human Growth: From data to functions. Challenges to measuring growth We need repeated and regular access to subjects for up to 20 years. We need repeated.
CIS V/EE894R/ME894V A Case Study in Computational Science & Engineering HW 5 Repeat the HW associated with the FD LBI except that you will now use.
1 Spline Interpolation Method Computer Engineering Majors Authors: Autar Kaw, Jai Paul
Scientific Computing Linear and Quadratic Splines.
V. Space Curves Types of curves Explicit Implicit Parametric.
Review of Interpolation. A method of constructing a function that crosses through a discrete set of known data points.
1 Interpolation. 2 What is Interpolation ? Given (x 0,y 0 ), (x 1,y 1 ), …… (x n,y n ), find the value of ‘y’ at a.
1 Lagrangian Interpolation Major: All Engineering Majors Authors: Autar Kaw, Jai Paul
Today’s class Spline Interpolation Quadratic Spline Cubic Spline Fourier Approximation Numerical Methods Lecture 21 Prof. Jinbo Bi CSE, UConn 1.
Numerical Methods For Slides Thanks to Lecture 6 Interpolation
Quadratic Spline Interpolation Part 1 of 2
1 Newton’s Divided Difference Polynomial Method of Interpolation Major: All Engineering Majors Authors: Autar Kaw,
Jump to first page Chapter 3 Splines Definition (3.1) : Given a function f defined on [a, b] and a set of numbers, a = x 0 < x 1 < x 2 < ……. < x n = b,
Computer Programming (TKK-2144) 13/14 Semester 1 Instructor: Rama Oktavian Office Hr.: M.13-15, W Th , F
1 Direct Method of Interpolation Major: All Engineering Majors Authors: Autar Kaw, Jai Paul
Mohiuddin Ahmad SUNG-BONG JANG Interpolation II (8.4 SPLINE INTERPOLATION) (8.5 MATLAB’s INTERPOLATION Functions)
1 INTERPOLASI. Direct Method of Interpolation 3 What is Interpolation ? Given (x 0,y 0 ), (x 1,y 1 ), …… (x n,y n ), find the value of ‘y’ at a value.
Spline Interpolation A Primer on the Basics by Don Allen.
CSCE 441: Keyframe Animation/Smooth Curves (Cont.) Jinxiang Chai.
CSCE 441: Keyframe Animation/Smooth Curves (Cont.) Jinxiang Chai.
1 Direct Method of Interpolation Mechanical Engineering Majors Authors: Autar Kaw, Jai Paul
1 Spline Interpolation Method Major: All Engineering Majors Authors: Autar Kaw, Jai Paul
1 Chapter 4 Interpolation and Approximation Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation.
1 Spline Interpolation Method Mechanical Engineering Majors Authors: Autar Kaw, Jai Paul
Curves University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
Basis Expansions and Generalized Additive Models Basis expansion Piecewise polynomials Splines Generalized Additive Model MARS.
Interpolation - Introduction
11/22/ Differentiation-Discrete Functions.
Piecewise Polynomials and Splines
Introduction to Numerical Methods Mathematical Procedures
Curve-Fitting Spline Interpolation
Interpolation.
Chapter 15 Curve Fitting : Splines
Reading Between the Lines
Spline Interpolation Method
Spline Interpolation Method
Spline Interpolation Method
Spline Interpolation Method
Direct Method of Interpolation
Spline Interpolation Method
Human Growth: From data to functions
Spline Interpolation Method
INTERPOLASI.
Why Splines ?
MATH 174: Numerical Analysis I
SKTN 2393 Numerical Methods for Nuclear Engineers
Spline Interpolation Method
Reading Between the Lines
Newton’s Divided Difference Polynomial Method of Interpolation
Lagrangian Interpolation
Presentation transcript:

Selected from presentations by Jim Ramsay, McGill University, Hongliang Fei, and Brian Quanz Basis Basics

1. Introduction Basis: In Linear Algebra, a basis is a set of vectors satisfying:  Linear combination of the basis can represent every vector in a given vector space;  No element of the set can be represented as a linear combination of the others.

In Function Space, Basis is degenerated to a set of basis functions; Each function in the function space can be represented as a linear combination of the basis functions. Example: Quadratic Polynomial bases {1,t,t^2}

What are basis functions? We need flexible method for constructing a function f(t) that can track local curvature. We pick a system of K basis functions φ k (t), and call this the basis for f(t). We express f(t) as a weighted sum of these basis functions: f(t) = a 1 φ 1 (t) + a 2 φ 2 (t) + … + a K φ K (t) The coefficients a 1, …, a K determine the shape of the function.

What do we want from basis functions? Fast computation of individual basis functions. Flexible: can exhibit the required curvature where needed, but also be nearly linear when appropriate. Fast computation of coefficients a k : possible if matrices of values are diagonal, banded or sparse. Differentiable as required: We make lots of use of derivatives in functional data analysis. Constrained as required, such as periodicity, positivity, monotonicity, asymptotes and etc.

What are some commonly used basis functions? Powers: 1, t, t 2, and so on. They are the basis functions for polynomials. These are not very flexible, and are used only for simple problems. Fourier series: 1, sin(ωt), cos(ωt), sin(2ωt), cos(2ωt), and so on for a fixed known frequency ω. These are used for periodic functions. Spline functions: These have now more or less replaced polynomials for non-periodic problems. More explanation follows.

What is Basis Expansion? Given data X and transformation Then we model as a linear basis expansion in X, where is a basis function.

Why Basis Expansion? In regression problems, f(X) will typically nonlinear in X; Linear model is convenient and easy to interpret; When sample size is very small but attribute size is very large, linear model is all what we can do to avoid over fitting.

2. Piecewise Polynomials and Splines Spline:  In Mathematics, a spline is a special function defined piecewise by polynomials;  In Computer Science, the term spline more frequently refers to a piecewise polynomial (parametric) curve. Simple construction, ease and accuracy of evaluation, capacity to approximate complex shapes through curve fitting and interactive curve design.

Assume four knots spline (two boundary knots and two interior knots), also X is one dimensional. Piecewise constant basis: Piecewise Linear Basis:

Basis functions: Six functions corresponding to a six- dimensional linear space. Piecewise Cubic Polynomial

14 Spline Interpolation Method Slides taken from the lecture by Authors: Autar Kaw, Jai Paul

What is Interpolation ? Given (x 0,y 0 ), (x 1,y 1 ), …… (x n,y n ), find the value of ‘y’ at a value of ‘x’ that is not given.

Interpolants Polynomials are the most common choice of interpolants because they are easy to: Evaluate Differentiate, and Integrate.

Why Splines ?

Why Splines ? Figure : Higher order polynomial interpolation is a bad idea

Linear Interpolation

Linear Interpolation (contd)

Example The upward velocity of a rocket is given as a function of time in Table 1. Find the velocity at t=16 seconds using linear splines. Table Velocity as a function of time Figure. Velocity vs. time data for the rocket example (s) (m/s)

Linear Interpolation

Quadratic Interpolation

Quadratic Interpolation (contd)

Quadratic Splines (contd)

Quadratic Splines (contd)

Quadratic Splines (contd)

Quadratic Spline Example The upward velocity of a rocket is given as a function of time. Using quadratic splines a) Find the velocity at t=16 seconds b) Find the acceleration at t=16 seconds c) Find the distance covered between t=11 and t=16 seconds Table Velocity as a function of time Figure. Velocity vs. time data for the rocket example (s) (m/s)

Solution Let us set up the equations

Each Spline Goes Through Two Consecutive Data Points

tv(t) sm/s Each Spline Goes Through Two Consecutive Data Points

Derivatives are Continuous at Interior Data Points

Derivatives are continuous at Interior Data Points At t=10 At t=15 At t=20 At t=22.5

Last Equation

Final Set of Equations

Coefficients of Spline iaiai bibi cici − − − −152.13

Quadratic Spline Interpolation Part 2 of 2

38 Final Solution

Velocity at a Particular Point a) Velocity at t=16

Quadratic Spline Graph t=a:2:b;

Quadratic Spline Graph t=a:0.5:b;

Natural Cubic Spline Interpolation The domain of S is an interval [a,b]. S, S’, S’’ are all continuous functions on [a,b]. There are points t i (the knots of S) such that a = t 0 < t 1 <.. t n = b and such that S is a polynomial of degree at most k on each subinterval [t i, t i+1 ]. SPLINE OF DEGREE k = 3 ynyn …y1y1 y0y0 y tntn …t1t1 t0t0 x t i are knots

Natural Cubic Spline Interpolation S i (x) is a cubic polynomial that will be used on the subinterval [ x i, x i+1 ].

Natural Cubic Spline Interpolation S i (x) = a i x 3 + b i x 2 + c i x + d i 4 Coefficients with n subintervals = 4n equations There are 4 n-2 conditions Interpolation conditions Continuity conditions Natural Conditions S’’(x 0 ) = 0 S’’(x n ) = 0