# Linear Interpolation/Extrapolation

I have the following grid of data. The first row represents a value called $m$ that ranges between 0.8 and 1.2, and the first column represents days that can be anywhere between 0 and $\infty$ (but usually no more than 1080).

\begin{matrix} &0.8 &0.9 &0.95 &0.975 &1 &1.025 &1.05 &1.1 &1.2 \\\hline 30 &36.499 &33.035 &30.583 &29.22 &27.753 &26.214 &24.699 &22.244 &21.376 \\ 60 &36.347 &32.382 &29.923 &28.594 &27.238 &25.899 &24.612 &22.271 &19.141 \\ 90 &35.446 &31.059 &28.836 &27.712 &26.591 &25.492 &24.428 &22.405 &18.886 \\ 180 &29.444 &29.143 &27.566 &26.692 &25.823 &24.961 &24.107 &22.614 &22.5 \\ 260 &29.999 &27.402 &26.083 &25.448 &24.823 &24.208 &23.608 &22.424 &20.231 \\ 540 &28.775 &26.552 &25.42 &24.878 &24.351 &23.84 &23.346 &22.405 &20.865 \\ 720 &27.868 &26.283 &25.273 &24.79 &24.319 &23.861 &23.414 &22.561 &21.295 \end{matrix}

I have $7 \times 9 = 63$ data points, that creates some sort of 3D surface. what I want to do is somehow interpolate across the rows, but be able to extrapolate the columns so that I could consider a value for $(0.99, 12)$ which I imagine would be about $28.1$ or for $(1.08, 900)$ which I reckon gives $23.2$.

I am not entirely certain how to perform this kind of procedure in either R or Matlab and hope someone can help explain this to me.

• Are these truly 'data' (based on observations randomly selected from a population)? Or were they computed by a mathematical algorithm? – BruceET Mar 15 '17 at 16:36
• @BruceET I believe the latter, which I am trying to reproduce. However, I imagine that the algorithm was far more complex than the simple linear relationship that I am looking for. – User101 Mar 15 '17 at 16:50

Speculations on possible methods.

The last two columns seem to involve a hint of randomness (or computational instability).

Some printed tables of probability distributions are amenable to various kinds of simple interpolation (linear for normal, harmonic for F, none at all between degrees of freedom for chi-squared). ('Harmonic' means to do linear interpolation on reciprocals and take the reciprocal of the result.) You might try leaving out a row or column and see how well various kinds of interpolation can be used to reconstruct it.

You might start with simple linear regressions on a few individual rows and (separately) on a few columns. At least, that would give a clue as to linearity.

By whatever scheme, extrapolation (say to 1080) will be almost entirely speculative, and hence risky.

Addendum: Crude start. Here is one of your rows plotted against the top header (using R). This one doesn't look alarmingly nonlinear.

x = c(.8,.9,.95,.975,1,1.025,1.05, 1.1, 1.2)
y.90 = c(35.446,31.059,28.836,27.712,26.591,25.492,24.428,22.405,18.886)
plot(x,y.90,pch=20)