Non Linear Least Square fitting for large data
Mostra commenti meno recenti
Dear all,
I would like to do least square fitting for a data I get from an antenna. The data looks like this Data plot. I tried using this function in Matlab to fit the data and I used a polynomial of 7 degree, but the fitting wasn't appropriate. People suggested that using a polynomial of a higher degree than 7 is not a good idea.
function leastCurvePolynomialFit(x,y, n)
p = polyfit(x, y, n)
poly_line = polyval(p, x);
%Plot data and estimated polynomial
figure
hold all
plot(x,y,'+')
plot(x,poly_line)
xlabel('X')
ylabel('Y')
title('Noisy Data and Fitted Line')
box
end

If anyone can help me solve this problem without toolbox I will really appreciate it because I don't have any extra toolbox from Matlab and I would like to convert the code to C++ eventually.
Many thanks
1 Commento
Star Strider
il 7 Gen 2015
Do you have a mathematical model of the radiation pattern of your antenna? If so, use the nlinfit and nlpredci (Statistics Toolbox) functions to fit your data to it and estimate the prediction errors. Use the prediction errors to eliminate outliers.
Risposte (1)
Categorie
Scopri di più su Linear Predictive Coding in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!