Borrar filtros
Borrar filtros

How to find and plot the absolut average error of a fittet curve to a Set of Data

1 visualización (últimos 30 días)
In a for Loop I have my Data:
x_relevant{i} = x{i}(idx_min{i}:idx_max{i})
y_relevant{i} = y{i}(idx_min{i}:idx_max{i})
plot(x_relevant{i},y_relevant{i},'color',c2{i},'Marker','.','linestyle','none')
hold on
And a fittet linear Regression:
p{i} = polyfit(x_relevant{i}, y_relevant{i},1)
fit = polyval(p{i},x_relevant{i})
plot(x_relevant{i},fit,'color',c{i},'LineWidth',2)
hold on
How do I find the Standard error of this fitted curve?

Respuestas (1)

Ameer Hamza
Ameer Hamza el 28 de Nov. de 2020
You can add the absolute error between actual datapoints and fitted curve like this
p{i} = polyfit(x_relevant{i}, y_relevant{i},1)
fit = polyval(p{i},x_relevant{i})
plot(x_relevant{i},fit,'color',c{i},'LineWidth',2)
hold on
plot(x_relevant{i},abs(fit-y_relevant{i}),'color',c{i},'LineWidth',2)

Categorías

Más información sobre Get Started with Curve Fitting Toolbox en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by