Rでボックスわけして最頻値
mode2<-function(x){ if(length(x)==1){ r<-x }else{ qq<-density(x,na.rm=T) qq<-approx(qq$x,qq$y,seq(quantile(qq$x,0.01),quantile(max(qq$x),1.0),length.out=1000)) r<-qq$x[max(qq$y)==qq$y] } r } #exp(log(xb,2)) xx_f<-as.integer((log(xb,2))) v<-tapply(yb,xx_f,median) v2<-tapply(yb,xx_f,mode2) v3<-tapply(yb,xx_f,mean) v4<-tapply(yb,xx_f,function(x){mean(x,0.8)}) plot(xb,yb,log="xy") points(2^as.numeric(names(v)),v,col=2) points(2^as.numeric(names(v2)),v2,col=3) points(2^as.numeric(names(v3)),v3,col=4) points(2^as.numeric(names(v4)),v4,col=5)