Optimal Data Selection for a curve function

2 views (last 30 days)
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

Answers (1)

Yogesh Khurana
Yogesh Khurana on 18 Dec 2019
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!

Categories

Find more on Get Started with Optimization Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!