A divergence-free spatial interpolator for large sparse velocity data sets

17
JOURNAL OF GEOPHYSICAL RESEARCH, VOL. ???, XXXX, DOI:10.1029/, A Divergence Free Spatial Interpolator for Large Sparse Velocity Data Sets Ross Vennell Department of Marine Science, University of Otago, New Zealand Rick Beatson Department of Mathematics and Statistics, University of Canterbury, New Zealand Abstract. A 2D divergence free interpolator is presented which is demonstrated to give more realistic values between sparse velocity data than interpolating velocity components independently. The interpolator enforces physical dependence between the velocity com- ponents by ensuring mass is conserved. Tests using data for a synthetic eddy show that independent interpolation of components can give unrealistic velocities between widely spaced data. However divergence free interpolation can reproduce the eddy almost as well with sparse data as with dense data. In the synthetic tests the divergence free Radial Basis Function (RBF) interpolator performed as well as, or better than, Optimal Inter- polation. A significant advantage of the “Greedy Fit” RBF interpolator implemented here is the small number of coefficients required to describe the interpolating surface. For large data sets this gives the interpolator a significant computational advantage over techniques, like Optimal Interpolation, which require one coefficient per data point. The RBF’s econ- omy of parameters and imposing physics with the divergence free constraint makes RBF interpolation of sparse data much more resistant to following the noise. The 2D diver- gence free interpolator can be used to interpolate geostrophic velocities or the horizon- tal transport of high frequency flows such as tidal currents. Tests with data from the Local Dynamics Experiment moorings and from moving vessel ADCP measurements of tidal flow show the divergence free interpolator is better able to reproduce data left out of the interpolation than interpolating velocity components independently. 1. Introduction Oceanographic data sets are often sparse, with measure- ments from widely spaced vessel tracks or moorings. To assist with interpretation of the measurements spatial in- terpolation is commonly used to span gaps between mea- surements to give more complete spatial patterns of oceano- graphic variables such as salinity, temperature or velocity. There are a large variety of interpolation techniques (see Emery and Thomson [2001]). This work presents a spatial interpolator specifically for snapshots of velocity measure- ments. The components of the velocity vector are typically interpolated independently of each other (eg. Candela et al. [1992]), however they are related by physics. This work presents a Radial Basis Function (RBF) velocity interpola- tor which ensures the interpolated velocity components sat- isfy mass continuity, i.e. are divergence free. The divergence free interpolator is shown to improve the ability to resolve features, such as eddies, whose spatial scale is comparable to the spacing between velocity measurements. For 1D problems cubic splines, minimizing the linearized curvature, are a popular data fitting method. They are usu- ally viewed as smooth piecewise polynomials. However, they can also be viewed as single polynomial plus a weighted sum of terms |x - x i | 3 , where the x i are the data points. Thus in 1D polynomial spline and radial basis function (RBF) inter- polants are the same, both minimizing the same quadratic energy, in the piecewise cubic case R (f 00 (x)) 2 dx. The gen- eralizations to higher dimensions diverge. The classical Copyright 2009 by the American Geophysical Union. 0148-0227/09/$9.00 generalizations of 1D polynomial splines are multivariate piecewise polynomials, while the RBF generalization is to a weighted sum of shifts of a single basic function plus a sup- plementary polynomial. In higher dimensions polyharmonic RBF interpolants minimize a suitably linearized bending en- ergy [Beatson et al., 2000], while piecewise polynomials such as bicubic splines do not. Because of this minimization of linearized bending energy polyharmonic splines in any di- mension are often referred to as thin plate splines (TPS) or alternatively, particularly in the statistics literature, simply as splines. In oceanography TPS interpolations have been used for many applications, e.g. interpolating satellite altimeter data [Sandwell , 1987], detiding moving vessel ADCP data [Can- dela et al., 1992], extracting the spatial patterns of tidal ve- locity or dynamical terms [Munchow , 2000; Vennell , 2006] and robust measurements of the intensity of curvature in- duced secondary flow [Vennell and Old , 2007]. TPS have continuity of at least their first derivative across the data points, which makes them well suited to spanning gaps be- tween irregularly spaced data typical of vessel based mea- surements. The functions used to represent TPS are one class of Radial Basis Functions (RBFs). Vennell and Beat- son [2006] (VB06) improved on Candela et al. [1992]’s ap- proach by incorporating two ideas from RBF theory, posi- tioning centers (also called knots or nodes) at data points and imposing side conditions on the least squares fit to de- termine the size of the weights. VB06 also exploited the dif- ferentiability of RBFs to fit the streamfunction directly to the horizontal transport measurements to give a mass con- serving interpolator, which improved interpolation of sparse measurements. This paper exploits the divergence free forms of polyharmonic RBFs developed by Handscomb [1993] to significantly improve on VB06’s streamfunction technique. 1

Transcript of A divergence-free spatial interpolator for large sparse velocity data sets

JOURNAL OF GEOPHYSICAL RESEARCH, VOL. ???, XXXX, DOI:10.1029/,

A Divergence Free Spatial Interpolator for Large SparseVelocity Data SetsRoss VennellDepartment of Marine Science, University of Otago, New Zealand

Rick BeatsonDepartment of Mathematics and Statistics, University of Canterbury, New Zealand

Abstract. A 2D divergence free interpolator is presented which is demonstrated to givemore realistic values between sparse velocity data than interpolating velocity componentsindependently. The interpolator enforces physical dependence between the velocity com-ponents by ensuring mass is conserved. Tests using data for a synthetic eddy show thatindependent interpolation of components can give unrealistic velocities between widelyspaced data. However divergence free interpolation can reproduce the eddy almost as wellwith sparse data as with dense data. In the synthetic tests the divergence free RadialBasis Function (RBF) interpolator performed as well as, or better than, Optimal Inter-polation. A significant advantage of the “Greedy Fit” RBF interpolator implemented hereis the small number of coefficients required to describe the interpolating surface. For largedata sets this gives the interpolator a significant computational advantage over techniques,like Optimal Interpolation, which require one coefficient per data point. The RBF’s econ-omy of parameters and imposing physics with the divergence free constraint makes RBFinterpolation of sparse data much more resistant to following the noise. The 2D diver-gence free interpolator can be used to interpolate geostrophic velocities or the horizon-tal transport of high frequency flows such as tidal currents. Tests with data from theLocal Dynamics Experiment moorings and from moving vessel ADCP measurements oftidal flow show the divergence free interpolator is better able to reproduce data left outof the interpolation than interpolating velocity components independently.

1. Introduction

Oceanographic data sets are often sparse, with measure-ments from widely spaced vessel tracks or moorings. Toassist with interpretation of the measurements spatial in-terpolation is commonly used to span gaps between mea-surements to give more complete spatial patterns of oceano-graphic variables such as salinity, temperature or velocity.There are a large variety of interpolation techniques (seeEmery and Thomson [2001]). This work presents a spatialinterpolator specifically for snapshots of velocity measure-ments. The components of the velocity vector are typicallyinterpolated independently of each other (eg. Candela et al.[1992]), however they are related by physics. This workpresents a Radial Basis Function (RBF) velocity interpola-tor which ensures the interpolated velocity components sat-isfy mass continuity, i.e. are divergence free. The divergencefree interpolator is shown to improve the ability to resolvefeatures, such as eddies, whose spatial scale is comparableto the spacing between velocity measurements.

For 1D problems cubic splines, minimizing the linearizedcurvature, are a popular data fitting method. They are usu-ally viewed as smooth piecewise polynomials. However, theycan also be viewed as single polynomial plus a weighted sumof terms |x−xi|3, where the xi are the data points. Thus in1D polynomial spline and radial basis function (RBF) inter-polants are the same, both minimizing the same quadraticenergy, in the piecewise cubic case

∫(f ′′(x))2dx. The gen-

eralizations to higher dimensions diverge. The classical

Copyright 2009 by the American Geophysical Union.0148-0227/09/$9.00

generalizations of 1D polynomial splines are multivariatepiecewise polynomials, while the RBF generalization is to aweighted sum of shifts of a single basic function plus a sup-plementary polynomial. In higher dimensions polyharmonicRBF interpolants minimize a suitably linearized bending en-ergy [Beatson et al., 2000], while piecewise polynomials suchas bicubic splines do not. Because of this minimization oflinearized bending energy polyharmonic splines in any di-mension are often referred to as thin plate splines (TPS) oralternatively, particularly in the statistics literature, simplyas splines.

In oceanography TPS interpolations have been used formany applications, e.g. interpolating satellite altimeter data[Sandwell , 1987], detiding moving vessel ADCP data [Can-dela et al., 1992], extracting the spatial patterns of tidal ve-locity or dynamical terms [Munchow , 2000; Vennell , 2006]and robust measurements of the intensity of curvature in-duced secondary flow [Vennell and Old , 2007]. TPS havecontinuity of at least their first derivative across the datapoints, which makes them well suited to spanning gaps be-tween irregularly spaced data typical of vessel based mea-surements. The functions used to represent TPS are oneclass of Radial Basis Functions (RBFs). Vennell and Beat-son [2006] (VB06) improved on Candela et al. [1992]’s ap-proach by incorporating two ideas from RBF theory, posi-tioning centers (also called knots or nodes) at data pointsand imposing side conditions on the least squares fit to de-termine the size of the weights. VB06 also exploited the dif-ferentiability of RBFs to fit the streamfunction directly tothe horizontal transport measurements to give a mass con-serving interpolator, which improved interpolation of sparsemeasurements. This paper exploits the divergence free formsof polyharmonic RBFs developed by Handscomb [1993] tosignificantly improve on VB06’s streamfunction technique.

1

Ross
Text Box
Pre print: Uncorrected, doi: 10.1029/2008JC004973 Journal of Geophysical Research, American Geophysical Union, 2009, 114

X - 2 VENNELL & BEATSON: DIVERGENCE FREE INTERPOLATOR

Other forms of divergence free and related RBFs have beendeveloped, some important papers being Narcowich andWard [1994], Amodei and Benbourhim [1991] and Lowitzsch[2005].

A popular interpolator is Objective Analysis or OptimalInterpolation (OI) [Emery and Thomson, 2001]. OI is astatistical estimator which minimizes the ensemble meansquare error between the data and interpolating surface[McIntosh, 1990]. OI requires prior knowledge of the spatialcovariance function. Often the covariance is poorly known,particularly if the data is a single snapshot in time. Nev-ertheless OI often does well despite this lack of informationabout the covariance function. Typically OI snapshot inter-polation minimizes the mean square error by fitting a ra-dially symmetric analytic covariance function to spatiallybinned data to give a covariance length scale and noisevariance. In contrast RBF interpolation aims to find thesmoothest surface by fitting a polynomial plus shifts of ra-dially symmetric functions directly to the data. Such a fitinherently minimizes a measure of energy in the interpolat-ing surface. RBF spline interpolation does not require priorknowledge of a length scale. McIntosh [1990] notes thatspline interpolation is preferred if a good estimate of thecovariance length scale is not available.

In the numerical analysis literature an interpolator is asurface which passes through each data point. Such sur-faces will be referred to here as “exact interpolators”. Inthe oceanographic literature “interpolator” often refers to asmooth surface approximating the data. We will adopt thisusage. Both smoothing splines and OI require determiningone parameter for each data point, becoming computation-ally costly when the number of data points is large, sayexceeding 5, 000. Further, evaluation of the fitted radial ba-sis function or OI covariance matrix is slow for large datasets. In contrast the greedy fitting techniques presented hereplaces centers at only a small subset of the data points. Thissignificantly reduces the memory requirements and opera-tion counts during fitting and increases the speed of subse-quent evaluations. It is not intended to compare smoothingspline and “greedy fit” interpolations in this paper, but tofocus on comparing divergence free and non-divergence freeinterpolators. A comparison with scalar and non-divergentOI is included.

Most oceanographic applications of TPS have used bi-harmonic splines (e.g. Candela et al. [1992]), which havecontinuous first derivatives but discontinuous second deriva-tives. Stiffer higher order TPS exist with continuity ofhigher derivatives, making them better suited to estimatingfluid properties which require velocity derivatives, such asvorticity. Divergence free TPS also exist. Handscomb [1993]presents divergence free forms of TPS-RBFs for exact inter-polation of solenoidal fields in 2D and 3D. In this work wepresent Handscomb’s 2D divergence free RBFs, (DF-RBFs)in a form accessible to an oceanographic audience and adaptthem for use in least squares smoothing fits as well as exactinterpolators. In addition a modified greedy fit technique ispresented which achieves a specific quality of fit with rela-tively few parameters and consequently is resistant to fol-lowing the noise. The divergence free techniques presentedhere can easily be extended to allow for tidal variation incurrents [VB06].

In this paper section 2.1 outlines scalar RBF interpola-tion, section 2.2 presents Handscomb [1993]’s 2D divergencefree RBFs, section 2.3 explains how to find the spline coeffi-cients for exact and for smoothing interpolators and section2.3.2 presents an improved greedy fit technique. Section 3compares the ability of scalar and DF-RBFs to fit syntheticdata for dense and sparse data. Section 4 adapts DF-RBFsfor use with geostrophic flows and higher frequency oceano-graphic velocity data. Section 5 presents two examples ofthe application of DF-RBFs to real measurements whichdemonstrate the ability of DF-RBFs to span data gaps.

2. RBFs

The focus of this paper is fitting noisy measurements ofapproximately divergence free flows. The primary compar-ison is between scalar RBFs (S-RBFs) and DF-RBFs. Theaim is to develop methods which are efficient for large noisysparse data sets often found in oceanography. S-RBFs canbe fitted independently to each component of a velocityvector yielding separate interpolators for each component.However velocity components are related through physicallaws. One law is mass continuity, which for incompress-ible fluids requires the velocity to be divergence free, i.e.∇ · v = 0. It is reasonable to expect that imposing physicswill improve the interpolation.

OI and smoothing splines require solution of an M ×Mlinear system, where M is the number of observations, tofind M coefficients. Evaluation of the fitted field, or aderivative of it, then requires O(M) floating point oper-ations per evaluation point. In this section we outline anumber of techniques which significantly reduce the compu-tational costs and which are well suited to large data sets.The next two subsections give the mathematical forms of theS-RBF and DF-RDF. Section 2.3 describes how to obtainthe weights or coefficients of the fitted surface. The sectionhas two sub-sections. The first describes how to solve forthe weights of an exact RBF interpolator, where the surfacepasses through every data point and has a coefficient/weightfor every data location. The second subsection, describes aprocess of solving for the weights of a smoother surface byplacing weights/active centers at only N ¿ M data loca-tions. This latter technique is well suited to large data setsas it only requires a least squares solution of an M ×O(N)system, rather than the solution of M × M systems as re-quired for OI or exact RBF fits. Speed of evaluation is alsogreatly increased as this type of surface involves only O(N)terms rather than O(M). The Modified Greedy Fit (MGF)procedure outlined in subsection 2.3.2 is an iterative methodof choosing the data locations or centers to be included inthe subset. For large data sets the benefits of this somewhatmore complex iterative approach are much lower memoryand computationally requirements in comparison to OI orexact interpolation. The increased computational cost ofthe MGF compared to previous GF methods is significantlyreduced by an updating scheme given in Appendix A. Fur-ther, the MGF directly uses reduction in mean square errorrather than maximum pointwise residual to choose centersto add, making it both parsimonious in the number of cen-ters used and more resistant to overfitting. Finally, subsec-tion 2.4 describes how cross-validation is used to allow thedata to decide how large a subset of data locations/activecenters is required to best fit the data.

2.1. Scalar RBFs

Standard 2D biharmonic TPS interpolation correspondsto bending a thin plate to fit a scalar, the small measureddisplacements. The biharmonic thin plate spline is a specialcase of a polyharmonic RBF consisting of the sum of a loworder polynomial and shifts of polyharmonic basic functionφ [Meinguet , 1979; Beatson et al., 2000], i.e.

F (x) = P (x)α +

N∑j=1

βjφ(rj) (1)

where x = (x, y) is the evaluation point and rj = |x−xcj | is

the distance from x to the j-th center xcj . P is a row vector

whose columns form a ` termed polynomial basis, e.g. linearP =

[1 x y

], and α is an ` long vector of the polynomial’s

VENNELL & BEATSON: DIVERGENCE FREE INTERPOLATOR X - 3

coefficients. The biharmonic 2D thin plate spline basic func-tion is φ(r) = r2 log r, a multiple of the Green’s functionsolution to the biharmonic equation ∇4φ = δ0. A stiffer tri-harmonic thin plate spline basic function is φ(r) = r4 log r, amultiple of the Green’s function of the triharmonic equation∇6φ = δ0. The polynomial part is linear in the biharmoniccase and quadratic in the triharmonic case. (Table 1).

2.2. Divergence Free RBFs

The DF-RBFs developed by Handscomb [1993] used hereinherently impose this mass continuity on the fitted velocityfield while minimizing a measure of energy, Table 1. Theinterpolating functions for each velocity component are dif-ferent, but are related in such a way that the resulting vectorfield is divergence free. For 2D Handscomb’s DF-RBFs havethe form

v =

[uv

]= PD (x)α+

N∑j=1

{D1(rj)

[1 00 1

]+ D2(rj)

(x− xc

j

) (x− xc

j

)T}

βj

(2)where βj is a two element vector of coefficients. The Dk(r)are radially symmetric functions given in Table 1. Masscontinuity is ensured for the polynomial part of the RBF bychoosing the vector basis polynomials, that is the columnsof the basis matrix PD , to be divergence free (Table 1).

2D mass conservation of an incompressible flow implies

the existence of a streamfunction defined by u =∂ψ

∂y,

v = −∂ψ

∂x. Partial integration of the components of the

DF-RBF (2) shows

ψ(x) = C + Q(x)α +

N∑j=1

Ψ(rj)(x− xcj)

T

[0 −11 0

]βj (3)

is a corresponding stream function, where the functions Qand Ψ are given in Table 1. It is important to note thatthe DF-RBF does not directly fit the streamfunction to thedata, but the stream function is readily evaluated from theweights of the velocity fit via (3). This way of obtaining thestreamfunction is very different to that used in VB06, whichrepresents the streamfunction as an S-RBF (1) and fits itsderivatives to the components of horizontal transport.

2.3. Determining the coefficients

This section describes conceptually how to determine thecoefficients in (1) and (2) which either exactly, or in a leastsquares sense, fit the data. Polynomial and spline coeffi-cients are determined by solving the equations which in partresult from equating (1) or (2) evaluated at the data loca-tions xd

i with the observations. The result is a system ofequations of the form

[ P(xd) Φ(xd, xc)] [

αβ

]≈ F . (4)

For S-RBFs applied to velocity data F is the M long vectorof a measured velocity component, either ud or vd, P(xd)is an M by ` matrix whose rows are the polynomial basisvector P evaluated at the data points. Φ(xd, xc) is M byN with Φij = φ(|xd

i −xcj |). For DF-RBFs F is a 2M -vector

with alternating values of the measured velocity components[ud

i

vdi

], P is replaced by PD whose successive pairs of rows

are the two rows PD evaluated at the data points. Φ is 2Mby 2N and made up of 2 by 2 submatrices. Each subma-trix has the form given inside the curly braces of (2), withevaluation point x = xd

i and source point xcj .

If centers are placed at every data point then it can beshown that there is no smoother surface that passes through

every data point than that given by the polyharmonic inter-polant (1) provided some relatively weak conditions are met.For biharmonic RBFs smoothness of the surface is measuredby the linearized surface curvature integrated over all space,Table 1. The conditions required for (1) and (2) to be thesmoothest surface are, firstly that the set of centers and theset of data points must be identical, that the matrix P(xc)must have full rank, that (4) must hold as an equality, andthat the RBF coefficients must also satisfy the ` equalityconstraints or side conditions

P(xc)T β = 0. (5)

Here P has the same structure for S-RBFs and DF-RBFs asdescribed above except it is evaluated at the centers. Theseequations lower the rate of growth of the RBF in the far fieldand thus act to confine the region of 2D space over which“curvature” is minimized to the vicinity of the data.2.3.1. Exact interpolation of small data sets

For exact interpolation centers are placed at every datapoint, i.e. xc

i = xdi for i = 1 . . . M , and the coefficients are

found from solving the square system of equations

[ P(xd) Φ(xd, xd)

0 PT (xd)

] [αβ

]=

[F0

], (6)

where P, Φ and F are the matrices and vector appropriatefor S-RBFs or DF-RBFs. These equations are easily solv-able for small data sets where an exact fit to the data isrequired.2.3.2. Greedy Fit-Smooth interpolation of large datasets

This work considers fitting RBFs to large noisy data sets,thus does not require a surface to pass through all of the datapoints. This is achieved by placing centers at only a smallsubset of the data locations and fitting in the least squaressense. The objective is to obtain a smoother surface which“best” represents the spatial structure of the data, whileminimizing the influence of noise.

The small subset of N data points is chosen iteratively.The iterative process starts with ` data points to be used asinitial or “special” centers. A process for choosing this ini-tial set is given at the end of the Appendix. For this initialset the coefficients are found by solving (4) subject to (5).For this smoothing interpolator N ¿ M and the overdeter-mined set of equations (4) is solved by equality constrainedleast squares methods at a significantly reduced computa-tional cost compared to (6). Such methods can be foundin numerical linear algebra libraries such as LAPACK. Thecoefficients are then used to evaluate the interpolating sur-face. The evaluated surface is used to determine which ofthe remaining data points is “best” introduced into the sub-set, using a given criteria. Once the best is included in theset of centers a new solution for the coefficients or weightsfor the expanded set of centers is found. The process isrepeated until N data points have been chosen as centers.Cross-validation, outlined in the next subsection, is used toallow the data to choose the optimal value of N .

The criteria for “best” aims to choose data points whichwill result in the smallest possible set of centers. It can dothis by seeking to choose a data point to be the next centerwhich will achieve the largest possible reduction in residualbetween interpolating surface and data at each step on theinteractive fit. This criteria can be described as a “GreedyFit”, soaking up as much of the residual as possible at eachstep.

The criteria in the variant of the GF used in VB06 tochoose the best data point to add is based on the heuris-tic that a location with a high pointwise residual is likely a

X - 4 VENNELL & BEATSON: DIVERGENCE FREE INTERPOLATOR

region which is poorly fitted. Adding a center there allowsmore curvature of the RBF surface to better fit the data inthat region. This criteria is simple to implement and com-putationally fast. However it focuses on pointwise residualrather than RMS residual. Hence it may easily choose toadd a center that is far from optimal in terms of reducingthe RMS residual. In the worst case it is could select the lo-cation of a data glitch as a new center. The following sectionoutlines a slower but better performing criteria.2.3.3. Modified Greedy Fit

The only difference between largest residual GF and the“Modified Greedy Fit”, MGF, presented is this section isthe criteria for selecting the next center to be added to theexpanding set. An ideal criteria for the next “best” wouldchoose the new center which would result in the greatestreduction in RMS residual between surface and data. Withhundreds or thousands of data points the computational costof solving the constrained least squares problem (4) with (5)for each candidate center at each step of this MGF is pro-hibitive. We consider two techniques that can significantlyreduce the computational cost of this MGF.

The first technique, outlined in the Appendix, is a faster“updating” variant of the least squares technique using QRfactorization particularly suited to the progressive fittingprocess used in greedy RBF fits. This updating form greatlyreduces the cost of adding and removing centers from thecurrent RBF approximation. The updating variant runs 5times faster for 800 data points compared to solving (4) ateach step of the GF and the speed advantage grows withmore data or centers.

The second technique is, at each step of the MGF, totrial a small number of randomly chosen data points as newcenters, adding the point which results in the smallest RMSresidual to the expanding subset of data points used as cen-ters. The following considers how many randomly selecteddata points need to be trialled as centers. With N centers inthe current MGF there are M −N other data points whichcould be centers. Conceptually, every unused data pointcould be trialled as a new center and the resulting RMSresiduals for the trials sorted into a descending list. Let therelative value q of an unused data point be defined as thefractional position in the sorted list. Thus q = 0 for element1 and q = 1 for element M − N (smallest RMS error). Ifthe list is large then the probability that all of the randomsample of n ¿ M − N possible new centers have relativevalue less than q is qn. Consequently the expected max-imum relative value observed in n random choices of newcenter is

E(max(q1, q2, .., qn)) =

∫ 1

0

q(n qn−1)dq =n

n + 1. (7)

For example the center chosen from maximizing over 10 tri-als will on average be around the 91% -tile in the rankedlist, and that chosen from maximizing over 20 trials aroundthe 95%-tile in the ranked list. Further, the probability thatthe maximum over n trials lies in the (1− α)×100% highestranked points is 1− αn, showing in particular that the bestof 10 strategy gives a center amongst the best 20% of cen-ters about 89% of the time. Thus the strategy of adding thecenter resulting in the smallest RMS residual from around10 trials of randomly chosen centers does almost as well asthe much more computationally costly strategy of choosingthe very best possible new center to add.

2.4. Determining the optimal number of centers

The MGF gives a technique to choose a new center toadd to an expanding set, but it does not indicate the opti-mal number of centers. Cross-validation is commonly used

in least squares fitting to avoid under- or over-fitting thedata. In cross-validation the data is repeatedly fitted usingan increasing number of coefficients with one data point leftout. This is computationally prohibitive for large data sets.Hastie et al. [2003] reduce the cost by randomly assigningthe data into K equally sized blocks. One block is left outas test data and the least squares model is fitted to the com-bined K − 1 training sets. The predictions from the fit arecompared to the test data by calculating the RMS resid-ual between the interpolated and test values. Each block isleft out in turn and the K RMS residuals averaged. Theminimum in a plot of mean RMS results against number ofcoefficients/centers indicates the optimal number of centers.Hastie et al. [2003] recommend K = 5 or 10. In this work,K = 10 and to improve the statistics of the validation plotthe data have been randomly assigned to 10 blocks 10 timesand the cross-validation RMS values averaged.

3. Tests with Synthetic Data

Synthetic data sets are used to compare the perfor-mance of S-RBF (1) and DF-RBF(2) interpolators withnoisy data. The synthetic horizontal velocities were for acircular eddy with a Gaussian streamfunction centered in aunit square. The eddy’s tangential velocity was given byuθ = exp(−(r/r0)

2/2 + 1/2)r/r0, where r is the distancefrom the eddy’s center. The eddy’s maximum velocity of 1velocity unit occurs at r = r0 = 0.25 units from the cen-ter. The data simulate moving vessel ADCP measurementsalong a vessel track within the unit square. The tracks hadeast-west lines parallel to the x axis, with short north-southlines joining the east-west lines along the edges of the square(Fig. 1). Two spacings of the east-west lines were used.“Dense data” had tracks 0.25 units apart, giving measure-ments from lines crossing the center, peak flows and edgesof the eddy. “Sparse data” had tracks 0.5 units apart, giv-ing measurements from lines crossing only the center andedges of the eddy. 200 data points were spaced evenly alongboth tracks. For most tests 0.1 velocity units of normallydistributed random noise were added to each component ofthe data, resulting in a velocity noise level of 14%. The per-formance measure used in all but the cross-validation tech-nique was the RMS difference between the noiseless velocityof the underlying Gaussian eddy and the velocity predictedby the RBF interpolators on a fine grid with points spaced0.05 units apart. This compares the performance both onand between vessel tracks. To assess the variability in theRMS difference due to noise in the data each synthetic testcase was repeated 100 times. The 200 data points at whichvelocity values were given were the same for all replicationsbut the noise values at the data points were varied randomlybetween the 100 replicates. The measure of variability usedwas the interval between the 5% and 95% percentile RMSdifferences for the 100 replicates, which will be referred toas the Replication Variability Interval (RVI).

3.1. Performance of smoothing divergence freeRBF’s

Fig. 1a shows the velocity field from the S-RBF (light ar-rows) and DF-RBF (dark arrows) fits to the synthetic eddywith 14% noise found using MGFs. The fits are very similarand the streamfunction contours from the DF-RBF fit using(3) are near circular. For sparse data Fig. 1b shows thatthe S-RBF significantly underestimates the eastward veloc-ity in the areas to the north and south of the eddy’s center.Remarkably the velocities from the DF-RBF fit to sparsedata are very similar to the results for dense data and thestreamfunction contours are again near circular.

Fig. 2 gives velocities on a north-south section throughthe eddy’s center. With dense data both scalar and DF-RBFs are able to reproduce the peak flows, Fig. 2a, though

VENNELL & BEATSON: DIVERGENCE FREE INTERPOLATOR X - 5

the DF-RBF performs slightly better. For sparse data, Fig.2b, the S-RBF, which interpolates the velocity componentsseparately, completely misses the eastward velocity peaks,as there is no data from these peaks on this section. De-spite the lack of data on this section the DF-RBF is able toreproduce the peaks almost as well as with dense data.

The performance of four interpolators are compared inFig. 3 for increasing numbers of coefficients used in the inter-polation. As the number of coefficients/centers increases thecurves show a rapid decrease in RMS difference, as a resultof increasing degrees of freedom which allows the interpola-tor to better fit the data. If too many centers/coefficientsare used then the interpolators begin to fit the noise, result-ing in higher RMS differences with the noiseless analyticeddy. The resulting minimum in the curves indicates theoptimal number of coefficients required to avoid under- orover- fitting the data.

For comparison, curves for scalar and streamfuction opti-mal interpolators [Bretherton et al., 1976] are also includedin Fig. 3. The synthetic data is based on a Gaussianstreamfunction, thus to avoid favoring OI, the OI inter-polations assume a Markov velocity or streamfunction co-variance function rather than a Gaussian covariance func-tion. The results for Markov covariance function (C(r) =s2(1 + r/a) exp(−r/a) where s2 is the signal variance anda the covariance length scale) are however very similar tothose for a Gaussian covariance function. The OI interpola-tors are plotted against 100a in Fig. 3 and s was taken asthe known noise level in the synthetic data, 0.14.

For dense data all the interpolators give minimum RMSdifferences below the noise level, with the DF-RBF andVB06s’ SF-RBF the best performing. In this dense data setSF-OI performed worst, more poorly than is scalar counter-part. For real data s and a values for OI must be estimatedfrom the data. Without time series at each location the esti-mate is typically done by binning the products of deviationsfrom the mean as a function of displacement from each datapoint. For scalar-OI they are radial bins and for SF-OI twodimensional bins are used. The assumed covariance func-tion is then fitted to the binned covariances to give s and a[Emery and Thomson, 2001]. For scalar-OI the binned fitsgive averages over the 100 trials of a = 0.16 and s = 0.16performing marginally worst than at its optimum. For SF-OI the data estimated values are a = 0.48 and s = 0.14.However the SF-OI curves are such that any a > 0.2 doesalmost as well as the optimum which appears to be > 0.6.

There are marked differences in performance for sparsedata (Fig. 3b). Not surprisingly, given the performance ofscalar interpolation in Fig. 2b, scalar-OI and S-RBF areincapable of resolving the eddy, with RMS differences morethan twice the noise level. VB06’s stream function performsbetter but still only achieves a minimum RMS differenceclose to the noise level. The minimum RMS for SF-OI andDF-RBF are well below the noise level demonstrating theability of divergence free interpolators to better span gapsin sparse data. On average DF-RBF performs marginallybetter than SF-OI. For SF-OI the curves is almost flat abovea = 0.3, thus the very high a = 0.94 estimated from fittingthe covariance function to the data would give near optimumresults.

The lower two plots in Fig. 3 compare the variability,RVI, of RMS differences for the five interpolators. RVI is ameasure of the 90% confidence interval across the 100 tri-als. The RBF interpolators all show high RMS variabilityfor small number of centers as fits are sensitive to the loca-tions of the initial centers. This variability rapidly decreasesas number of centers/coefficients increases towards the op-timal number. The scalar and DF-RBFs are less variable,with RVI below 0.02 velocity units with sufficient centers.For sparse data, Fig. 3d, the DF-RBF fits show some vari-ability below the optimal number of centers, but this reducesto less than 0.03 velocity units above the optimal number

of centers. For both dense and sparse data scalar-OI andSF-OI show relatively consistent variability across the rangeof covariance length scales. SF-OI exhibits high variabilityfor dense data and low variability for sparse data, similar tothat of DF-RBF near its optimum number of centers.

3.2. Performance of Modified Greedy Fit

Fig. 4 compares the ability of a GF and a best of 10MGF to fit the synthetic data. The figure shows the av-erage RMS difference between the noiseless eddy and theS-RBF interpolated velocity field evaluated on the fine gridfor 100 synthetic data sets. For all fits the MGF is ableto achieve a slightly lower RMS minimum. The most sig-nificant difference is that the MGF can achieve the mini-mum with typically 2/3 the number of centers of the GF.The tests (not shown) of DF-RBF show a similar economyin the number of centers required to fit the synthetic data.The cross-validation curves for these fits also show the MGFtypically requires only 2/3 the centers to achieve the mini-mum RMS. As noise levels decrease the number of centersto optimally fit the synthetic data is significantly lower forthe MGF, Fig. 4. Such parsimonious fits can be expected tobe more resistant to “following the noise”. Thus even test-ing a very small sample of potential centers can significantlyimprove fits. The major benefit of the MGF is to intro-duce a center whose associated radially symmetric functionis better correlated with the residual between fit and data.In contrast the GF chooses on maximum residual withoutevaluating this choice. The GF in some cases can be shownto choose the worst possible center to add to the set of cen-ters even if there is no noise, particularly in the early stages.The economy of the MGF is greatest at low noise levels, buteven at very high noise levels, 0.71 both fits are able to giveminimum RMS differences around 0.22, well below the noiselevel with the MGF doing slightly better than the GF.

4. Application to oceanographic data4.1. Geostrophic Velocities

Oceanic flows with sufficiently long time scales are dy-namically in near geostrophic balance. For near geostrophicflows on a “beta” plane horizontal divergences are so weakthat their horizontal velocities are to zeroth order two di-mensionally non-divergent. Thus the 2D DF-RBF can beused to interpolate geostrophic velocities. The 2D DF-RBFcan only extract the part of the horizontal velocity measure-ments which is divergence free, i.e. the geostrophic compo-nent and thus is blind to any weak ageostrophic horizontalcomponents of the flow. On a “beta” plane the geostrophicflow’s dynamic height, ξ, is proportional to its DF-RBFstreamfunction (3) by ψ = −gξ/f0, where f0 is the cori-olis parameter at the plane’s central latitude.

4.2. Higher Frequency Velocities

For flows whose time scale is comparable to the earth’s ro-tation period horizonal divergences give rise to small verticalvelocity components, which are often too weak to measure,but play a significant role in zeroth order mass continuity.Thus the horizontal components of higher frequency oceano-graphic velocities, such as tidal flows, are not divergencefree. However their horizontal transport can be divergencefree. Mass continuity for a shallow incompressible fluid canbe written [Gill , 1982]

∂η

∂t+

∂U

∂x+

∂V

∂y= 0, (8)

X - 6 VENNELL & BEATSON: DIVERGENCE FREE INTERPOLATOR

where η is the free surface displacement, h the water depthbelow mean sea level. The horizontal transport vector (U, V )is defined as U =

∫ η

−hudz and V =

∫ η

−hvdz, where (u,v) are

the components of horizontal velocity. For steady flow thefirst term in (8) is zero and the horizontal transport is di-vergence free, allowing DF-RBFs to be used to interpolatethe transport. For unsteady flows the transport is approxi-mately non-divergent if the first term is small relative to theother terms, i.e.

ωη0L

h0u0¿ 1, (9)

where ω is a representative angular frequency, η0 the mag-nitude of temporal variation in surface displacement, L thehorizontal scale, h0 a water depth and u0 the horizontal ve-locity scale. One oceanographic example of flows with non-divergent transports is small scale tidal flows. For semi-diurnal tides of 1 m amplitude, with 1 ms−1 currents in a20m water depth with L =10 km the ratio (9) is only 0.07.Thus tidal flows with similar scales have near non-divergenttransport if they have a 10 km or smaller horizontal scale.The spatial structure of small scale tidal flows have beenmeasured using vessel mounted ADCPs to give high resolu-tion measurements of dynamical terms [Vennell , 2006], vor-ticity (VB06) and secondary flow [Vennell and Old , 2007].The measurement strategy involves repeatedly steaming atrack at least hourly to give a full tidal cycle of ADCP mea-surements spanning an area of interest. The 10 km scalematches the maximum area that can be covered at vesselspeeds of 2ms−1 typically used in near shore survey work.Thus DF-RBF spatial interpolation of the transport is wellsuited to these types of data sets. DF-RBF could also beused to interpolate the transports of measurements fromsome larger scale flows with lower frequencies or in deeperwater which meet the condition (9).

The total water depth is required to obtain the depthaveraged velocity from the transport. Depth measurementscan be fitted with an S-RBF (1) and this fit used to approx-imate the depth anywhere within the measurement area.The interpolated depth and transports can then be usedto give the interpolated depth averaged velocity (u−, v−) =(U/h, V/h). Flow properties can also be calculated directlyfrom the RBF representations. For example the vorticity ofthe depth averaged velocity is

ζ =1

h

∂V

∂x− V

h2

∂h

∂x− 1

h

∂U

∂y+

U

h2

∂h

∂y(10)

where the values and derivatives of transport and waterdepth are evaluated from (1) and (2) respectively, or theiranalytic derivatives.

5. Real Data Tests5.1. Geostrophic Flow- the Local Dynamics Experiment

The PolyMode Local Dynamics Experiment (LDE) in-cluded a long term current meter array in the north At-lantic [Owens et al., 1982]. The current meter mooring datafrom late June 1978 showed the passage of a small cycloniceddy named S2 by Lindstrom et al. [1986]. The thick ar-rows in Fig. 5 show the measured currents at the nine LDEcurrent meters from near 600m depth during the passage ofthis eddy through the array. The current’s components havebeen low pass filtered to suppress tidal and inertial motionsusing Thompson [1983]’s 24m214 filter. Nine mooring loca-tions were insufficient to use a GF smoothing interpolator,so the snapshots of hourly currents were fitted with exactscalar and DF-RBFs (6).

Hua et al. [1986] used OI to give the streamfunction basedon the LDE’s floats, current meter and CTD data. Theyused the longest time series of current meter records to con-struct empirical orthogonal modes, which formed the basis

of a non-isotropic covariance function. In this work we aredeveloping an interpolator for velocity snapshots. OI snap-shot interpolation bins pairs of measurements based on theirseparation and fits a covariance function to the binned data.The 6 or 9 current meters used in the following tests havetoo few pairs to estimate the covariance function’s lengthscale and noise variance. Thus the snapshot DF-RBF willnot be compared to OI and the focus is on comparing S-RBFand DF-RBF.

The DF-RBF interpolation in Fig. 5 clearly shows the20 cms−1 velocities of the 40 km diameter S2 eddy centered5 km north of mooring 6. The eddy passed southwestwardthough the array over a 2 week period, with Fig. 5 corre-sponding to panel VI-29 in Owens et al. [1982]’s Figure 6. Totest the ability of the exact interpolators to give realistic cur-rents between data locations the hourly current meter datawas refitted without the middle line of moorings (3, 4 and8) and the measured currents at the left out moorings usedas test data. Fig. 6 shows an example of the comparison ofmeasured currents and the interpolated currents at moor-ing 3. The time series show the southward flows becomingnorthward as the eddy’s center passes through mooring 3.Both the RBF interpolators resolve the passage of the eddy,with the DF-RBF giving peak values closer to the measuredcurrents than the S-RBF. The RMS residual between thecurrents at all 3 test moorings and the interpolated currentsaveraged over the period of the eddy’s passage was 2.9 cms−1

for the DF-RBF interpolation and 3.8 cms−1 for the S-RBF.Linear interpolation using Delaunay triangulation gave anaverage RMS residual of 4.0 cms−1, similar to S-RBF. Thuson average the DF-RBF performed 24% better than S-RBFand linear interpolation at reproducing the measured cur-rents at the test moorings, again demonstrating the betterperformance of DF-RBF interpolation between data loca-tions.

5.2. Higher Frequency-Separation of tidal flow

Fig. 7 gives an example of raw depth averaged velocitiesmeasured by an ADCP mounted on a moving vessel showingthe separation of tidal flow from a protruding wharf. Themeasurements are from the 1 km wide Auckland HarbourChannel in New Zealand, which connects the Pacific oceanto the Upper Waitemata Harbour. The measurements weremade with a 600 kHz RDI ADCP mounted on the bow ofa 8.5m vessel. The vessel traveling at 2 ms−1 started inthe upper left heading southward, returning to the start 60min later. The ADCP recorded velocity profiles which werethe average of 24 pings spanning 10 sec. Fig. 7 shows the339 raw depth averaged velocity measurements from 60 min.around peak flood tide.

The 10 block cross-validation curve for the ADCP mea-sured horizontal transport of a best of 10 MGF is shown inFig. 8a. The minimum for the DF-RBF indicates approx-imately 60 centers are required to represent the measuredtransports. Measured transports were typically around10m3s−1, thus the curve’s minimum at 0.8 m3s−1 suggestsa noise level in the data of around 8%. Fig. 8a also showsthat the S-RBF fit has a higher minimum RMS than theDF-RBF. Thus the DF-RBF is better able to represent thetest data block and thus gives a better fit to this real datathan the S-RBF. Cross validation of the ADCP measuredtotal water depth (not shown) using a best of 10 MGF tri-harmonic S-RBF indicated that 140 centers were requiredto represent the depth. As derivatives of the velocity fieldwere needed for the calculation of vorticity (10) stiffer tri-harmonic RBFs were used for all fits.

The interpolated velocities calculated from the transportand depth RBFs on a 25 m grid are shown in Fig. 9a. Theseparation of the flood flow from the tip of Fergusson Wharf

VENNELL & BEATSON: DIVERGENCE FREE INTERPOLATOR X - 7

is clearly visible, along with an anti-clockwise eddy north-east of the Wharf. The transport’s streamfunction from (3)in Fig. 9b also shows the separation and eddy. Streamfunc-tion values indicate that, within the area shown, 4000m3s−1

of water are moving eastward and a small fraction of this,100m3s−1, is recirculating within the eddy. Vorticities cal-culated from analytic derivatives of (2) in Fig. 9c showvalues up to 0.02 s−1 in the high shear zone on the north-ern flank of the eddy. The vorticity plume results from highvorticities generated in the vicinity of the separation pointbeing injected into the flow [Signell and Geyer , 1991].

To test the performance of DF-RBFs with sparser datathe ADCP measurements were refitted with one line of dataleft out. The RMS residual between the values predicted bythe fit, at the locations of the left out data, and the left outdata are plotted for an increasing number of centers in Fig.8b. This figure shows the average RMS residual after 11of the 13 lines were left out in turn (the eastern and west-ern most north-south lines were included in all fits). Thisprocess is similar to block cross-validation except in cross-validation the test data is randomly spread across all lines.S-RBF and DF-RBFs have minimum RMS residuals betterthan 1.3m3s−1, when typical transports are O(10)m3s−1,and thus can reproduce the missing lines. The average RMSresidual using linear Delaunay triangulation interpolationwas much higher, 7.1m3s−1. Fig. 8b demonstrates that theDF-RBF interpolation is on average 10% better than theS-RBF at reproducing the missing lines, consistent with thelower minimum in Fig. 8a.

6. Discussion

OI, exact interpolators and smoothing splines require so-lution of large square linear systems to find one coefficientper data point and thus are not tractable for large data sets.By using only a smaller subset of data points as (active)centers the GF RBF interpolation requires the least squaressolution of an M × N system for a much smaller number,N , of coefficients/weights. Computationally the reductionin the number of coefficients is the major advantage of bothlargest residual GF and the MGF. MGF is less computa-tionally efficient than previously used largest residual GF,as it requires around 10 fits per step of the GF. HoweverMGF is better able to represent the data with fewer cen-ters/coefficients, achieving better data compression, thus ismuch less likely to follow the noise in the data. Also theMGF requires fewer steps than the GF to achieve an op-timum number of centers, determined via-cross-validation.The additional computational cost in MGF of trialling datapoints as centers is reduced by an implementation of “updat-ing” Householders least squares and by the trialling of only10 randomly chosen data points per step. These reductionsand the fewer number of centers required give computationaltimes for the updating MGF similar to those for the non-updating largest residual GF. The advantage of the greedyfit RBF is the ability to fit large data sets. It may also bepossible to implement a greedy approach to do global fits oflarge data sets using OI.

Unlike SF-OI the 2D DF-RBFs presented here can beextended to 3D velocity vectors when reliable vertical ve-locity data is available. For 3D interpolation the conditionfor use of DF-RBF is that velocities be small compared thespeed of sound, a condition easily satisfied by oceanographicflows. In the 3D extension the polynomial basis matrix andmatrices inside the summation in (2) have an additional rowand different D(r) functions are required [Handscomb, 1993].For measurements of tidal currents with sufficient durationboth S-RBF and DF-RBF can be extended to do spatialtidal analysis by expanding each of the columns in the ma-trix in the LHS of (6) or (4) in terms of tidal constituentfrequencies. This effectively allows each tidal constituent’s

coefficients to vary spatially as an RBF. The expansion foreach of the m tidal frequencies chosen for inclusion in thetidal analysis increases the number of columns of the LHSmatrix and the number of coefficients to be found by a factorof 2m + 1.

The 2D DF-RBF like SF-OI can only resolve the non-divergent components of the flow. Two examples of flowswhich are non-divergent at zeroth order are geostrophic flowand higher frequency flows which meet the condition (9)such as tidal flows in shallow water with horizontal scales10 km or less. Any weak divergent component will be ef-fectively filtered out by the use of DF-RBFs or SF-OI. Thedivergent components will be part of the residual betweendata and interpolated surface. Thus the residual may beuseful in estimating the magnitude and spatial structure ofthe divergent component flow. However there is a possibil-ity that some divergent flow may be aliased into the non-divergent flow by the interpolator. This possibility has notbeen addressed for SF-OI or DF-RBFs and requires morework.

One advantage of OI is estimates of the noise varianceand the ability to estimate uncertainties in interpolated val-ues. In the RBF greedy fitting process the minimum in thevalidation curve Fig. 8 is a measure of the noise variancebut does not immediately give rise to estimates of the vari-ance in interpolated values. Superficially TPS, which havekernel functions which grow with distance from the center,would be expected to behave poorly if used to extrapolateoutside the region of the data. However the side conditions(5) act to limit the far field behavior of the sum the terms inthe RBFs like (1) to be near linear for bi-harmonic and nearquadratic for tri-harmonic RBF. Thus RBF extrapolationmay behave better than expected, but any extrapolationshould be treated with extreme caution. One advantage ofOI is that can estimate the uncertainty in extrapolated val-ues.

7. Conclusions

An interpolator needs not only to adequately representthe measurements at the data locations, but more impor-tantly must give realistic values where there is no data.With velocity data, interpolating the components indepen-dently can adequately represent the velocity field betweenclosely spaced measurements, e.g. Fig. 2a. However, whenthe measurement spacing is comparable to the features inthe flow field being observed, independent interpolation cangive unrealistic velocities between measurements, Fig. 2b.For sparse data scalar interpolation cannot adequately rep-resent the flow field between data points, Fig. 3b. Thedivergence free approach exploits mass continuity to enforcedependence between the interpolated velocity components.The examples demonstrate that divergence free interpola-tion significantly improves the interpolation of sparse databoth at and between data points and thus can better re-solve flow features whose scale is comparable to the mea-surement spacing. The inherent smoothness and continu-ity of derivatives make DF-RBF interpolation well suited toevaluation of velocity gradients needed to give observationsof fluid properties such as vorticity. The 2D DF-RBF in-terpolator presented is easily extended to 3D velocity databy using a different set of kernel functions, making it moreflexible that SF-OI.

In the synthetic data tests DF-RBF performed as wellor better than either OI technique. On average, for sparsedata, DF-RBF performed slightly better than SF-OI andalso does not require prior estimates of covariance lengthscale or noise variance. The main computational advantageof GF RBF interpolation over OI, smoothing splines and

X - 8 VENNELL & BEATSON: DIVERGENCE FREE INTERPOLATOR

exact interpolators is the reduction in the number of coef-ficients/terms needed to describe the interpolating surface,making it computationally tractable for large data sets. TheMGF is computationally slower than largest residual GF butgives slightly better fits using fewer coefficients. It is alsoinherently more resistant to data errors and to following thenoise. With the fast updating technique the additional com-putational cost of the MGF is significantly reduced.

Acknowledgments. Ports of Auckland Ltd. for the use ofthe ADCP data and the anonymous reviewers whose commentsgreatly improved the presentation of the paper.

VENNELL & BEATSON: DIVERGENCE FREE INTERPOLATOR X - 9

Appendix A: Fast updating constrainedleast squares

The greedy fit method allows an updating approach to solvingthe MGF’s constrained least squares system. This significantlyimproves the computational speed with which candidate centersare trialled in the MGF by exploiting factorizations from previoussteps, avoiding carrying out a fresh least squares solution for eachtrial. The updating approach uses direct elimination to convertthe constrained least squares system into an unconstrained sys-tem. It then uses stored Householder vectors from previous stepsto rapidly update new columns associated with the candidate cen-ter, to quickly bring the new columns into upper triangular form.The updating technique will be outlined for an S-RBF, with thealterations for DF-RBF commented on later. The updating tech-nique for S-RBF starts with choosing one special center for eachof the ` constraints. How this choice is made will be discussedlater. The system when trialling the first candidate data point asa center (4) can be partitioned as

[P(xd) Φ(xd, xc) Φ1(xd, xc

1)]

α

ββ∗1

≈ F . (A1)

where Φ is Φ evaluated for the l special centers, xc. xc1 is the

location of the candidate center being trialled, and Φ1 its asso-ciated column in the matrix of the system. The constraints aresimilarly partitioned, which allows (5) to be rearranged as

β = −C−1PT1 (xc

1)β∗1 (A2)

where C = PT (xc) is an l × l matrix. Equ. (A2) allows β andits associated columns, Φ, to be eliminated from (A1) to give theunconstrained least squares problem

[P(xd)

(Φ1 − ΦC−1PT

1

) ] [αβ∗1

]≈ F . (A3)

Effectively (A2) changes the representation of the solution to onewith ` fewer parameters. In this new basis for feasible solutionsconstraints are always satisfied and the problem becomes a stan-dard unconstrained least squares problem. The system (A3) issolved by multiplying by a sequence of `+1 Householder matrices,which reduce the elements below the diagonal to zero. The solu-tion for (α, β∗1 ) is then easily obtained by back substitution andtransformed back into the original basis as (α,−C−1P T

1 β∗1 , β∗1 ).The updating process simply repeats this process as candidatedata points are trialled or included in the set of expanding cen-ters.

After k centers have been included in the updating process,before reduction to upper triangular form, the system has theform[

Uk−1 Hk+l−1...H1

(Φk − ΦC−1PT

k

) ] [αβ∗

]≈ Fk−1.

(A4)where Uk−1 is an M × (k + ` − 1) upper triangular matrix,and Fk−1 = Hk+l−1Fk−2. The updating steps are as follows.The kth M × 1 column to be added, Φk, is modified to giveΦk − ΦC−1PT

k . The modified column is then brought up todate by multiplying by all the Householder matrices from earliersteps which were used to reduce previously added columns to up-per triangular form. The result is an M × 1 column vector withnon zero entries in (A1). The latest Householder reflector, Hk+l,is formed to reduce the elements below the diagonal in this vectorto zero (this latest Householder transformation has no affect onelements above the diagonal). The lower components of the RHSare then updated to Fk = Hk+lFk−1. This replaces the originalsystem by the upper triangular system,

Uk

[αT

β∗

]≈ Fk,

which has effectively been formed from (A4) by multiplying bothsides by the orthogonal Householder matrix. The RMS error canbe calculated from the lower components of the right hand sidevector Fk. If desired the solution of the system can be calculatedby first solving for the least squares solution in the transformed

basis by back substituting in the system above. Then, option-ally, that solution can be transformed back to be in terms of theoriginal basis.

α−C−1PT (xc)β∗

β∗

, (A5)

which can then be used to evaluate the interpolated surface atthe current step. The updated RHS and new Householder arerecorded and the process repeated to add additional columns.Adding one center to a greedy fit for an S-RBF adds one columnper step, a 2D DF-RBF requires adding two columns and hencetwo matrix updates per center added. The updating process canbe done quickly as the structure of the Householder matrices al-lows the series of multiplications, or transformations, required tobring the new column up to date to be carried out an order ofmagnitude faster than ordinary matrix multiplication [Golub andVanLoan, 1996]. Householder transformations are carried out us-ing a Householder vector and a constant. Memory requirementsare reduced by storing the Householder vector for each step belowthe diagonal in the design matrix, where the elements are zero.

Trialling centers in the MGF is done by recording the currentstate of the RHS, Fk−1, “appending” the columns associatedwith a candidate center using the updating process above to geta solution. The resulting RMS residual in fitting the data isrecorded to enable picking the “best of n” center to include. Af-ter each candidate center is trialled the matrices are wound backto their previous state by overwriting the RHS with the storedFk−1 and ignoring the newly introduced columns “appended” toA by decrementing a column index. After this everything is readyto try another candidate center.

To start the updating process an initial “special” set of cen-ters needs to be chosen. In the S-RBF case the special pointscan be any set of ` data points which are unisolvent for polyno-mials of degree k − 1. That is any ` points such that the onlypolynomial of degree k − 1 which vanishes at all of ` the pointsis zero everywhere. For linear polynomials in 2D this reduces tothe simple geometric condition that not all three points lie ona single straight line. However, use of some sets satisfying thisunisolvency condition, for example those with data points in nearalignment, can result in numerical problems due to poor condi-tioning. The relevant condition number to consider is that of theoperator mapping values at the ` special points to a polynomialviewed as a continuous function over the region of the measure-ments. In the case of an S-RBF with a linear supplementarypolynomial this operator norm is approximately minimized bychoosing the 3 special points so as to maximize the area of thetriangle with the points as vertices. Exact maximization of thetriangle area is not required and choosing the best set from say100 random trials is satisfactory. For DF-RBFs in 2D there are` special functionals to construct rather than ` special centers.Each of these functionals being the evaluation of a directionalderivative at a point. Since ` is generally odd, that task can beachieved by using as functionals velocities in the two coordinatedirections at each of b`/2c points, and a velocity in one coordinatedirection at a single further point. These functionals are requiredto be unisolvent for divergence free polynomials of degree k − 1.This latter condition is easily checked as it reduces to the ` × `submatrix formed from the first ` columns of PT (xc) being in-vertible. As in the S-RBF case numerical conditioning can beimproved by choosing the special functionals to approximatelyminimize the norm of the operator taking the ` values of specialfunctionals to a divergence free polynomial field.

References

Amodei, L., and M. Benbourhim, A vector spline approximation,J. Approx. Theory, 67, 51–79, 1991.

Beatson, R. K., W. A. Light, and S. Billings, Fast solution of theradial basis function interpolation equations: Domain decom-position methods, SIAM J. Sci. Comput., 22 (5), 1717–1740,2000.

Bretherton, F., R. Davis, and C. Fandry, A technique for objec-tive analysis and design of oceanographic experiments appliedto MODE-73, Deep-Sea Res, 23 (7), 559–582, 1976.

Candela, J., R. C. Beardsley, and R. Limburner, Separation oftides and sub-tidal currents in ship-mounted ADCP observa-tions, J. Geophys. Res., 97, 769–788, 1992.

X - 10 VENNELL & BEATSON: DIVERGENCE FREE INTERPOLATOR

Emery, W., and R. Thomson, Data analysis methods in physicaloceanography, Elsevier Science, 2001.

Gill, A., Atmospheric-Ocean Dynamics, Academic Press, 1982.Golub, G., and C. F. VanLoan, Matrix Computations, John Hop-

kins, London, 1996.Handscomb, D., Local recovery of a solenoidal vector field by an

extension of the thin plate spline technique, Numerical Algo-rithims, 5, 121–129, 1993.

Hastie, T., R. Tibshirani, and J. H. Friedman, The Elements ofStatistical Learning, Springer, New York, 2003.

Hua, B., J. Mcwilliams, and W. Owens, An objective analysis ofthe POLYMODE local dynamics experiment. Part II: Stream-function and potential vorticity fields during the intensive pe-riod, Journal of Physical Oceanography, 16 (3), 506–522, 1986.

Lindstrom, E. J., C. C. Ebbesmeyer, and W. B. Owens, Structureand origin of a small cyclonic eddy observed during the POLY-MODE Local Dynamics Experiment, J. of Physical Oceanog-raphy, 6, 562–570, 1986.

Lowitzsch, S., Error estimates for matrix-valued radial basis func-tion interpolation, J. Approx. Theory, 137, 238–249, 2005.

McIntosh, P. C., Oceanographic data interpolation: Objectiveanalysis and spline, J. Geophys. Res., 95(C8)(13), 13,529–13,541, 1990.

Meinguet, J., Multivariate interpolation at arbitrary points madesimple, Zeitschrift fur Angewandte Mathematik und Physik,30, 292–304, 1979.

Munchow, A., Detiding three-dimensional velocity data in coastalwaters, J. Atmospheric and Oceanic Tech., 17, 736–748, 2000.

Narcowich, F., and J. Ward, Generalized Hermite interpola-tion via matrix-valued conditionally positive definite functions,Math. Comp., 63, 661–687, 1994.

Owens, W. B., J. R. Luyten, and H. L. Bryden, Moored velocitymeasurements on the edge of the gulf stream recirculation, J.of Marine Research, Supplement to 40, 509–524, 1982.

Sandwell, D., Biharmonic spline interpolation of geos-3 and seasataltimeter data, Geophys. Res. Letters., 14 (2), 139–142, 1987.

Signell, R. P., and W. R. Geyer, Transient eddy formation aroundheadlands, J. Geophys. Res., 96, 2561–2575, 1991.

Thompson, R. O., Low-pass filters to suppress inertial and tidalfrequencies, J. of Physical Oceanography, 13, 1077–1083, 1983.

Vennell, R., ADCP measurements of momentum balance and dy-namic topography in a constricted tidal channel, J. of PhysicalOceanography, 36 (2), 177–188, 2006.

Vennell, R., and R. Beatson, Moving vessel ADCP measurementof tidal streamfunction using radial basis functions, J. Geo-phys. Res., 111 (C09002), doi:10.1029/2005JC003321, 2006.

Vennell, R., and C. P. Old, High resolution observations of theintensity of secondary circulation along a curved tidal channel,J. Geophys. Res., 112 (C11008), doi:10.1029/2006JC003764,2007.

R. Vennell, Department of Marine Science, University ofOtago, 310 Castle St, Dunedin, NZ ([email protected])

R. Beatson, Department of Mathematics, University of Can-terbury, Christchurch, NZ ([email protected])

VENNELL & BEATSON: DIVERGENCE FREE INTERPOLATOR X - 11

Table 1. Basic functions for 2D scalar and Divergence FreeRBF interpolations. A basis for the corresponding polyno-mial space is also given. For triharmonic RBFs include thepolynomials listed for biharmonic RBFs.

Type Function Biharmonic Triharmonic

φ(r) r2 log r r4 log r

Scalar P[

1 x y] [

. . . x2 xy y2]

Energy

R2

(s2

xx + 2s2xy + s2

yy

)dxdy

R2

(s2

xxx + 3s2xxy + 3s2

xyy + s2yyy

)dxdy

D1(r) r2(12 log r + 7) −r4(30 log r + 11)

Div. D2(r) −(8 log r + 6) r2(24 log r + 10)

Free PD

[1 0 x y 00 1 −y 0 x

] [... x2 2xy y2 0... −2xy −y2 0 x2

]

Ψ(r) r2(1 + 4 log r) −r4(1 + 6 log r)

Q[

y −x xy 12y2 − 1

2x2

] [... x2y xy2 1

3y3 − 1

3x3

]

Energy

R2

(u2

xxx + 3u2xxy + 3u2

xyy

+u2yyy + v2

xxx

+3v2xxy + 3v2

xyy + v2yyy

)dxdy

R2

(u2

xxxx + 4u2xxxy + 6u2

xxyy + 4u2xyyy

+u2yyyy + v2

xxxx

4v2xxxy + 6v2

xxyy + 4v2xyyy + v2

yyyy

)dxdy

X - 12 VENNELL & BEATSON: DIVERGENCE FREE INTERPOLATOR

Figure 1. Comparison of velocity fields from scalar RBF(gray arrows) and DF-RBF (black arrows) fits using 30centers to velocity data with 14% noise for the syntheticeddy. Some gray arrows S-RBF are obscured by darkDF-RBF arrows. Thin black contours are the stream-function from the DF-RBF evaluated using (3) and thegray dashed line the vessel track. a) Dense data. b)Sparse data.

Figure 2. Comparison of eastward velocity along x =0.5 from scalar RBF and DF-RBF fits using 30 centers tosynthetic velocity data with 14% noise for an eddy witha Gaussian streamfunction. Inset shows vessel track inrelation to peak velocity of eddy. Vertical gray blocksindicate data locations/vessel track. a) Dense data. b)Sparse data.

Figure 3. Comparison of five interpolation techniqueson analytic synthetic eddy data. a) Average RMS differ-ence between fit and analytic eddy on fine grid for 100trials of dense data. Inset shows vessel track in relationto eddy. b) average RMS difference for sparse data. c)Variability of RMS difference for dense data. d) Variabil-ity of RMS difference for sparse data, a measure of the90% confidence interval across the 100 trials. The OI re-sults are plotted against 100× the covariance function’slength scale, a.

Figure 4. Comparison of Greedy Fit and best of 10Modified Greedy Fit for a bi-harmonic S-RBF to densesynthetic data. The y axis is RMS difference between fitand analytic Gaussian eddy on the fine grid. Curves showfits for three different noise levels in synthetic velocitydata. Solid lines are MGF and dashed lines GF.

Figure 5. Interpolated velocities from Local Dynam-ics Experiment currentmeter moorings at 600m on 27thJune 1978. Thick black arrows are mooring velocities,thin black arrows are exact fit biharmonic DivergenceFree RBF interpolated velocities using data from all ninemoorings. Gray contours are the streamfunction adjustedto have an interval equivalent to 1 mm in dynamic height.

Figure 6. Comparison of measured and interpolatedtime series from mooring 3 Local Dynamics Experimentat 600m depth. Inset shows the location of the ninemoorings. Measurements at moorings 3,4,8 were left outof data used in interpolations.

Figure 7. Raw moving vessel ADCP measurements of depth averaged velocity near peak flood in Auckland Harbour.

Figure 8. a) Cross validation curve for a best of 10MGF to data in Fig. 7. b) Average residual betweeninterpolated and measured transport when leaving oneof the 13 lines of data out of the MGF.

Figure 9. Flows given by a triharmonic divergence freeRBF fit to data in Fig. 7. Grey line shows vessel trackand gray dots some of the 60 centers chosen by the MGF.a) Depth averaged velocity. b) Transport streamfunc-tion evaluated using (3). c) Depth averaged vorticityevaluated using (10). Grey area has vorticities > 100 x10−4s−1.

VENNELL & BEATSON: DIVERGENCE FREE INTERPOLATOR X - 13

Fig. 1

0 0.2 0.4 0.6 0.8 10

0.2

0.4

0.6

0.8

1Dense data

a)

0 0.2 0.4 0.6 0.8 10

0.2

0.4

0.6

0.8

1Sparse data

b)

Fig. 2

0 0.2 0.4 0.6 0.8 1−1

−0.5

0

0.5

1

Dense data

y

x V

eloc

ity

a)

Exact solutionScalar RBF fitDiv. Free RBF fit

0 0.2 0.4 0.6 0.8 1−1

−0.5

0

0.5

1

Sparse data

y

b)

Exact solutionScalar RBF fitDiv. Free RBF fit

X - 14 VENNELL & BEATSON: DIVERGENCE FREE INTERPOLATOR

Fig. 3

10 20 30 40 50 600

0.1

0.2

0.3

0.4

RM

S d

iffer

ence

RMS − Dense Data

a)

10 20 30 40 50 600

0.05

0.1

0.15

0.2

Number of coeff./Covariance Length scale

RM

S v

aria

bilit

y, R

VI

RMS variation− Dense Data

c)

scalar RBFSF RBF, VB06Div. Free RBFscalar OISF OI

10 20 30 40 50 600

0.1

0.2

0.3

0.4

RM

S d

iffer

ence

RMS − Sparse Data

b)

10 20 30 40 50 600

0.05

0.1

0.15

0.2

Number of coeff./Covariance Length scale

RM

S v

aria

bilit

y, R

VI

RMS variation− Sparse Data

d)

Fig. 4

10 20 30 40 50 600

0.1

0.2

0.3

0.4

0.000.14

0.42

0.71

Number of centers

RM

S di

ffer

ence

on

fine

gri

d

Greedy FitModifed Greedy Fit

VENNELL & BEATSON: DIVERGENCE FREE INTERPOLATOR X - 15

Fig. 51

2

3

4

5

6

7

8

9

20km

Local Dynamics

Experiment

29−Jun−1978

20 cms−1

Fig. 6

23−Jun−78 27−Jun−78 01−Jul−78 05−Jul−78 09−Jul−78−20

−15

−10

−5

0

5

10

15

Nor

thw

ard

velo

city

, cm

s−1

Mooring 3Measured currentDiv. Free RBF interpolationScalar RBF interpolation

12

34

56

7

89

X - 16 VENNELL & BEATSON: DIVERGENCE FREE INTERPOLATOR

Fig. 7

1 ms−1

100m

Fergusson Wharf

Naval Base

Pac

ific

Oce

an

Upper Waitemata Harbour

City of Auckland

Fig. 8

0 20 40 60 80 100 1200.5

1

1.5

2Cross Validation

RM

S re

sidu

al tr

ansp

ort,

m2 /s

Number of Centres

a)

Scalar RBF Div. free RBF

0 20 40 60 80 1000.5

1

1.5

2Leave One Line Out

Number of Centres

RM

S re

sidu

al tr

ansp

ort,

m2 /s

b)

Scalar RBF Div. free RBF

VENNELL & BEATSON: DIVERGENCE FREE INTERPOLATOR X - 17

Fig. 9

1 ms−1

100m

a)

Velocity

−3000

−2000

−1000

−5000

050

50

50

100

100m

b)

Streamfunction, m3s−1

−50

−50

−500 0

0

0

0

0

0

0

0

0

0

0

5050

50

100100

100

100200

100m

c)

Vorticity, s−1