MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Extrapolation in mathematica

  • To: mathgroup at
  • Subject: [mg51549] Re: Extrapolation in mathematica
  • From: DrBob <drbob at>
  • Date: Thu, 21 Oct 2004 22:21:42 -0400 (EDT)
  • Reply-to: drbob at
  • Sender: owner-wri-mathgroup at

Just turn off the error message. For instance:

data = Table[x + 5Random[], {x, 1, 20}];
f = Interpolation[data];
Plot[f@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}]


From: brindaban at (nilaakash)
To: mathgroup at
Subject: [mg51549] Extrapolation in mathematica
Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc.

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



  • Prev by Date: Re: Formatting numbers for output
  • Next by Date: Re: conditionnal rule
  • Previous by thread: Re: Extrapolation in mathematica
  • Next by thread: Re: Extrapolation in mathematica