How spline extrapolate?

7 ビュー (過去 30 日間)
omid mousavi
omid mousavi 2016 年 6 月 23 日
編集済み: John D'Errico 2016 年 6 月 24 日
Hi all, I appreciate it if anyone inform me of this question:
I want to use spline command as p=spline(x,y) and then use the coefficients that are stored in the p, which is a structure object, to evaluate a function at nodes that are not in x, say xx=[0.5*x(1):0.1:2*x(end)].
I know that for the points below x(1), the evaluation takes the first break point in the p, like
a_0+a_1*(x-x(1))+a_2*(x-x(1))^2 + a_3*(x-x(1))^3
However, I am not sure how it is done for points beyond the last break point that is stored in p. I appreciate any help

回答 (1 件)

Torsten
Torsten 2016 年 6 月 23 日
It does not make any sense at all to evaluate splines below x(1) or above x(end).
Best wishes
Torsten.
  2 件のコメント
omid mousavi
omid mousavi 2016 年 6 月 24 日
Well it does, you can do that your self and verify that. The question is that how it is done?
John D'Errico
John D'Errico 2016 年 6 月 24 日
編集済み: John D'Errico 2016 年 6 月 24 日
Torsten is entirely correct. You will get a prediction of no value beyond those points. For example, in my own spline tools, I tend to use only constant extrapolation, unless the user explicitly forces the tool to do more. I do this because of the danger of extrapolation.
Can you extrapolate a spline created by spline? Yes. It will do so. In fact, a tool like ppval simply evaluates that same cubic polynomial. But doing so outside of the support of the simple will yield a result of little value. This is simply a bad idea in general.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSplines についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by