6 March 2006 Interpolation and Approximation using Radial Base Functions (RBF) Alex Chirokov Description of rbfcreate and rbfinterp functions.

Slides:



Advertisements
Similar presentations
6. Radial-basis function (RBF) networks
Advertisements

Splines and Piecewise Interpolation
Approximation of heavy models using Radial Basis Functions Graeme Alexander (Deloitte) Jeremy Levesley (Leicester)
Interpolation Methods
Pattern Recognition and Machine Learning: Kernel Methods.
Numerical Operations S. Awad, Ph.D. M. Corless, M.S.E.E. E.C.E. Department University of Michigan-Dearborn Introduction to Matlab: Numerical Interpolation.
Introduction to Matlab:
Graph Laplacian Regularization for Large-Scale Semidefinite Programming Kilian Weinberger et al. NIPS 2006 presented by Aggeliki Tsoli.
Ch. 4: Radial Basis Functions Stephen Marsland, Machine Learning: An Algorithmic Perspective. CRC 2009 based on slides from many Internet sources Longin.
Spline Functions – An Elegant View of Interpolation Bruce Cohen David Sklar
Data mining and statistical learning - lecture 6
CITS2401 Computer Analysis & Visualisation
ES 240: Scientific and Engineering Computation. InterpolationPolynomial  Definition –a function f(x) that can be written as a finite series of power functions.
Data mining in 1D: curve fitting
Pattern Recognition and Machine Learning
Shading in OpenGL CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
RBF Neural Networks x x1 Examples inside circles 1 and 2 are of class +, examples outside both circles are of class – What NN does.
Giansalvo EXIN Cirrincione unit #6 Problem: given a mapping: x  d  t  and a TS of N points, find a function h(x) such that: h(x n ) = t n n = 1,
Approximation on Finite Elements Bruce A. Finlayson Rehnberg Professor of Chemical Engineering.
Hazırlayan NEURAL NETWORKS Radial Basis Function Networks I PROF. DR. YUSUF OYSAL.
Computer Graphics Recitation The plan today Least squares approach  General / Polynomial fitting  Linear systems of equations  Local polynomial.
Radial Basis Networks: An Implementation of Adaptive Centers Nivas Durairaj ECE539 Final Project.
Radial-Basis Function Networks
Hazırlayan NEURAL NETWORKS Radial Basis Function Networks II PROF. DR. YUSUF OYSAL.
Radial Basis Function Networks
Chapter 6-2 Radial Basis Function Networks 1. Topics Basis Functions Radial Basis Functions Gaussian Basis Functions Nadaraya Watson Kernel Regression.
Radial Basis Function Networks
Shading in OpenGL.
Measurement.
CS 376 Introduction to Computer Graphics 04 / 23 / 2007 Instructor: Michael Eckmann.
Artificial Neural Networks Shreekanth Mandayam Robi Polikar …… …... … net k   
Recap Summary of Chapter 6 Interpolation Linear Interpolation.
WB1440 Engineering Optimization – Concepts and Applications Engineering Optimization Concepts and Applications Fred van Keulen Matthijs Langelaar CLA H21.1.
MA/CS 3751 Fall 2002 Lecture 24. MA/CS 3752 ginput ginput is a Matlab function which takes one argument input: number of points to select in the image.
C GasparAdvances in Numerical Algorithms, Graz, Fast interpolation techniques and meshless methods Csaba Gáspár Széchenyi István University, Department.
COM335 TOPIC 5 DRAWING CURVES. COM335 Two types of curve : Regular curves Which have a simple equation. For example the circle x 2 + y 2 = r 2 The equation.
Lecture 10 2D plotting & curve fitting Subplots Other 2-D Plots Other 2-D Plots Curve fitting © 2007 Daniel Valentine. All rights reserved. Published by.
September Bound Computation for Adaptive Systems V&V Giampiero Campa September 2008 West Virginia University.
LINEAR ALGEBRA Matrix analysis Linear equations Eigenvalues and singular values Matrix functions.
Approximation on Finite Elements Bruce A. Finlayson Rehnberg Professor of Chemical Engineering.
Numerical Analysis 3D Plots. A numerical method is a technique for computing a numerical approximation of the solution to a mathematical problem.
Recap Plots with More than one Line Plots of Complex Arrays Line, Color and Mark Style Axis Scaling and Annotating Plots Subplots Polar Plots Logarithmic.
Radial Basis Function ANN, an alternative to back propagation, uses clustering of examples in the training set.
Polynomials, Curve Fitting and Interpolation. In this chapter will study Polynomials – functions of a special form that arise often in science and engineering.
Mohiuddin Ahmad SUNG-BONG JANG Interpolation II (8.4 SPLINE INTERPOLATION) (8.5 MATLAB’s INTERPOLATION Functions)
MODEL FITTING jiangyushan. Introduction The goal of model fitting is to choose values for the parameters in a function to best describe a set of data.
INTRODUCTION TO MATLAB DAVID COOPER SUMMER Course Layout SundayMondayTuesdayWednesdayThursdayFridaySaturday 67 Intro 89 Scripts 1011 Work
A Localized Method of Particular Solutions for Solving Near Singular Problems C.S. Chen, Guangming Yao, D.L. Young Department of Mathematics University.
Basis of Mathematical Modeling LECTURE 3 Numerical Analysis with MATLAB Dr. N.K. Sakhnenko, PhD, Professor Associate.
Sampling Design and Analysis MTH 494 Lecture-21 Ossam Chohan Assistant Professor CIIT Abbottabad.
Basic Theory (for curve 01). 1.1 Points and Vectors  Real life methods for constructing curves and surfaces often start with points and vectors, which.
PMS RI 2010/2011 Prof. dr Zikrija Avdagić, dipl.ing.el. ANFIS Editor GUI ANFIS Editor GUI.
Professor William H. Press, Department of Computer Science, the University of Texas at Austin1 Opinionated in Statistics by Bill Press Lessons #46 Interpolation.
Intro. ANN & Fuzzy Systems Lecture 24 Radial Basis Network (I)
Principal Warps: Thin-Plate Splines and the Decomposition of Deformations 김진욱 ( 이동통신망연구실 ; 박천현 (3D 모델링 및 처리연구실 ;
Introduction to Programming for Mechanical Engineers
Modeling and Simulation Dr. Mohammad Kilani
EEE 244-7: Curve Fitting.
Computer Application in Engineering Design
Building Adaptive Basis Function with Continuous Self-Organizing Map
Lecture 25.
Vectors.
Chapter 15 Curve Fitting : Splines
Lecture 25 Radial Basis Network (II)
Ying shen Sse, tongji university Sep. 2016
Lecture 24 Radial Basis Network (I)
Splines and Piecewise Interpolation
State Space Analysis UNIT-V.
Introduction to Radial Basis Function Networks
6.3 Gradient Search of Chi-Square Space
Presentation transcript:

6 March 2006 Interpolation and Approximation using Radial Base Functions (RBF) Alex Chirokov Description of rbfcreate and rbfinterp functions.

Outline First Example Radial Base Functions (RBF) RBF Interpolation and Approximation 1D Examples 2D Examples

Function: rbfcreate coeff = rbfcreate(x, y); 1 x n vector of values at the nodes. (input) dim x n matrix of coordinates of the nodes. (input) n - number of nodes dim – dimensionality of the data dim=1 for 1D interpolation, dim=2 for 2D interpolation, etc. Interpolation coefficients used in function rbfinterp. (output)

Function: rbfinterp yi = rbfinterp(xi, coeff); Interpolation coefficients created by function rbfcreate. (input) dim x m matrix of coordinates of the nodes. (input) m - number of nodes dim – dimensionality of the data dim=1 for 1D interpolation, dim=2 for 2D interpolation, etc. 1 x n vector of values at the nodes. (output)

First Example 1D Interpolation using standard Matlab function interp1 (see Matlab help on interp1 for detailes): x = 0:1.25:10; y = sin(x); xi = 0:.1:10; yi = interp1(x,y,xi); The same interpolation can be obtained using rbfcreate and rbfinterp functions: x = 0:1.25:10; y = sin(x); xi = 0:.1:10; yi = rbfinterp(xi, rbfcreate(x, y)); Thus for 1D RBF interpolation yi = rbfinterp(xi, rbfcreate(x, y)); can be used instead of yi = interp1(x,y,xi); the rest of the code remains the same.

First Example 1D interpolation using RBF and interp is almost identical because default radial base function is linear. yi = rbfinterp(xi, rbfcreate(x, y)); yi = interp1(x,y,xi); Interpolation nodes are shown with ‘o’ symbol. Interpolated data is green, original function is red.

Radial Base Functions A radial basis function (RBF) is a function based on a scalar radius. Functions available in rbfcreate: Gaussian: Multiquadrics: Linear: Cubic: Thinplate: Gaussian and Multiquadrics functions have adjustable parameter σ.

RBF Interpolation The objective of RBF interpolation is to construct the approximation of the function by choosing coefficients C 0, C 1 and λ i to match values of the function at the interpolation nodes. Once coefficients C 0, C 1 and λ i are found. This expression can be used to estimate value of the function at any point.

Radial Base Functions RBF function can be specified in rbfcreate, if RBF function is not specified linear RBF function is used for interpolation. Example: coeff = rbfcreate(x, y,'RBFFunction', 'multiquadric'); Valid values of 'RBFFunction‘: 'multiquadric‘ ‘linear‘ ‘cubic‘ ‘gaussian‘ ‘thinplate‘. Matlab code used to generate Figure on the right x = 0:0.01:3; ym = sqrt(x.*x+1); yg = exp(-x.*x/2); plot(x,ym, x, yg, x, x); legend('multiquadrics', 'gaussian', 'linear');

Radial Base Functions Adjustable parameter σ in gaussian in multiquadrics function can be specified in rbfcreate. Example: coeff = rbfcreate(x, y,'RBFConstant', 2.0); Optimal value of the parameter σ is somewhat close to the average distance between interpolation nodes. Selecting right σ is important. Figure on the right shows 1D RBF interpolation using gaussian function with very small constant σ =0.1 compared to the distance between points d=0.5. Very large values of σ~10 will result in singular interpolation matrix. x = -2:0.5:2; xi = -2:0.01:2; y = x.*exp(-x.*x); yi = xi.*exp(-xi.*xi); fi=rbfinterp(xi, rbfcreate(x, y,'RBFFunction', 'gaussian', 'RBFConstant', 0.1)); plot(x,y,'o',xi,yi, xi, fi);

RBF Approximation RBF interpolation will give exact value of the function at the nodes. If input data is noisy or exact values at the nodes are not desired smoothed approximation can be used instead of interpolation. Example: coeff = rbfcreate(x, y, 'RBFSmooth', 0.1); In this figure multiquadric interpolation and approximation are shown. Note that RBF interpolation gives exact values of the function at the nodes while RBF approximation does not. By default RBFSmooth = 0

1D Example Comparison with Matlab cubic interpolation clear all; x = -2:0.5:2; xi = -2:0.01:2; y = x.*exp(-x.*x); yi = xi.*exp(-xi.*xi); ym = interp1(x,y,xi,'cubic'); fi=rbfinterp(xi, rbfcreate(x, y,'RBFFunction', 'multiquadric')); plot(x,y,'o',xi,yi, xi, fi, xi, ym); legend('nodes','function', 'RBF interpolation', 'Matlab cubic interpolation'); figure; plot( xi, abs(fi-yi), xi, abs(ym-yi)); legend('RBF Interpolation Error','Matlab cubic interpolation error'); RBF Interpolation

1D Example Comparison with Matlab cubic interpolation Note that RBF interpolation, in this example, provides much better approximation of the original function in between interpolation nodes then cubic interpolation.

1D Example Comparison with Matlab cubic interpolation Absolute interpolation error of RBF interpolations is about order of magnitude smaller that cubic interpolation. (Example from previous slide)

2D Example Comparison with Matlab griddata interpolation rand('seed',0) x = rand(50,1)*4-2; y = rand(50,1)*4-2; z = x.*exp(-x.^2-y.^2); ti = -2:.05:2; [XI,YI] = meshgrid(ti,ti); ZI = griddata(x,y,z,XI,YI,'cubic'); %RBF interpolation ZI = rbfinterp([XI(:)'; YI(:)'], rbfcreate([x'; y'], z','RBFFunction', 'multiquadric', 'RBFConstant', 2)); ZI = reshape(ZI, size(XI)); %Plot data subplot(2,2,1); mesh(XI,YI,ZI), hold, axis([ ]); plot3(x,y,z,'.r'), hold off; title('Interpolation using Matlab function griddata(method=cubic)'); subplot(2,2,3); pcolor(abs(ZI - XI.*exp(-XI.^2-YI.^2))); colorbar; title('griddata(method=cubic) interpolation error'); subplot(2,2,2); mesh(XI,YI,ZI), hold plot3(x,y,z,'.r'), hold off; title('RBF interpolation'); axis([ ]); subplot(2,2,4); pcolor(abs(ZI - XI.*exp(-XI.^2-YI.^2))); colorbar; title('RBF interpolation error'); rbfcreate and rbfinterp can be used in any dimension: 1D, 2D, 3D, etc.

References: 1.Book: Mesh Free Methods: Moving Beyond the Finite Element Method by G. R. Liu, ISBN: , Publisher: CRC; 1st edition (July 29, 2002) 2.Book: Scattered Data Approximation (Cambridge Monographs on Applied and Computational Mathematics), by Holger Wendland, M. J. Ablowitz (Series Editor), S. H. Davis (Series Editor), E. J. Hinch (Series Editor), A. Iserles (Series Editor), J. Ockendon (Series Editor), P. J. Olver (Series Editor) SBN/UPC: Publisher / Producer: Cambridge University Press