/
postprocess.R
55 lines (33 loc) · 1.27 KB
/
postprocess.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
library(Hmisc)
library(scales) # for adding alpha
# DIRECTORY="out/data-sources/NIST/Bennett5/"
DIRECTORY="out/data-sources/Science/AllometricScaling/"
# DIRECTORY="run/data-sources/Science/Galileo-/"
# DIRECTORY="run/data-sources/Science/Fibonacci-/"
# DIRECTORY="out/"
# DIRECTORY="run/data-sources/Regression/60_100-/"
d <- read.table(paste(DIRECTORY, "tops.txt", sep="/"), sep="\t")
# d <- read.table(paste(DIRECTORY, "samples.txt", sep="/"), sep="\t")
names(d) <- c("thread", "outer", "posterior", "prior", "likelihood", "h.struct", "h")
CUTOFF=10
data <- read.table(paste(DIRECTORY, "data.txt", sep="/"))
x <- seq(min(data$V1), max(data$V1), length.out=1000)
## Plot the data
# bitmap("output.png", height=6, width=6, res=400)
# postscript("o.pdf", height=6, width=6)
plot(data$V1, data$V2, col=4)
errbar(data$V1, data$V2, data$V2-data$V3, data$V2+data$V3, col=4)
dplot <- subset(d, posterior > max(d$posterior) - CUTOFF)
for(r in 1:nrow(dplot)) {
print(dplot[r,])
print(as.character(dplot[r,"h"]))
y <- eval(parse(text=as.character(dplot[r,"h"])))
# in case its constant
if(length(y) == 1){
y <- rep(y, length(x))
}
lines(x,y)
# lines(x,y, color=rgb(0,0,0,alpha=0.5))
# readline()
}
# dev.off()