Discussion:
Extrapolation in mathematica
(too old to reply)
nilaakash
2004-10-20 05:38:01 UTC
Permalink
Dear
Anybody could you tell me how to extrapolate data in
mathematica. I can interpolate my data, but extrapolation is not
working.

Thanks.

nilaakash
Jens-Peer Kuska
2004-10-22 02:29:26 UTC
Permalink
Hi,

can you tell us how do you wish to extrapolate the data ?
If you have no idea what kind of extrapolation you need Interpolating[]
function
does already a linear extrapolation (with a warning message), if you request
a function value outside of the data range.

Regards
Jens
Post by nilaakash
Dear
Anybody could you tell me how to extrapolate data in
mathematica. I can interpolate my data, but extrapolation is not
working.
Thanks.
nilaakash
Tomas Garza
2004-10-22 02:44:41 UTC
Permalink
The idea of interpolation is to use the behavior of a set of discrete points
to "guess" what could be happening in the intervals inside that set. This
uses the information given by the points within the range they encompass.
Extrapolation is in fact meaningless unless you assume that outside the
range of the given set the behavior of additional points will be the same as
within the range. Try for example


In[1]:=
g = Interpolation[{2, 4, 6, 10}]
Out[1]=
InterpolatingFunction[{{1, 4}}, <>]

This gives you a "guess" within the range {1, 4}. Then try to evaluate for
example g[11]. You get a warning message that 11 lies outside the range and
will give you then an "extrapolated" guess. T'is up to you to buy it or not.

Tomas Garza

Mexico City

----- Original Message -----
From: "nilaakash" <***@gmail.com>
Subject: Extrapolation in mathematica
Post by nilaakash
Dear
Anybody could you tell me how to extrapolate data in
mathematica. I can interpolate my data, but extrapolation is not
working.
Thanks.
nilaakash
Bill Rowe
2004-10-22 02:55:50 UTC
Permalink
Post by nilaakash
Anybody could you tell me how to extrapolate data in
mathematica. I can interpolate my data, but extrapolation is not
working.
There is no specific function to extrapolate data in Mathematica because there is no general procedure for extrapolation. The best you can do is fit some specified function to your data then compute the value of that function at the value of interest.

For example consider

{#1, 4*#1 + 10 + Random[]}&/@ Range[10]
Fit[%, {1, x}, x]
% /. x -> 100

Here the first line generates some random points about the line 4x+10,the second finds the best fit line to the data generated and finally a result is computed for x = 100. But note the validity of this method hinges on knowing the underlying function. If the underlying function isn't known and there is no basis for choosing a specific function to fit to the data, there is no basis for any extrapolation.

There are non-parametric regression methods as well which by definition do not require knowledge of a specific function. Instead, these methods make assumptions about smoothness of the function. But these are not generally good candidates for extrapolation.
--
To reply via email subtract one hundred and four
DrBob
2004-10-22 02:59:54 UTC
Permalink
Just turn off the error message. For instance:

data = Table[x + 5Random[], {x, 1, 20}];
f = Interpolation[data];
Off[InterpolatingFunction::"dmval"]
Plot[***@x, {x, 0, 21}];

Extrapolations are usually meaningless, however--as a few trials of the code will clearly demonstrate.

For instance, the following fit is lousy outside the data range:

g = 2 - x + x^2 + x^3 + x^4;
data = Table[g, {x, 1, 20}];
f = Interpolation[data, InterpolationOrder -> 3];
Plot[{g, f[x]}, {x, -5, 0}]

But changing InterpolationOrder makes it perfect:

f = Interpolation[data, InterpolationOrder -> 4];
Plot[{g, f[x]}, {x, -5, 0}]

Bobby

From: ***@gmail.com (nilaakash)
Subject: Extrapolation in mathematica
Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Approved: Steven M. Christensen <***@smc.vnet.net>, Moderator


Dear
Anybody could you tell me how to extrapolate data in
mathematica. I can interpolate my data, but extrapolation is not
working.

Thanks.

nilaakash

Continue reading on narkive:
Loading...