n=100
alpha=0.05
eps=sqrt(1/(2*n)*log(2/alpha))
x<-rnorm(n)
Fn<-ecdf(x)
t<-seq(min(x),max(x),b=0.01)
Ft<-pnorm(t)
L<-pmax(Fn(t)-eps,0)
U<-pmin(Fn(t)+eps,1)
plot(Fn)
points(t,U,type="s",col=3)
points(t,L,type="s",col=3)
lines(Ft~t,t="l",col=4)

#conF
quantil<-qnorm(1-alpha/2)
desv<-sqrt(pnorm(t)*(1-pnorm(t))/n)
L2<-pmax(Fn(t)-quantil*desv,0)
U2<-pmin(Fn(t)+quantil*desv,1)
plot(Fn)
points(t,U2,type="s",col=3)
points(t,L2,type="s",col=3)
lines(Ft~t,t="l",col=4)


#con  Fn
quantil<-qnorm(1-alpha/2)
desv<-sqrt(Fn(t)*(1-Fn(t))/n)
L3<-pmax(Fn(t)-quantil*desv,0)
U3<-pmin(Fn(t)+quantil*desv,1)
plot(Fn)
points(t,U3,type="s",col=3)
points(t,L3,type="s",col=3)
lines(Ft~t,t="l",col=4)


