# Chapter 17: Wavelet estimators

## Figure 1

# frame 1
plot(x="",y="",xlim=c(0,1),ylim=c(0,1),xlab="",ylab="",yaxt="n",xaxt="n")
x0<-1/2
y0<--1
x1<-1/2
y1<-2
segments(x0,y0,x1,y1)
text(0.25,0.5,"-1")
text(0.75,0.5,"1")

# frame 2
plot(x="",y="",xlim=c(0,1),ylim=c(0,1),xlab="",ylab="",yaxt="n",xaxt="n")
x0<--1
y0<-1/2
x1<-2
y1<-1/2
segments(x0,y0,x1,y1)
text(0.5,0.25,"-1")
text(0.5,0.75,"1")

# frame 3
plot(x="",y="",xlim=c(0,1),ylim=c(0,1),xlab="",ylab="",yaxt="n",xaxt="n")
x0<-1/2
y0<--1
x1<-1/2
y1<-2
segments(x0,y0,x1,y1)
x0<--1
y0<-1/2
x1<-2
y1<-1/2
segments(x0,y0,x1,y1)
text(0.25,0.75,"-1")
text(0.75,0.75,"1")
text(0.75,0.25,"-1")
text(0.25,0.25,"1")

# frame 4
plot(x="",y="",xlim=c(0,1),ylim=c(0,1),xlab="",ylab="",yaxt="n",xaxt="n")
x0<-1/2
y0<--1
x1<-1/2
y1<-1/2
segments(x0,y0,x1,y1)
x0<--1
y0<-1/2
x1<-1/2
y1<-1/2
segments(x0,y0,x1,y1)
x0<-1/4
y0<--1
x1<-1/4
y1<-1/2
segments(x0,y0,x1,y1)
x<-c(-1,-1,2,2)
y<-c(1/2,2,2,1/2)
polygon(x,y,border=NA,col="gray")
x<-c(1/2,1/2,2,2)
y<-c(-1,1/2,1/2,-1)
polygon(x,y,border=NA,col="gray")
text(0.125,0.25,"-2")
text(0.375,0.25,"2")

# frame 5
plot(x="",y="",xlim=c(0,1),ylim=c(0,1),xlab="",ylab="",yaxt="n",xaxt="n")
x0<-1/2
y0<--1
x1<-1/2
y1<-1/2
segments(x0,y0,x1,y1)
x0<--1
y0<-1/2
x1<-1/2
y1<-1/2
segments(x0,y0,x1,y1)
x0<--1
y0<-1/4
x1<-1/2
y1<-1/4
segments(x0,y0,x1,y1)
x<-c(-1,-1,2,2)
y<-c(1/2,2,2,1/2)
polygon(x,y,border=NA,col="gray")
x<-c(1/2,1/2,2,2)
y<-c(-1,1/2,1/2,-1)
polygon(x,y,border=NA,col="gray")
text(0.25,0.125,"-2")
text(0.25,0.375,"2")

# frame 6
plot(x="",y="",xlim=c(0,1),ylim=c(0,1),xlab="",ylab="",yaxt="n",xaxt="n")
x0<-1/2
y0<--1
x1<-1/2
y1<-1/2
segments(x0,y0,x1,y1)
x0<--1
y0<-1/2
x1<-1/2
y1<-1/2
segments(x0,y0,x1,y1)
x0<--1
y0<-1/4
x1<-1/2
y1<-1/4
segments(x0,y0,x1,y1)
x0<-1/4
y0<--1
x1<-1/4
y1<-1/2
segments(x0,y0,x1,y1)
x<-c(-1,-1,2,2)
y<-c(1/2,2,2,1/2)
polygon(x,y,border=NA,col="gray")
x<-c(1/2,1/2,2,2)
y<-c(-1,1/2,1/2,-1)
polygon(x,y,border=NA,col="gray")
text(0.125,0.375,"-2")
text(0.375,0.375,"2")
text(0.375,0.125,"-2")
text(0.125,0.125,"2")

## Figure 2

# frame 1
plot(x="",y="",xlim=c(0,1),ylim=c(0,1),xlab="",ylab="",yaxt="n",xaxt="n")
x0<-1/2
y0<-1/2
x1<-1/2
y1<--1
segments(x0,y0,x1,y1)
x0<--1
y0<-1/2
x1<-2
y1<-1/2
segments(x0,y0,x1,y1)
x<-c(-1,-1,2,2)
y<-c(1/2,2,2,1/2)
polygon(x,y,border=NA,col="gray")
text(0.25,0.25,expression(-sqrt(2)))
text(0.75,0.25,expression(sqrt(2)))

# frame 2
plot(x="",y="",xlim=c(0,1),ylim=c(0,1),xlab="",ylab="",yaxt="n",xaxt="n")
x0<--1
y0<-1/4
x1<-2
y1<-1/4
segments(x0,y0,x1,y1)
x0<--1
y0<-1/2
x1<-2
y1<-1/2
segments(x0,y0,x1,y1)
x<-c(-1,-1,2,2)
y<-c(1/2,2,2,1/2)
polygon(x,y,border=NA,col="gray")
text(0.5,0.375,expression(sqrt(2)))
text(0.5,0.125,expression(-sqrt(2)))

# frame 3
plot(x="",y="",xlim=c(0,1),ylim=c(0,1),xlab="",ylab="",yaxt="n",xaxt="n")
x0<-1/2
y0<-1/2
x1<-1/2
y1<--1
segments(x0,y0,x1,y1)
x0<--1
y0<-1/4
x1<-2
y1<-1/4
segments(x0,y0,x1,y1)
x0<--1
y0<-1/2
x1<-2
y1<-1/2
segments(x0,y0,x1,y1)
x<-c(-1,-1,2,2)
y<-c(1/2,2,2,1/2)
polygon(x,y,border=NA,col="gray")
text(0.25,0.375,expression(-sqrt(2)))
text(0.75,0.375,expression(sqrt(2)))
text(0.75,0.125,expression(-sqrt(2)))
text(0.25,0.125,expression(sqrt(2)))