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 Exchange에서 Errorbars에 대해 자세히 알아보기

질문:

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