0

Is it possible to extrapolate some values with the cubic spline method? From the R function pchip documentation: "pchip can be applied to points outside [min(xi), max(xi)], but the result does not make much sense outside this interval."

Hence, isn't the cubic spline meant for extrapolation? Is there a way to extrapolate without the linear extrapolation?

Nick Cox
  • 48,377
  • 8
  • 110
  • 156
userLx
  • 1
  • 5
    Splines are intended for interpolation. Any extrapolation method on top of any interpolation method is an extra at the user's discretion and risk. However, watch out: there are various flavours of cubic spline and pchip is just one. – Nick Cox Oct 17 '21 at 21:28
  • Indeed I was asking out to derive an extrapolation method on top a cubic spline ? – userLx Oct 17 '21 at 22:41
  • By appropriate placement of boundary/outside knots, we can force linear extrapolation. (I don't remember how.) Higher order extrapolation just goes anywhere. – Josef Oct 17 '21 at 23:01
  • Does the following answer your Q? https://stats.stackexchange.com/questions/189524/can-splines-be-used-for-prediction, https://stats.stackexchange.com/questions/465275/extrapolating-from-a-smooth-monotonic-curve-in-r – kjetil b halvorsen Oct 18 '21 at 00:32
  • @kjetilbhalvorsen not really, but thanks – userLx Oct 18 '21 at 07:57
  • @Josef so it could make sense to interpolate with cubic spline and extrapolate an outside point linearly ? If I understand correctly, linear extrapolation is the only method to extrapolate ? – userLx Oct 18 '21 at 07:57
  • Sorry forgot to mention an important constraint for the extrapolation: monotonicity. – userLx Oct 18 '21 at 08:03
  • You can extrapolate any way you like. There are at least three questions that arise. Is it a good idea? What method to use? How to code it? The last is off-topic here. In my view the general virtue of cubic splines is offering a flexible method for smoothing and/or interpolation that respects the data and rests on stated principles. But by being agnostic about any kind of overall pattern of behaviour they are also not especially suitable for extrapolation. But extrapolation is almost always difficult unless you know some overall rule or law. Then too. – Nick Cox Oct 18 '21 at 08:10
  • It's like long term forecasting in time series. Information on local behavior does not help much in longer term forecasting. All we can do, is assume a simple extrapolating behavior. If there is a trend with some nonlinear curvature, then assuming a linear continuation might be reasonable. (Or, like in a stationary AR, the best long run prediction might be the mean, or constant at the last observation in a random walk..) – Josef Oct 18 '21 at 14:19

0 Answers0