if (FALSE) {
n<-201
tt01<-seq(0,1,len=n)
rtt01<-c(0,1)
x1<-dbeta(tt01,20,5)
x2<-dbeta(tt01,21,5)
y1<-dbeta(tt01,5,20)
y2<-dbeta(tt01,5,21)
xy<-fdata(rbind(x1,x2,y1,y2),tt01,rtt01)
plot(xy)
round(metric.kl(xy,xy,eps=1e-5),6)
round(metric.kl(xy,eps=1e-5),6)
round(metric.kl(xy,eps=1e-6),6)
round(metric.kl(xy,xy,symm=FALSE,eps=1e-5),6)
round(metric.kl(xy,symm=FALSE,eps=1e-5),6)
plot(c(fdata(y1[1:101]),fdata(y2[1:101])))
metric.kl(fdata(x1))
metric.kl(fdata(x1),fdata(x2),eps=1e-5,symm=F)
metric.kl(fdata(x1),fdata(x2),eps=1e-6,symm=F)
metric.kl(fdata(y1[1:101]),fdata(y2[1:101]),eps=1e-13,symm=F)
metric.kl(fdata(y1[1:101]),fdata(y2[1:101]),eps=1e-14,symm=F)
}
Run the code above in your browser using DataLab