Optimal Data Selection for a curve function

1 Ansicht (letzte 30 Tage)
Manoj kumar Gokula krishnan
Manoj kumar Gokula krishnan am 17 Sep. 2019
Beantwortet: Yogesh Khurana am 18 Dez. 2019
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

Antworten (1)

Yogesh Khurana
Yogesh Khurana am 18 Dez. 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!

Kategorien

Mehr zu Get Started with Optimization Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by