Skip to main content
Journal of Research of the National Institute of Standards and Technology logoLink to Journal of Research of the National Institute of Standards and Technology
. 2003 Feb 1;108(1):69–78. doi: 10.6028/jres.108.007

Uncertainties in Interpolated Spectral Data

James L Gardner 1
PMCID: PMC4844522  PMID: 27413595

Abstract

Interpolation is often used to improve the accuracy of integrals over spectral data convolved with various response functions or power distributions. Formulae are developed for propagation of uncertainties through the interpolation process, specifically for Lagrangian interpolation increasing a regular data set by factors of 5 and 2, and for cubic-spline interpolation. The interpolated data are correlated; these correlations must be considered when combining the interpolated values, as in integration. Examples are given using a common spectral integral in photometry. Correlation coefficients are developed for Lagrangian interpolation where the input data are uncorrelated. It is demonstrated that in practical cases, uncertainties for the integral formed using interpolated data can be reliably estimated using the original data.

Keywords: interpolation, photometry, radiometry, uncertainty

1. Introduction

Measurements of spectral irradiance, spectral responsivity or spectral reflectance are often made for a limited set of wavelengths and then used to calculate weighted spectral sums for photometry, colorimetry or filter radiometry. It is often necessary to interpolate the spectral data to a finer grid to avoid errors arising from the discrete approximation used to estimate the integral where the weighting function varies strongly between the wavelengths at which the measurements were made [1]. Interpolated values are then correlated to the original data and to nearby interpolated points; unless these correlations are taken into account, uncertainty calculations will give misleading results, generally underestimating errors in the spectral sums by significant amounts.

Interpolation may also be required when reference standards are provided for a limited set of wavelengths. Many of the primary reference standards in the national metrology institutes are derived in a functional form, and can be calculated on as fine a wavelength grid as required, along with all the necessary correlations [2]. However, calibrations of client lamps or detectors involve a transfer, by comparison, to artifacts that do not necessarily show a spectral variation that is easily modeled, and in the interests of reducing costs may be provided on a limited number of wavelengths. The reference data at different wavelengths may also be correlated. While the primary reference standards are often strongly correlated between wavelengths, the transfer process itself adds uncertainty that is generally random and often reduces the correlations to negligible levels [2]

Where data are available at sufficient wavelengths to avoid errors due to the sum approximation to the integral, it is preferable to interpolate reference tables, such as the photometric response function Vλ and the colorimetric tristumulus response functions [3] to the wavelengths at which measurements are taken, because those tables contain no uncertainty. However, interpolation of measurement data is often applied. One reason is that software for a calculation may require data at a particular interval, another is that instrument measurement programs may provide limited sets of data.

Following a brief description of uncertainty propagation, this paper is divided into two sections. The first covers Lagrangian interpolation, the second cubic spline interpolation; these are the two most commonly used interpolation methods. In each section, interpolation from a data set which is itself correlated is considered. Various simplifications for practical applications are made, and examples are presented. A conclusion is that in practical terms, uncertainty can be accurately derived from the original data set without a complex calculation of correlations.

2. Propagation of Uncertainty

Uncertainty propagation is described in detail in the ISO Guide to the Expression of Uncertainty in Measurement [4]. The uncertainty in a quantity y formed by combining measured quantities xi through the relationship y = f (x1, x2,..xN) is given by

u2(y)=i=1N(fxi)2u2(xi)+i=1Nji=1Nfxifxju(xi,xj), (1)

where u(xi) is the uncertainty in xi and u(xi, xj) is the covariance between xi and xj. For uncorrelated input quantities, the covariance between pairs of variables is zero and Eq. (1) reduces to the "sum of squares" commonly applied. The derivatives ∂f / ∂xi are sensitivity coefficients for the dependence of y on the various measured quantities. Given that u2 (xi) ≡ u(xi, xi), Eq. (1) can be expressed as

u2(y)=fyTUxfy, (2)

where

f=(fx1fx2..fxn)T (3)

is a column vector of sensitivity coefficients (T indicates the transpose) and

Ux=[u(xi,xj)] (4)

is the N× N uncertainty matrix.

Interpolation of spectral data is generally performed to produce a set of values (pk, xk) from set (yi, xi) where xi is the independent variable (generally wavelength in radiometry). Quantities in the set (pk, xk) that depend on the same (yi, xi) are correlated through this common dependence. The covariance between two values pk and pm (and, when k = m, the square of the uncertainty) is given by

u(pk,pm)=i=1Nj=1Npkyipmyju(yi,yj). (5)

In matrix form, this is simply expressed as

u(pk,pm)=fpk TUyfpm. (6)

It is sometimes convenient to use correlation coefficients rather than covariances, defined as

r(pk,pm)=u(pk,pm)u(pk,pk)u(pm,pm). (7)

A matrix of correlation coefficients is square, symmetric about the diagonal and has value 1 in the diagonal elements.

3. Lagrangian Interpolation

We have a tabulated function yi at values xi:

yi=y(xi),i=1.N. (8)

For x in the range xm to xm+n, the formula for Lagrangian interpolation is [5]

p(x)=j=1nij=1n(xxm+i1)ij=1n(xm+j1xm+i1)ym+j1=j=1nwjym+j1. (9)

Equation (9) represents an (n−1)th order polynomial fitted through the n original values. Interpolated data are formed as a linear combination of nearby existing data. Sensitivity coefficients for the dependence of the interpolated data on the input data are simply the weights wj in Eq. (9). Covariances between the output values, that is, the original input values plus the interpolated values, take several forms. Correlations present in the original values remain. The values newly formed by interpolation are correlated to both the input values forming them (and through them to the remaining input values if correlations are present in the original set) and to any new values formed from common input values. All of these covariances, including the uncertainty of the interpolated values, can be calculated through Eq. (6).

In many instances, the input data yi are present at regular values of xi and further, the output data are also required at regular intervals. Interpolation is usually then performed by running Eq. (9) through the data and forming a new value or values in the center of the range. The multipliers convolving the data are determined by the interval spacings only and can be calculated prior to the interpolation. This was clearly demonstrated by Savitsky and Golay [6] in the development of their algorithms for smoothing and differentiation of spectral data where polynomial expressions of various order are fitted to regularly-spaced data; in those cases, the coefficients are determined as fixed linear combinations of the input dependent data. The arguments presented here for Lagrangian interpolation can easily be extended to cover smoothing of data using the Savitsky-Golay routines. Two-point Lagrangian interpolation forming a new value in the center of the existing values has weights (w1, w2)=(½, ½), equivalent to a linear interpolation.

Propagation of uncertainty through two common examples of Lagrangian interpolation used in photometry are now discussed. In both of these we consider the calculation of illuminance response to CIE illuminant D65, a tabulated distribution carrying no uncertainty, for a photometer whose spectral response is a close approximation to Vλ, measured at different spectral intervals and where the measured response values are uncorrelated. These distributions are shown in Fig. 1 for a wavelength interval of 5 nm. As the response function tapers to zero at each end, the luminance response is given as

RV=Δλi=1NRiED65,i, (10)

where Ri is the photometer response and ED65,i is the illuminant value at the ith wavelength, respectively, and Δλ is the 5 nm wavelength separation between the values.

Fig. 1.

Fig. 1

Distributions CIE Vλ and D65 used for interpolation examples.

For uncorrelated spectral response values, the uncertainty in Rv is given by

u2(RV)=(Δλ)2i=1NED65,i2u2(Ri). (11)

For values as tabulated by CIE [3], the value of Rv is 10567.41, with an uncertainty 19.60 (relative uncertainty 0.1855 %) if the responsivity values have a relative uncertainty of 1 % and are uncorrelated. (Note that extra significant figures for the uncertainty are presented above those of normal practice for the purpose of comparison.)

3.1 Photometer Measured at 10 nm Intervals, Interpolated to 5 nm

The spectral integral Eq. (10) for input values on a 10 nm grid evaluates to 10568.18, a small change compared to the 5 nm data due to the discrete approximation to the integral; the relative uncertainty for uncorrelated spectral response values with a relative uncertainty of 1 % becomes 0.2623 %, or the expected 2 increase compared to the response measured at 5 nm intervals. We wish to interpolate the photometer response with a four point Lagrangian function to data on a 5 nm interval. The weights for Eq. (9) are then

w1,w2,w3,w4=116,916,916,116 (12)

and, as the input data are uncorrelated, the uncertainty for an interpolated value is given by

u2(p)=j=14wj2u2(ym+j1). (13)

In any given interval spanning four input values, the uncertainty value u (yi) is approximately constant, and the interpolated values have an uncertainty approx. 80 % of the original values in that range. If we ignore the correlations that have been introduced, the relative uncertainty of the integral evaluates as 0.17 %, low compared to the original value and clearly incorrect as it would imply that it could be reduced to zero by repeated interpolation.

A full correlation matrix for the output values is formed as follows. First the interpolation is performed (using linear interpolation in the first and last intervals of the input values). From N original values, we now have (2N−1) values

yi=yoriginal,j;iodd,j=(i+1)/2yi=w1yi3+w2yi1+w3yi+1w4yi+34<i<2N4,ieven.; (14)

Uncertainties for these values are known for the original data and for the interpolated data from Eq. (13) and these are used to populate the diagonal elements of the uncertainty matrix Uy. We then have to populate the elements to the right of the diagonal only before filling to the left of the diagonal by symmetry. As the original input values (now at i odd) are uncorrelated, we have for all i, from Eq. (5),

u(yi,yi+1)=w3u2(yi+1)u(yi,yi+3)=w4u2(yi+3) (15)

For i even (interpolated values),

yi+2=w1yi1+w2yi+1+w3yi+3+w4yi+5yi+4=w1yi+1+w2yi+3+w3yi+5+w4yi+7yi+6=w1yi+3+w2yi+5+w3yi+7+w4yi+9, (16)

and from Eq. (5) we have

u(yi,yi+2)=w1w2u2(yi1)+w2w3u2(yi+1)+w3w4u2(yi+3)u(yi,yi+4)=w1w3u2(yi+1)+w2w4u2(yi+3)u(yi,yi+6)=w1w4u2(yi+3). (17)

For completeness, similar expressions were applied for the values formed by linear interpolation in the first and last intervals. Uncertainty calculated for the integral including all these correlations was then exactly that calculated with the original data for the 10 nm grid.

One further simplification can be made for uncorrelated input values. In practical terms, nearby values have the same uncertainty. Hence the sets of Eqs. (14) to (17) can be reduced to a matrix of correlation coefficients determined purely from the weights,

(..      191646316411641816401164 191640116400  1916463164116418164   1916401164    ..  ), (18)

where the first row corresponds to an interpolated value. Uncertainty for the integral using the interpolated data set is then found by modifying the sensitivity column vector to include the uncertainty at each value,

f=(fyiu(yi)), (19)

and then performing the matrix multiplication Eq. (2). A negligible change relative to the true values is due to averaging through regions where the response is changing rapidly; while the relative uncertainty in these regions is constant, the absolute value is not.

Table 1 shows uncertainties calculated for all the options discussed in this section. It can be seen that proper accounting for the correlations introduced by the interpolation reproduces the uncertainty calculated for the input values alone, and that using the correlation coefficients provides a practical calculation of the uncertainty matrix.

Table 1.

Integral value and relative uncertainty for various calculation options; four point Lagrange interpolation adding one value in each range. Input values uncorrelated, 1 % relative uncertainty.

Method Integral Relative uncertainty
Original data on 5 nm grid 10567.4 0.185
Original data on 10 nm grid 10568.2 0.262
Interpolated data; ignore correlations 10567.5 0.168
Interpolated data; with correlations 10567.5 0.262
Interpolated data; use correlation coefficients 10567.5 0.266

3.2 Photometer Measured at 5 nm Intervals, Interpolated to 1 nm

After re-arranging the N input values to their new positions, we add four values between input values yi and yi+5 that can be represented as

(yi+1yi+2yi+3yi+4)=1125(61082748845677568484271086)(yi5yiyi+5yi+10). (20)

Fig. 2 shows the relative uncertainty of the central data set where a photometer with a Vλ response is interpolated from 5 nm to 1 nm and the input values are assumed uncorrelated with a relative uncertainty of 1 %. Uncertainties of the interpolated values are lower than those of the input values. If we ignore the correlations introduced by the interpolation, the relative uncertainty of the integral with the D65 illuminant (interpolated to a 1 nm grid with a cubic-spine routine), reduces to 0.074 %, a value too low by the order of 5. The integral itself has the same value as that shown in Table 1 for the 5 nm grid.

Fig. 2.

Fig. 2

Relative uncertainties for the interpolated Vλ data set. Original values assumed uncorrelated, with a relative uncertainty of 1 %.

For a four point Lagrange interpolation adding four values between each of the input values, correlations in the output set extend over the 19 values following an input value. The matrix of correlation coefficients is shown as the transpose relative to Eq. (18) in the interests of printing; that is, it is equivalent to filling to the lower left of the diagonal of the correlation matrix prior to filling the upper right by symmetry. Beginning at a column corresponding to an input value, the matrix of correlation coefficients is

(..       1      108524891     84520612132248920611    56520611678248920611678206124891   2752489117624891678206124892132206124891  027524895652061845206110852489.. 275248931824898612061248914402061248920162489  56520611322489206153220619762061144024892061  84520617248920612452061532206186124892061  1085248967248972061248913224893182489  0452489752061852061652489  0114248921020612489264206124892522489  0104248920611962061256206126424892061  077248920611472061196206121024892061  04024897720612489104206124891442489  00000  0245248942520612489485206124893652489  0325248920615652061645206148524892061  0285248920614952061565206142524892061  0165248928520612489325206124892452489  00000 ). (21)

A number of these, for the values furthest from the input set, are negligible. The relative uncertainty of the integral for the interpolated data set calculated with these correlation coefficients is 0.197 %, equivalent in practical terms to that calculated using the original 5 nm data set and shown in Table 1.

4. Cubic-Spline Uncertainty Propagation

For our set of data Eq. (8), cubic-spline interpolation [7] calculates a value y at x in the interval xi to xi+1 as

y=Ayi+Byi+1+Cyi+Dyi+1, (22)

where

A=xi+1xxi+1xi, (23)
B=xxixi+1xi, (24)
C=16(A3A)(xi+1xi)2, (25)
D=16(B3B)(xi+1xi)2. (26)

The first two terms of Eq. (22) represent simple linear interpolation. Including the second derivatives y" yields a function that has first and second derivatives continuous at the boundaries between intervals.

The second-derivatives are unknown. The relation between them is given by

xixi16yi1+xi+1xi13yi+xi+1xi6yi+1=yi+1yixi+1xiyiyi1xixi1, (27)

which is a system of N−2 equations in the N unknowns yi. The natural cubic-spline, which is commonly used, sets

yi=yN=0 (28)

and solves for the remaining terms [7]. We are interested in using the cubic-spline interpolation on spectral data of known uncertainties, including the possibility of correlations, where the interpolated data may then be combined in various ways, so that not only the uncertainties in the interpolated data but also the correlations present are important in propagating uncertainties in the combinations.

The (N−2) values of yi depend on each of the input values, i.e., are correlated to each input value. Then even for uncorrelated input data, the output data are correlated over the whole set of interpolated values. We wish to calculate the covariance u (yn, ym) between two interpolated values

ym=Amyi+Bmyi+1+Cmyi+Dmyi+1yn=Anyj+Bnyj+1+Cnyj+Dnyj+1, (29)

where the yn and ym values may be in the same or different intervals denoted by i, j. The uncertainty in yn is given by

u2(yn)=u(yn,yn). (30)

The covariance between (and uncertainty of) the input values is known, carried in the matrix

Uy=[u(yi,yj)]. (31)

To propagate uncertainties through Eq. (29) we need the covariance between the second-derivative values and the input values, and between the second-derivatives themselves. These in turn require the sensitivity coefficients for the dependence of the second-derivative on the input values, yk/yi.

The set of N−2 equations Eq. (27) can be written in matrix form

(y3y2x3x2y2y1x2x1..yi+2yi+1xi+2xi+1yi+1yixi+1xi..yNyN1xNxN1yN1yN2xN1xN2)=(hi,j)(y2..yN1), (32)

where

hi,i1=xixi16hi,j=xi+2xi3hi,i+1=xi+2xi+16 (33)

is a tri-diagonal matrix with remaining terms zero. Multiplying both sides of Eq. (32) on the left by the inverse matrix (hi,j)1 yields the required second-derivatives. By selecting the ith row of this multiplication we have the relationship

yi+1=j=1N2hi,j1(yj+2yj+1xj+2xj+1yj+1yjxj+1xj), (34)

which when rearranged to

yi+1=j=3Nhi,j21yj+2xj+2xj+1j=2N1hi,j11(1xj+2xj+1)+(1xj+1xj)yj+j=1N2hi,j1yjxj+1xj (35)

yields

yi+1yj=hi,j21xjxj1hi,j11(1xj+1xj+1xjxj1)+hi,j1xj+1xj. (36)

These are augmented by

yk/yi=0,k=1,N. (37)

If the input yi values are uncorrelated, the required covariances are given by

u(yi,yj)=k=1Nyiykyjyku2(yk) (38)

and

u(yi,yj)=k=1Nyiykyjyku2(yk)=yiyku2(yk) (39)

Note that the N × N matrix represented by Eq. (39) is not symmetric. For correlated inputs, the sums required are the matrix products

u(yi,yj)=fiTUyfju(yi,yj)=fiTUygj, (40)

where

fi=(yiyk),k=1..N (41)

is a column-vector of sensitivity coefficients of the second-derivatives vs the input values and gj is a column vector of length N with 1 in the jth row, 0 elsewhere.

Covariances and uncertainties for the interpolated values are then found by recognizing that the values of ym and yn in Eq. (29) are represented by

ym=fm(yiyi+1yiyi+1yjyj+1yjyj+1)Tyn=fn(yiyi+1yiyi+1yjyj+1yjyj+1)T (42)

where

fm=(AiBiCiDi0000)fn=(0000AjBjCjDj) (43)

are sensitivity vectors for ym and yn against the eight variables in the vectors shown in Eq. (42). Covariances between the interpolated values are then given by

u(ym,yn)=fmTUfn, (44)

where

U=(u2(yi)u(yi+1,yi)u(yi,yi)u(yi+1,yi)u(yj,yi)u(yj+1,yi)u(yj,yi)u(yj+1,yi) u2(yi+1)u(yi,yi+1)u(yi+1,yi+1)u(yj,yi+1)u(yj+1,yi+1)u(yj,yi+1)u(yj+1,yi+1)  u2(yi)u(yi+1,yi)u(yj,yi)u(yj+1,yi)u(yj,yi)u(yj+1,yi)   u2(yi+1)u(yi,yi+1)u(yj+1,yi+1)u(yj,yi+1)u(yj+1,yi+1)    u2(yj)u(yj+1,yj)u(yj,yj)u(yj+1,yj)     u2(yj+1)u(yj,yj+1)u(yj+1,yj+1)      u2(yj)u(yj+1,yj)       u2(yj+1)) (45)

with the lower half symmetric about the diagonal. Only half of this matrix is required. The two right quadrants can be separately multiplied on the right by the column vector (Aj Bj Cj Dj)T and the two results combined into a single eight-element column vector for the final multiplication.

4.1 Cubic-Spline Interpolation Examples

Consider again the photometer response curve of Fig. 1, to be integrated over the wavelength range from 360 nm to 830 nm (effectively the photometric response to an equal-energy source). The function was interpolated over the same input range (one less value) but shifted by 2.5 nm and the integral recalculated. Similarly, the function was interpolated to 1 nm intervals and the integral recalculated. Table 2 shows the results for these interpolations, where the uncertainty in the integral was calculated based on 1 % uncertainty in the input values, uncorrelated between values. The consequence of ignoring the correlation between the interpolated values is also shown. Correlations between distant points, introduced through the dependence of the second-derivatives, were negligible (largely because the response curve is relatively smooth), but strong correlations were found between near-neighbours.

Table 2.

Integral of Vλ and its uncertainty for input values on a 5 nm grid and 1 % relative uncertainty, uncorrelated

Integral Uncertainty Uncertainty ignoring correlations
Original data 106.8561 0.19647
Shift 2.5 nm 106.8559 0.19647 0.1459
Interpolate to 1 nm 106.8559 0.19647 0.0746

Figure 3 shows propagated uncertainties for the interpolation shifting the input by 2.5 nm; for an interpolation to the mid-point, we would expect the interpolated value for a smooth function to be near the mean of the two interval boundaries with a propagated uncertainty 1/2=0.71 of the input (but of course correlated to adjacent values).

Fig. 3.

Fig. 3

Propagated uncertainty of Vλ for values shifted 2.5 nm; relative uncertainty of the input values is 1 %.

Figure 4 shows the variation in uncertainty for values interpolated at different positions within the 5 nm interval. This is a practical concern where a wavelength offset may be present in measurements, although in general it is a better practice to retain the wavelength values of the measured points and interpolate weighting functions such as the illuminant or the colorimetric response functions as these carry no uncertainty. At the input points, uncertainties equal that of the input; at the midpoints they fall to 12 of the input points. Again this is expected as the input data are smooth, and cubic-spline results are not much different from linear interpolation. The cubic-spline reproduces the input ordinate values for abscissa values equal to an input value; for these points, we expect the propagated uncertainty to be that of the input and correlations between similar such values to match that of the input matrix Uy. These conditions can be used to test the coding.

Fig. 4.

Fig. 4

Relative uncertainty of interpolated values for Vλ vs position in the interval. Input values with a relative uncertainty of 1 % are separated by 5 nm.

Figure 5 shows Vλ interpolated from a 20 nm grid to 2 nm. Where the input curve is changing rapidly relative to the magnitude of the data, linear interpolation would be discontinuous and for these regions, the relative uncertainty of the interpolated values rises above that of the 1 % assumed for the input values. This is shown more strongly in Fig. 6 for input data spaced at 40 nm, interpolated to 5 nm. Here the interpolation does not provide a good representation of Vλ (as shown in Fig. 7); where the interpolation is poor, the uncertainties for the interpolated values rise above those of the input.

Fig. 5.

Fig. 5

Relative uncertainty for interpolated from a 20 nm grid to 2 nm. Relative uncertainty of the input values set to 1 %.

Fig. 6.

Fig. 6

Relative uncertainty for Vλ interpolated from a 40 nm grid to 5 nm. Relative uncertainty of the input values set to 1 %.

Fig. 7.

Fig. 7

Ratio of interpolated from a 40 nm grid to the actual value on a 5 nm grid. The inset shows the central region on an expanded scale.

5. Conclusion

Interpolation of spectral data is a common occurrence in radiometric and photometric measurements. Those data are often then combined in forming integral values such as photometric or colorimetric responses or filter radiometer responses. Interpolation is particularly important when a relatively smooth curve available only on a wide spectral spacing may need to be convolved with a more-rapidly changing curve and then integrated. Uncertainties in the interpolated values will generally be smaller than those of the input data, although this is not always true in the case of cubic-spline interpolation. Uncertainties in combinations calculated using the interpolated data set then must include correlations introduced by the interpolation. Ignoring the correlation will lead to significant underestimation of uncertainties. The calculations in this paper for both Lagrange interpolation and for cubic-spline interpolation show that the uncertainty can be reliably estimated, in practical terms, by propagating the uncertainty through the combination using only the original set of data.

Biography

About the author: James L. Gardner is a research fellow with the CSIRO National Measurement Laboratory, Sydney, Australia and was a Guest Researcher at NIST in the Optical Technology Division of the NIST Physics Laboratory. The National Institute of Standards and Technology is an agency of the Technology Administration, U.S. Department of Commerce.

6. References

  • 1.ASTM E 308–9, Standard practice for computing the colors of objects by using the CIE system. American Society for Testing and Materials; PA: 2000. [Google Scholar]
  • 2.Gardner JL. Correlations in primary spectral standards. Metrologia; to be published (NEWRAD 2001 proceedings) [Google Scholar]
  • 3.CIE 15.2, Colorimetry. International Commission on Illumination; Vienna: 1986. [Google Scholar]
  • 4.Guide to the expression of uncertainty of uncertainty in measurement. International Organization for Standardization; Geneva: 1993. [Google Scholar]
  • 5.Numerical Recipes in C: the art of scientific computing. Cambridge Press; 1992. p. 108. [Google Scholar]
  • 6.Savitsky A, Golay MJE. Smoothing and differentiation of data by simplified least squares procedures. Anal Chem. 1964;36:1627–1639. [Google Scholar]
  • 7.Numerical Recipes in C: the art of scientific computing. Cambridge Press; 1992. p. 113. [Google Scholar]

Articles from Journal of Research of the National Institute of Standards and Technology are provided here courtesy of National Institute of Standards and Technology

RESOURCES