projects
/
morpheus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix default weights, fix reporting scripts
[morpheus.git]
/
reports
/
accuracy.R
diff --git
a/reports/accuracy.R
b/reports/accuracy.R
index
05d9e8a
..
91d9c61
100644
(file)
--- a/
reports/accuracy.R
+++ b/
reports/accuracy.R
@@
-11,11
+11,10
@@
optimBeta <- function(N, n, K, p, beta, b, link, weights, ncores)
M <- computeMoments(fargs$X, fargs$Y)
fargs$optargs$M <- M
mu <- computeMu(fargs$X, fargs$Y, fargs$optargs)
M <- computeMoments(fargs$X, fargs$Y)
fargs$optargs$M <- M
mu <- computeMu(fargs$X, fargs$Y, fargs$optargs)
- res2 <- NULL
+ op <- optimParams(K,fargs$optargs$link,fargs$optargs)
+ x_init <- list(p=rep(1/K,K-1), beta=mu, b=rep(0,K))
tryCatch({
tryCatch({
- op <- optimParams(K,fargs$optargs$link,fargs$optargs)
- x_init <- list(p=rep(1/K,K-1), beta=mu, b=rep(0,K))
- res2 <- do.call(rbind, op$run(x_init))
+ res2 <- do.call(rbind, op$run(x_init))
}, error = function(e) {
res2 <- NA
})
}, error = function(e) {
res2 <- NA
})
@@
-50,7
+49,6
@@
optimBeta <- function(N, n, K, p, beta, b, link, weights, ncores)
fargs$X = io$X
fargs$Y = io$Y
fargs$optargs$K = ncol(fargs$beta)
fargs$X = io$X
fargs$Y = io$Y
fargs$optargs$K = ncol(fargs$beta)
- fargs$optargs$M = computeMoments(io$X,io$Y)
fargs
}, N=N, ncores=ncores, verbose=TRUE)
p <- c(p, 1-sum(p))
fargs
}, N=N, ncores=ncores, verbose=TRUE)
p <- c(p, 1-sum(p))
@@
-71,6
+69,7
@@
N <- 10
d <- 2
n <- 1e4
ncores <- 1
d <- 2
n <- 1e4
ncores <- 1
+strw <- "1-1-1"
weights <- c(1,1,1)
cmd_args <- commandArgs()
weights <- c(1,1,1)
cmd_args <- commandArgs()
@@
-89,7
+88,8
@@
for (arg in cmd_args)
} else if (spl[1] == "link") {
link <- spl[2]
} else if (spl[1] == "weights") {
} else if (spl[1] == "link") {
link <- spl[2]
} else if (spl[1] == "weights") {
- weights <- unlist(strsplit(spl[2], ","))
+ strw <- spl[2]
+ weights <- as.numeric(unlist(strsplit(spl[2], ",")))
}
}
}
}
}
}
@@
-117,7
+117,7
@@
if (d == 2) {
}
mr <- optimBeta(N, n, K, p, beta, b, link, weights, ncores)
}
mr <- optimBeta(N, n, K, p, beta, b, link, weights, ncores)
-mr_params <- list("N"=N, "n"=n, "K"=K, "d"=d, "link"=link,
+mr_params <- list("N"=N, "n
c"=ncores, "n
"=n, "K"=K, "d"=d, "link"=link,
"p"=c(p,1-sum(p)), "beta"=beta, "b"=b, "weights"=weights)
"p"=c(p,1-sum(p)), "beta"=beta, "b"=b, "weights"=weights)
-save("mr", "mr_params", file=paste("
multirun_",n,"_",d,"_",link
,".RData",sep=""))
+save("mr", "mr_params", file=paste("
res_",n,"_",d,"_",link,"_",strw
,".RData",sep=""))