Multidimensional spline integration of scattered data

https://doi.org/10.1016/j.cpc.2011.03.009Get rights and content

Abstract

We introduce a numerical method for reconstructing a multidimensional surface using the gradient of the surface measured at some values of the coordinates. The method consists of defining a multidimensional spline function and minimizing the deviation between its derivatives and the measured gradient. Unlike a multidimensional integration along some path, the present method results in a continuous, smooth surface, furthermore, it also applies to input data that are non-equidistant and not aligned on a rectangular grid. Function values, first and second derivatives and integrals are easy to calculate. The proper estimation of the statistical and systematical errors is also incorporated in the method.

Introduction

Experiments usually result in a discrete set of datapoints Fi measured at a discrete set of coordinates qi. It is in general useful to interpolate this discrete set to obtain a smooth surface S(q) as a function of the coordinates. A more complicated situation is when derivatives F/qi are measured, and the surface S(q) which fits on this grid of gradients the best is sought for.

The latter case is commonly encountered in statistical physical problems, e.g. in lattice field theory, where using standard Monte Carlo methods one is not able to measure the (logarithm of the) partition function logZ itself, but only its derivatives with respect to the parameters of the theory. These parameters play the role of the above coordinates q, and the free energy logZ as a function of the parameters is what one is after. A multidimensional integration is usually carried out in such situations, which, however, can only be applied when the measurements reside on a rectangular grid. Furthermore, the result will also depend on the integration path and is only guaranteed to be smooth along the path itself.

The smooth interpolation throughout the whole grid can be obtained by e.g. a multidimensional spline function. For a detailed discussion of splines and their application see e.g. Refs. [1], [2] or [3]. Methods to determine a two-dimensional spline surface upon a rectangular grid given the values of the surface at the grid points have been known for a long time (see e.g. Ref. [4]), along with algorithms for nonrectangular input datasets (see e.g. Refs. [5], [6]), using once again the values of the surface at given coordinates. Since then spline approximation has received quite a lot of attention and the mathematical basis was studied in detail. For recent reviews on these approaches see e.g. Refs. [7], [8].

Further methods for multivariate approximation have also been developed, e.g. using rational basis functions, B-splines, tensor product splines, Powell–Sabin splines, triangulations, genetic algorithms or modified spline techniques. Moreover, based on such methods, various algorithms for spline fitting are also present in the literature, see Refs. [9], [10], [11], [12], [13], [14], [15], [16], [17], [18], [19], [20], [21], [22], [23], [24], [25], [26]. Techniques for handling discontinuities (e.g. Ref. [27]) and imposing constraints on the fitted function can also be found (e.g. Refs. [28], [29]).

In this paper we present a method which determines the smooth surface S(q) using the gradient of the surface measured at some scattered values of the coordinates, and thus corresponds to a multidimensional integration scheme. The algorithm includes an introduction of a set of nodepoints, upon which the multidimensional spline is determined. This determination is linear and thus straightforward to compute. By a systematical variation of the number and position of the nodepoints the method is adapted to the particular problem, which is highly important for interpolation in more than one dimensions, as pointed out in Ref. [5]. Other interpolation schemes for which the parametrization is adapted to the data (like the rational basis function approach) are also well suited for the present problem and may be applied in this scope.

The paper is structured as follows. In Section 2 we remind the reader how a spline function in an arbitrary number of dimensions D is defined and then in Section 3 we show how the fit to the measurements is carried out. Since in practice D>2 is seldom necessary, in order not to complicate the notation we present the method in detail for the case of two dimensions. Nevertheless, D>2 is also straightforward to implement. Then we present the algorithm for the systematical placement of the nodepoints, and finally show several results on mock data.

Section snippets

Spline definition

In two dimensions a cubic spline is defined upon a grid {xk,yl} with 0k<K, 0l<L. The spline surface is unambiguously determined by the values that it takes at the nodepoints fk,l=S(xk,yl) (and the boundary conditions, which we specify to be “natural”, see later). A grid square [xk,xk+1]×[yl,yl+1] will be shortly referred to as {k,l}. The spline function itself is compactly written as1

Spline fitting

For any value of the parameters fk,l the coefficients Ci,jk,l – i.e. the whole spline surface S(x,y) – are known unambiguously. This way we consistently parameterized the spline surface. Now we want to set the spline parameters fk,l such, that derivatives of the spline surface are as close to some previously measured values as possible. Note that this way the function S(x,y) will be undetermined up to an overall constant, since the translation S(x,y)S(x,y)+A does not influence the derivatives.

Stable solutions

The method described in the previous section is bound to give the function S(x,y) for which the sum of deviations χ2 is the smallest. The solution on the other hand also depends on the number and the position of the nodepoints, and these have to be tuned appropriately in order to determine the surface that fits best.

If the number of nodepoints KL is small compared to the number of measurements N, then the reduced sum of deviations will be large (χ2/dof1) and the spline function S(x,y) may not

Systematics of the method

The statistical error σstat of the result from the spline fitting method described above can be determined using the standard jackknife algorithm, i.e. the system of linear equations (7) needs to be solved for each jackknife sample.7 The systematical error on the other hand can be determined by varying the nodepoints {xk,yl}. Based on experience the number of nodepoints

Testing the method against mock data

We tested the spline fitting method in two dimensions against three sets of mock data. Input to the method are the coordinates qm(x) and qm(y) and the derivatives Dm(x), Dm(y) with m=0,,N1 together with 10–10 jackknife samples at each m. The derivatives were generated using an original function F(x,y) and were scattered for the jackknife samples to have normal distribution with a relative width of Δ. In Table 1 we tabulate information about the data: the function F, the number of

Summary

In this paper we presented an algorithm that determines a smooth hypersurface S(q) using the measured gradient of the surface. The algorithm can thus be applied as a multidimensional integration method, which is often useful if one is interested in a continuous approximation of a function of more than one variables. We demonstrated the method on several examples that resemble a situation of the pressure near an analytic, crossover-like phase transition, as a function of two parameters. The

Acknowledgements

This work is supported by the grant (FP7/2007–2013)/ERC no. 208740. The author owes many thanks to Sándor Katz for stimulating and useful discussions. Furthermore the author thanks Sándor Katz, Zoltán Fodor and Kálmán Szabó for a careful reading of the manuscript.

References (34)

  • K. Willemans et al.

    Surface fitting using convex Powell–Sabin splines

    Journal of Computational and Applied Mathematics

    (1994)
  • B. Jüttler

    Surface fitting using convex tensor-product splines

    Journal of Computational and Applied Mathematics

    (1997)
  • H. Park

    B-spline surface fitting based on adaptive knot placement using dominant columns

    Computer-Aided Design

    (2011)
  • E. Quak et al.

    Cubic spline fitting using data dependent triangulations

    Computer Aided Geometric Design

    (1990)
  • P. Fong et al.

    An implementation of triangular B-spline surfaces over arbitrary triangulations

    Computer Aided Geometric Design

    (1993)
  • M.C. López de Silanes et al.

    Spline approximation of discontinuous multivariate functions from scattered data

    Journal of Computational and Applied Mathematics

    (2001)
  • D.F. Rogers et al.

    Constrained B-spline curve and surface fitting

    Computer-Aided Design

    (1989)
  • Cited by (26)

    View all citing articles on Scopus
    View full text