# Extrapolation of 1600 points dataset

7 views (last 30 days)
Waleed El-Badry on 25 Jun 2011
Hi, I tried to use interp1 function to extrapolate a dataset consists of 1600 points (read from Excel sheet). The variable extracted the data and can plot it easily. However, the resulted plot of interpolated and extrapolated data is linear!!!!
Here is the code I used for testing:
xi=1:1:1700;
z=interp1(x,data,xi,'spline','extrap');
plot(x,data,'or',xi,z);
All help is appreciated. Link to Excel file: http://www.mediafire.com/?8z3riofux9tz4z0

the cyclist on 25 Jun 2011
Neither the interpolation nor the extrapolation are linear, although I can see why you might think they are, given what you've plotted.
In the interpolated region, because you've chosen the interval of xi to be the same as x, all you are getting is the (perfect) match with your known points, and the lines are just connecting the dots, so you see line segments. If you were to choose the interval to be, say, 0.1 instead, then you would see the nonlinearity of the spline.
In the extrapolated region, you can see the nonlinearity if you zoom into the area just after the known points. It rockets north very rapidly, and looks linear after that.
Here is some code, slightly edited from yours, that illustrates these thoughts:
x=[1:1:1600];
xi=1:0.2:1603;
z=interp1(x,data,xi,'spline','extrap');
figure
plot(x,data,'or',xi,z);
set(gca,'XLim',[1595 1605])
I'm not sure what you were expecting, but simple extrapolation is not going to replicate the pattern in the known region. If that was what you wanted, you're going to need some kind of simulation, maybe based on the mean growth and variance of the known data.
##### 2 CommentsShowHide 1 older comment
the cyclist on 26 Jun 2011
ARMA is certainly commonly used. I don't know much about NN for this sort of thing.
Also, it would be good for you to "accept" my answer since you found it helpful, so that others seeking similar solutions will find it more easily.