How to plot and calculate 95% confidence interval

조회 수: 182 (최근 30일)
Sara
Sara 2018년 11월 30일
편집: Baldvin 2025년 11월 14일 17:04
Hello,
I have two vectors of the actual values and predicted values and I want to calculate and plot 95% confidenence interval just like the image I have attached. Colud you please help me?
thanks a lot.

채택된 답변

Rishabh Gupta
Rishabh Gupta 2018년 12월 10일
Hi Sara,
To calculate the 95% confidence intervals of your signal, you first will need to calculate the mean and *|std| (standard deviation) of your experiments at each value of your independent variable. The standard way to do this is to calculate the standard error of the mean at each value of your independent variable, multiply it by the calculated 95% values of the t-distribution (here), then add and subtract those values from the mean.
Please refer to following MATLAB Answer for more details:
I hope this helps.
  댓글 수: 2
Sara
Sara 2018년 12월 10일
Dear Rishabh,
Thanks for your help.
Baldvin
Baldvin 2025년 11월 14일 16:58
편집: Baldvin 2025년 11월 14일 17:04
Here is a MATLAB Answer specifically about plotting the bounds as a shaded area, in case anyone wants some ideas for the plotting task:
which builds on this answer here:

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by