- #print(o) #not returning o to avoid weird Jupyter issue... (TODO:)
-}
-
-#' plotQn
-#'
-#' Draw 3D map of objective function values
-#'
-#' @param N Number of starting points
-#' @param n Number of points in sample
-#' @param p Vector of proportions
-#' @param b Vector of biases
-#' @param β Regression matrix (target)
-#' @param link Link function (logit or probit)
-#'
-#' @export
-plotQn <- function(N, n, p, β, b, link)
-{
- d <- nrow(β)
- K <- ncol(β)
- io <- generateSampleIO(n, p, β, b, link)
- op <- optimParams(K, link, list(X=io$X, Y=io$Y))
- # N random starting points gaussian (TODO: around true β?)
- res <- matrix(nrow=d*K+1, ncol=N)
- for (i in seq_len(N))
- {
- β_init <- rnorm(d*K)
- par <- op$run( c(rep(1/K,K-1), β_init, rep(0,K)) )
- par <- op$linArgs(par)
- Qn <- op$f(par)
- res[,i] = c(Qn, par[K:(K+d*K-1)])
- }
- res #TODO: plot this, not just return it...