Advertisement
hakemon

rbtdel_bf

Apr 29th, 2013
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.51 KB | None | 0 0
  1. ##find best C value
  2. jpeg('RBTDelete_bf.jpeg')
  3. d <- read.table('RBTDelete.txt')
  4. tsize=d[,1];rtime=d[,2]
  5. CC=rtime/log2(tsize)
  6. minvar=10^9;minC=0
  7. for (i in 1:length(tt)){
  8. rtt=CC[i]*log2(tsize);dtt=rtt-rtime;tvar=sum(dtt^2);
  9. if(tvar<minvar) {minvar=tvar;minC=CC[i]}
  10. }
  11. M=minC
  12. logPlot=M*log2(d[,1])
  13. plot(d, main="RBTDelete", pch=24,cex=0.4,xlab="Treesize", ylab="Time (ms)",ylim=c(min(logPlot),max(logPlot,d[,2])));
  14. lines(d[,1], logPlot, col='red')
  15. legend("bottomright", "Expected runtime", lty=1, col="red")
  16. dev.off()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement