The Mathematica Journal
Current Issue
Tricks of the Trade
In and Out
Riemann Surfaces IIc
The Mathematica Programmer
New Products
New Publications
News Bulletins
Editor's Pick
Write Us
About the Journal
Staff and Contributors
Back Issues
Download This Issue

Radial Basis Function

Q: Given a numeric data set, how does one go about finding a reasonable fitting function when you have no underlying theoretical equation to work with?

A: Consider the following data set.

For this example, we know the (exact) functional form of the fitting function and could use the Statistics`NonlinearFit` package to determine the best fit. However, assume that we are just given the data set. Tony Roberts ( suggests fitting with the radial basis function,

To do this, we need to solve for the coefficients in the linear equations , where is the distance between the ith and the jth data point, . We can extend the sum to include by noting that

The syntax uses Alternatives to handle both exact and approximate zeros.

In matrix form, the equations read , where . The matrix is easily constructed using Outer.

The vector can be computed efficiently using LinearSolve

Finally, the fitted function is , where is the distance from any point to the jth data point. Implementing this function as

we plot the fitted function together with the data set.

This method is robust and is simple to code. However, it can be expensive to compute if you have a lot of data points.

Copyright © 2002 Wolfram Media, Inc. All rights reserved.

[Article Index][Prev Page][Next Page]