1 / 44

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

Basis Basics. Selected from presentations by Jim Ramsay, McGill University, Hongliang Fei, and Brian Quanz. 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;

zocha
Download Presentation

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

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. 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.

  3. 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}

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

  5. 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 ak: 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.

  6. What are some commonly used basis functions? • Powers: 1, t, t2, 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.

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

  8. 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.

  9. 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.

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

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

  12. Piecewise Cubic Polynomial

  13. Spline Interpolation Method Slides taken from the lecture by Authors: Autar Kaw, Jai Paul http://numericalmethods.eng.usf.edu

  14. What is Interpolation ? Given (x0,y0), (x1,y1), …… (xn,yn), find the value of ‘y’ at a value of ‘x’ that is not given. http://numericalmethods.eng.usf.edu

  15. Interpolants Polynomials are the most common choice of interpolants because they are easy to: • Evaluate • Differentiate, and • Integrate. http://numericalmethods.eng.usf.edu

  16. Why Splines ? http://numericalmethods.eng.usf.edu

  17. Why Splines ? Figure : Higher order polynomial interpolation is a bad idea http://numericalmethods.eng.usf.edu

  18. Linear Interpolation http://numericalmethods.eng.usf.edu

  19. Linear Interpolation (contd) http://numericalmethods.eng.usf.edu

  20. 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 http://numericalmethods.eng.usf.edu

  21. Linear Interpolation http://numericalmethods.eng.usf.edu

  22. Quadratic Interpolation http://numericalmethods.eng.usf.edu

  23. Quadratic Interpolation (contd) http://numericalmethods.eng.usf.edu

  24. Quadratic Splines (contd) http://numericalmethods.eng.usf.edu

  25. Quadratic Splines (contd) http://numericalmethods.eng.usf.edu

  26. Quadratic Splines (contd) http://numericalmethods.eng.usf.edu

  27. Quadratic Spline Example The upward velocity of a rocket is given as a function of time. Using quadratic splines Find the velocity at t=16 seconds Find the acceleration at t=16 seconds 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 http://numericalmethods.eng.usf.edu

  28. Solution Let us set up the equations http://numericalmethods.eng.usf.edu

  29. Each Spline Goes Through Two Consecutive Data Points http://numericalmethods.eng.usf.edu

  30. Each Spline Goes Through Two Consecutive Data Points http://numericalmethods.eng.usf.edu

  31. Derivatives are Continuous at Interior Data Points http://numericalmethods.eng.usf.edu

  32. Derivatives are continuous at Interior Data Points At t=10 At t=15 At t=20 At t=22.5 http://numericalmethods.eng.usf.edu

  33. Last Equation http://numericalmethods.eng.usf.edu

  34. Final Set of Equations http://numericalmethods.eng.usf.edu

  35. Coefficients of Spline http://numericalmethods.eng.usf.edu

  36. Quadratic Spline InterpolationPart 2 of 2http://numericalmethods.eng.usf.edu http://numericalmethods.eng.usf.edu

  37. Final Solution http://numericalmethods.eng.usf.edu

  38. Velocity at a Particular Point a) Velocity at t=16 http://numericalmethods.eng.usf.edu

  39. Quadratic Spline Graph t=a:2:b;

  40. Quadratic Spline Graph t=a:0.5:b;

  41. x t0 t1 … tn y y0 y1 … yn 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 ti (the knots of S) such that a = t0 < t1 < .. tn = b and such that S is a polynomial of degree at most k on each subinterval [ti, ti+1]. SPLINE OF DEGREE k = 3 ti are knots

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

  43. Natural Cubic Spline Interpolation • Si(x) = aix3 + bix2 + cix + di • 4 Coefficients with n subintervals = 4n equations • There are 4n-2 conditions • Interpolation conditions • Continuity conditions • Natural Conditions • S’’(x0) = 0 • S’’(xn) = 0

More Related