フィルターのクリア

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

1 回表示 (過去 30 日間)
Patrick Petre
Patrick Petre 2020 年 11 月 28 日
回答済み: Ameer Hamza 2020 年 11 月 28 日
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?

回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 11 月 28 日
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)

カテゴリ

Help Center および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by