Jim Ramsay McGill University Basis Basics. Overview  What are basis functions?  What properties should they have?  How are they usually constructed?

Slides:



Advertisements
Similar presentations
Lecture 14 Curves and Surfaces II
Advertisements

5.1 Real Vector Spaces.
Lecture Notes #11 Curves and Surfaces II
Applications in Signal and Image Processing
Cubic Curves CSE167: Computer Graphics Instructor: Steve Rotenberg UCSD, Fall 2006.
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.
© University of Wisconsin, CS559 Spring 2004
Data mining and statistical learning - lecture 6
MATH 685/ CSI 700/ OR 682 Lecture Notes
Selected from presentations by Jim Ramsay, McGill University, Hongliang Fei, and Brian Quanz Basis Basics.
Basis Expansion and Regularization Presenter: Hongliang Fei Brian Quanz Brian Quanz Date: July 03, 2008.
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.
Computational Methods in Physics PHYS 3437
EARS1160 – Numerical Methods notes by G. Houseman
Lecture 29 of 42 Bezier Curves and Splines Wednesday, 02 April 2008
Splines II – Interpolating Curves
Environmental Data Analysis with MatLab Lecture 11: Lessons Learned from the Fourier Transform.
1Notes  Assignment 0 is due today!  To get better feel for splines, play with formulas in MATLAB!
CS CS 175 – Week 9 B-Splines Definition, Algorithms.
Rational Bezier Curves
Curve-Fitting Interpolation
Spline Interpretation ABC Introduction and outline Based mostly on Wikipedia.
Advanced Computer Graphics (Spring 2005) COMS 4162, Lecture 12: Spline Curves (review) Ravi Ramamoorthi Most material.
Spline Interpretation ABC Introduction and outline Based mostly on Wikipedia.
Modeling of curves Needs a ways of representing curves: Reproducible - the representation should give the same curve every time; Computationally Quick;
1cs426-winter-2008 Notes  Assignment 0 is due today  MATLAB tutorial tomorrow 5-7 if you’re interested (see web-page for link)
Basic Concepts and Definitions Vector and Function Space. A finite or an infinite dimensional linear vector/function space described with set of non-unique.
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.
Bezier and Spline Curves and Surfaces Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Bezier and Spline Curves and Surfaces CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
1 Wavelets Examples 王隆仁. 2 Contents o Introduction o Haar Wavelets o General Order B-Spline Wavelets o Linear B-Spline Wavelets o Quadratic B-Spline Wavelets.
Continuous-Time Fourier Methods
CS Subdivision I: The Univariate Setting Peter Schröder.
Subdivision Analysis via JSR We already know the z-transform formulation of schemes: To check if the scheme generates a continuous limit curve ( the scheme.
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.
Function approximation: Fourier, Chebyshev, Lagrange
Applied Discrete Mathematics Week 9: Relations
Curve Modeling B-Spline Curves
A D V A N C E D C O M P U T E R G R A P H I C S CMSC 635 January 15, 2013 Spline curves 1/23 Curves and Surfaces.
(Spline, Bezier, B-Spline)
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.
Today’s class Spline Interpolation Quadratic Spline Cubic Spline Fourier Approximation Numerical Methods Lecture 21 Prof. Jinbo Bi CSE, UConn 1.
Course 13 Curves and Surfaces. Course 13 Curves and Surface Surface Representation Representation Interpolation Approximation Surface Segmentation.
BIOSYST-MeBioSwww.biw.kuleuven.be The potential of Functional Data Analysis for Chemometrics Dirk De Becker, Wouter Saeys, Bart De Ketelaere and Paul Darius.
Splines IV – B-spline Curves based on: Michael Gleicher: Curves, chapter 15 in Fundamentals of Computer Graphics, 3 rd ed. (Shirley & Marschner) Slides.
Professor Walter W. Olson Department of Mechanical, Industrial and Manufacturing Engineering University of Toledo System Solutions y(t) t +++++… 11 22.
CCN COMPLEX COMPUTING NETWORKS1 This research has been supported in part by European Commission FP6 IYTE-Wireless Project (Contract No: )
Lecture 22 Numerical Analysis. Chapter 5 Interpolation.
Keyframing and Splines Jehee Lee Seoul National University.
CS 376 Introduction to Computer Graphics 04 / 25 / 2007 Instructor: Michael Eckmann.
Basic Theory (for curve 02). 1.3 Parametric Curves  The main aim of computer graphics is to display an arbitrary surface so that it looks real.  The.
The Wavelet Tutorial: Part2 Dr. Charturong Tantibundhit.
Lecture 17 - Approximation Methods CVEN 302 July 17, 2002.
Application: Multiresolution Curves Jyun-Ming Chen Spring 2001.
Rendering Bezier Curves (1) Evaluate the curve at a fixed set of parameter values and join the points with straight lines Advantage: Very simple Disadvantages:
1 Chapter 4 Interpolation and Approximation Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation.
Frequency domain analysis and Fourier Transform
Curves University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
Piecewise Polynomial Parametric Curves Sun-Jeong Kim.
Basis Expansions and Generalized Additive Models Basis expansion Piecewise polynomials Splines Generalized Additive Model MARS.
LECTURE 17: BEYOND LINEARITY PT. 2 March 30, 2016 SDS 293 Machine Learning.
Computational Methods CMSC/AMSC/MAPL 460 Polynomial Interpolation Ramani Duraiswami, Dept. of Computer Science.
Lecture 1.26 Spectral analysis of periodic and non-periodic signals.
Curve-Fitting Spline Interpolation
Dept. Computer Science & Engineering, Shanghai Jiao Tong University
© University of Wisconsin, CS559 Spring 2004
Human Growth: From data to functions
Presentation transcript:

Jim Ramsay McGill University Basis Basics

Overview  What are basis functions?  What properties should they have?  How are they usually constructed?  Fourier bases.  B-spline bases: Lots of detail here.  Wavelet bases.  Advice, wrap-up, and beyond.

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) 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. 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.  B-spline functions: These have now more or less replaced polynomials for non-periodic problems. More explanation follows.

How do we construct basis systems?  We start with a prototype basis function φ(t). Let’s call it the mother function.  We apply three operations to it:  Lateral shift φ(t+a) to focus fitting power near a position a.  Scale change φ(bt), to increase resolving power, or the capacity for local curvature.  Smoothing, to increase differentiability and smoothness.

Can I see an example? Consider the Fourier series :  Mother functions: φ(t) = sin(ωt), and φ(t) = 1  Lateral Shift: sin[ω(t+π/2)] = cos(ωt)  Scale change: sin(kωt), cos(kωt), k=1,2,…  Smoothing: None; these are already infinitely differentiable functions.  Strengths: Orthogonality makes computing coefficients very fast  Limitations: Fourier series are only natural if f(t) is periodic with period ω.

Five Fourier Basis Functions  φ 1 (t) = 1  A sine/cosine pair with period 1: Captures low frequency variation  A sine/cosine pair with period ½: Captures higher frequency variation

What about polynomials?  The mother function is φ(t) = 1.  Smoothing: Multiply by t to increase both differentiability and curvature.  No shift or scaling: Polynomials are invariant with respect to shift and scaling.  Strengths: Okay for very simple curves such as linear or slight curvature.  Limitations: Just not flexible enough. We can’t focus fitting power on a specific location.

What basis should I use for non- periodic functions? Spline bases have nearly everything:  Infinite and independent control over shift, scale, and smoothness.  Potential to model sharp changes in f(t) as well as its smooth variation.  As fast as polynomials to evaluate.  Band-structured matrix of values.

How do B-splines work?  Start with a discrete mesh of values, called knots: ξ 0, ξ 1, …, ξ L.  Space out the knots where you don’t need much resolution, make them dense where you need a lot of resolution.

 Mother function is the box function over [ξ 0, ξ 1 ]: φ(t) = 1, ξ 0 ≤ t < ξ 1, and 0 otherwise.  Shift: just shift to another interval.  Scale: determined by spacing between knots.

What about smoothness?  Smoothness control is the heart of spline technology.  It is defined by a recursion relation.  The recursion relation uses spline basis functions at a given smoothness level to make new ones at the next higher smoothness level.

B-spline notation The spline basis system we use is the B-spline system.  To keep notation simple, let the knots be the natural numbers j = 0, 1, …  We need two indices for a B-spline basis function B jm (t): j to indicate the knot where it starts, and m to indicate its order or degree of smoothness.  For our box functions, m = 1.

 B-splines of order 2 are tent functions, starting at a knot, rising linearly to 1 at the next knot, and decaying linearly to 0 two knots over.  They are continuous. Order 2 implies a continuous derivative of order 0.  Order 2 knots are piecewise linear.  What about order 3 B- splines?

The recursion for integer knots For the B-spline function of order 2 beginning at 0, the recursion is

In the first term, the mother box function B 01 (t) is multiplied by t, and is therefore t itself. In the second, the mother box is shifted to the right and multiplied by 2-t.In the second, the mother box is shifted to the right and multiplied by 2-t. The second term amounts to a shift and reflection of the first term.The second term amounts to a shift and reflection of the first term.

Constructing a Tent B 02 (t) from Two Boxes B 01 (t) and B 11 (t)

Constructing Order 3 B 03 (t) from Two Tent Functions

 Multiplying by (t-j) increases the polynomial degree of the B-spline in the first term by one.  Multiplying (m+j-t) does the same thing for the reflected and shifted B-spline in the second term.  The result is a new B-spline of one degree or order higher, spread over an additional interval, and having an one more level of continuous derivatives.  Order 3 B-splines are piece-wise quadratic, spread over 3 intervals, and have a continuous first derivative.

How do we get the extra smoothness?  tB 01 (t) and (2-t)B 11 (t) have the same values at knot 1. The sum is continuous.  tB 02 (t) and (3-t)B 12 (t) have the same derivative values at knots 1 and 2. The sum has a continuous first derivative.  Each time we multiply by t, and then shift and reflect the result, we add another order of smooth derivative.

Suppose I don’t want so much smoothness at a fixed point?  You can have multiple knots at a point.  For each additional knot, the spline function will have one less derivative at that knot.  An order m Bspline with m knots at a point can be discontinuous at that point.  Most spline software places m knots at each of the boundaries.

How many B-spline basis functions am I using?  When all interior knots are unique, the total number of B-spline basis functions is equal to the number of interior knots plus the order.  When there are no interior knots, splines become polynomials: The order equals the number of basis functions.

Wavelets  Wavelets take this shift/scale/smooth trio of operations even further.  They define basis functions organized into orthogonal levels of resolution.  The resulting multi-resolution analysis is one of the most exciting developments in mathematics since Fourier’s series.

Some advice  If you have periodic data, you’ll probably use Fourier series.  If you don’t, you’ll probably use B-splines.  Especially if you need to look at or work with derivatives.  If you want a derivative of order m, fit the data with a spline of order at least m+2, although order 2m has some advantages.

Where have we been?  Linear combinations of basis functions are a convenient way to model functions.  The more basis functions we use, the more complex the fitted function can be.  Most basis function systems involve turning three knobs, marked shift, scale, and smooth, to modify a mother function.  The best systems permit independent control of these features.  Like splines and wavelets.

Where do we go from here?  Although we can control the resolution of a spline fit by the number of spline basis functions and the spacing of knots, we often need easier more continuous control over smoothness.  Roughness penalties can give us the additional control that we need.