On the group meeting of Oct 3, 2018, Jiaqi shows his bar. I asked that why his variance is very small. He said that he uses the standard error (https://en.wikipedia.org/wiki/Standard_error), which is standard derivation divided by the square root of the number of trials. According to the notes of my undergraduate course probability:
(1) D(ax+b) = a*a*D(x),
(2) the second line of "中心极限定理". x bar is seen as a random variable,
we have std(x bar) = std(x)/sqrt(n).
I ask Jiaqi which tool he uses to draw his figure. He says he uses python, bar of matplotlib. https://matplotlib.org/api/_as_gen/matplotlib.pyplot.bar.html. The mean of the errors and standard error should be computed first and then be used as the input of xerr and yerr.
I check my TNNLS 2017 paper and I find that I show the std. Maybe next time I can show the standard error.
这个函数的意思是:
ERRORBAR(X,Y,L,U),X是自变量,Y是因变量,L是Y的变动下限,U是Y的变动上限
errorbar(X,Y,E) X是自变量,Y是因变量,E是Y的变动绝对差值。
我自己写的例子:
X=[1 2 3];
Y= [ 0.2 0.4 0.2];
L=[0.1 0.03 0.03];U=[0.1 0.3 0.2];
E= [0.1 0.3 0.2];
figure;
hold on;%一定要有这一句,否则有问题
bar(X,Y);
errorbar(X,Y,E,'Marker','none','LineStyle','none');
figure;
hold on;%一定要有这一句,否则有问题
errorbar(X,Y,E);%以下注释的两句用这一句就可以了
%plot(X,Y);
%errorbar(X,Y,E,'Marker','none','LineStyle','none');
figure;
hold on;%一定要有这一句,否则有问题
bar(X,Y);
errorbar(X,Y,L,U);%,'Marker','none','LineStyle','none'不能省
说明:必须使用hold on,bar是画柱状图, errorbar是花竖线--------------------------------------------------------------------以下可不看----------------------------------------------------------------------------
example1:
x = 1:10;
y = sin(x);
e = std(y)*ones(size(x));
errorbar(x,y,e)
example2: % 生成示例数据x=1:10;y=cumsum(randn(1,10));lower = y - (rand(1,10));upper = y + (rand(1,10));% 由于errorbar函数使用相对差值在图形上绘图,所以% 需要将绝对差值转变为相对差值。L = y - lower;U = upper -y;% 绘图时需要设定 hold on% 柱状图clf;figure(1);hold on;bar(x,y);% 此处需要隐藏折线errorbar(x,y,L,U,'Marker','none','LineStyle','none');% 折线图figure(2);hold('on');plot( x, y);errorbar( x, y, L, U); Reference:
http://blog.sina.com.cn/s/blog_61010ebe0100l9c9.html http://bio-spring.info/wp/?p=85