Optimal Data Selection for a curve function

조회 수: 1 (최근 30일)
Manoj kumar Gokula krishnan
Manoj kumar Gokula krishnan 2019년 9월 17일
답변: Yogesh Khurana 2019년 12월 18일
Hi
I am a newbie in the area of curve fitting and interpolation. Th eproblem I am currently facing is I am having a high resolution curve with large number of data points but since i have memory constraint should reduce these data points to 32 nodes with out much change in actual curve characteristics. Later this would be used towards linear interpolation to find the y values in between these 32 nodes.
Since the function is a curve, the way to go would be choosing optimal knots/nodes and its respective location. I have tried some snippets related to optimal knots but doesnt seem to work out for required 32 Nodes. Can someone help me on this regard to take it forward
fs = 5:1:320;
knots = 1:10:fs(end);
tau = fs(knots);
y_temp = yf(:,2); %These are y values related to high resolution curve
y = y_temp(knots);
k = 4;
osp = spapi( optknt(tau,k), tau,y);
figure; hold on; plot(fs,yf(:,2)); plot(tau,y,'ro');
fnplt(osp,'r');
The above variable osp should have given optimal distribution of nodes but this was not working in my case

답변 (1개)

Yogesh Khurana
Yogesh Khurana 2019년 12월 18일
optknt provides optimal Knot distribution for interpolation. The arguments accepted by this function are tau, k and maxiter. You have used tau and k in your code. The third parameter maxiter also plays a role in defining the optimal distribution for nodes. For some non-uniform knot sequences the function call say, opt(t, 3), will fail in providing optimal distribution while defining opt(t, 3, 20), using a high value for the optimal parameter maxiter, will succeed.
I am attaching some reference links that contains some information regarding the optimal parameter and contains some references at the end of the page that shows some papers used for developing the same logic. Please refer to the references provided at the end of these pages. Please refer to following links for more information:
Hope this helps!

카테고리

Help CenterFile Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by