How do I Plot error on a graph

Hi,
I want to plot an error on the below graph, a high error and a low error.
Note from the graph the least squares line, and the deviaiton aboce and below this line increasing along with the x-axis.
I have tried using errorbar(x,y,err) but i do not know how to calculate 'err' variable that is moving.
Any help would be greatly appreciated.

3 件のコメント

Hank
Hank 2020 年 3 月 3 日
Moving error, is an interesting concept. Its somewhat up to you and your dataset how you want to define it.
For example, you could say that at a particular point, the local error is the standard deviation of values within some window.
Poongavanam Palani
Poongavanam Palani 2022 年 8 月 1 日
Have you tried Andrewsplot or boundedline package available in MATLAB repository. I am guessing it is the standard deviation that you are referring to here.
Link: http://www.mathworks.com/matlabcentral/fileexchange/27485-boundedline-m
Adam Danz
Adam Danz 2022 年 8 月 1 日
編集済み: Adam Danz 2022 年 8 月 1 日
"Error" does not have a single definition. There are lots of ways to define error. Standard deviations, confidence intervals, quartiles, etc. You could show error along the x axis or y axis or variation of the fitted slope using cross validation etc. And the choice isn't arbitrary. The choice should be made based on the story you're telling with the data and the properties of your data. After you decide on what "error" means in your data, computing the error is relatively straight forward and plotting it is even easier, and you can get help with that here.

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeErrorbars についてさらに検索

質問済み:

2020 年 3 月 2 日

編集済み:

2022 年 8 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by