X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=reports%2Faccuracy.R;h=e9c9d1bfba892f2252eac1242d5fc0d08233e9da;hb=b46623addc9e63019aa1df1dd2de800b48fdd609;hp=c33fa0fec1b4c30b14b6c2b5135763220376612e;hpb=98b8a5ddffdce7e0b63746d4b58bb923049dca7d;p=morpheus.git diff --git a/reports/accuracy.R b/reports/accuracy.R index c33fa0f..e9c9d1b 100644 --- a/reports/accuracy.R +++ b/reports/accuracy.R @@ -13,7 +13,7 @@ optimBeta <- function(N, n, K, p, beta, b, link, weights, ncores) mu <- computeMu(fargs$X, fargs$Y, fargs$optargs) res2 <- NULL tryCatch({ - op <- optimParams(K,link,fargs$optargs) + 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)) }, error = function(e) { @@ -71,6 +71,7 @@ N <- 10 d <- 2 n <- 1e4 ncores <- 1 +strw <- "1-1-1" weights <- c(1,1,1) cmd_args <- commandArgs() @@ -89,7 +90,8 @@ for (arg in cmd_args) } 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], ","))) } } } @@ -120,4 +122,4 @@ mr <- optimBeta(N, n, K, p, beta, b, link, weights, ncores) mr_params <- list("N"=N, "n"=n, "K"=K, "d"=d, "link"=link, "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=""))