How can I fit data using quartic smoothing splines?

조회 수: 7 (최근 30일)
Thomas Erdosi
Thomas Erdosi 2012년 7월 25일
편집: Isabella Osetinsky-Tzidaki 2016년 12월 26일
Dear Community,
I am looking for something exactly like the existing function SPAPS, but for quartic splines. For some reason the only built-in options appear to be quadratic, cubic, and quintic. I have tried solutions with the FIT function but I am not getting anywhere. Please note it is important that I can set knots, specify the smoothing parameter p and retract the values of the resulting function.
Thank you very much for your help!
Thomas
  댓글 수: 3
John D'Errico
John D'Errico 2012년 7월 28일
So use quintic. WTP?
Thomas Erdosi
Thomas Erdosi 2012년 7월 28일
I need to exactly replicate the results of a paper that uses quartic

댓글을 달려면 로그인하십시오.

답변 (2개)

Isabella Osetinsky-Tzidaki
Isabella Osetinsky-Tzidaki 2016년 12월 26일
편집: Isabella Osetinsky-Tzidaki 2016년 12월 26일
Quoted from https://www.mathworks.com/help/curvefit/examples/how-to-construct-splines.html
k = 5; % order 5, i.e., we are working with quartic splines
x = 2*pi*sort([0 1 rand(1,10)]);
y = cos(x);
sp = spapi( optknt(x,k), x, y );

Azzi Abdelmalek
Azzi Abdelmalek 2012년 7월 28일
%let us take this example:
method='smoothingspline'
t=[0:10];y=sin(t); %your signal
yfit=fit(t',y',method) %interpolation function yfit
%now choose your new time vector with 0.1 sample time
ti=0:0.1:10;yi=yfit(ti)
plot(t,y,'r') %your original signal
hold on, plot(ti,yi,'+b'); %your new signal
  댓글 수: 2
Thomas Erdosi
Thomas Erdosi 2012년 7월 28일
Thank you for your answer. I have tried the same before using the fit function with specifying 'smoothingspline' as method but unfortunately this is more of a general smoothing solution and not the exact quartic smoothing spline I need. I have tried a few thing with fitoptions as well but without success. Does anybody know how to do this for the quartic smoothing spline? Thanks again
Thomas Erdosi
Thomas Erdosi 2012년 7월 30일
Isn't there anyone who can help..? This must be possible to do in MATLAB.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Splines에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by