Skip to content

Commit

Permalink
Multiplicative perturbation of B in the start point when computing th…
Browse files Browse the repository at this point in the history
…e jackknife variance estimator.
  • Loading branch information
mahendra-mariadassou committed Nov 15, 2023
1 parent a8852e4 commit f89d7d0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions R/PLNfit-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,17 @@ PLNfit <- R6Class(
},

variance_jackknife = function(Y, X, O, w, config = config_default_nlopt) {
cat("Computing jackknife variance estimator", sep = "\n")
cat("\n Computing jackknife variance estimator", sep = "\n")
jacks <- future.apply::future_lapply(seq_len(self$n), function(i) {
# cat(paste0("Jackknife estimate ", i, "/", self$n), sep = "\n")
data <- list(Y = Y[-i, , drop = FALSE],
X = X[-i, , drop = FALSE],
O = O[-i, , drop = FALSE],
w = w[-i])
args <- list(data = data,
params = list(B = private$B, M = matrix(0, self$n-1, self$p), S = private$S[-i, ]),
params = list(B = private$B * (1 + matrix(runif(min = -0.5, max = 0.5, n = self$d * self$p), self$d, self$p)),
M = matrix(0, self$n-1, self$p),
S = private$S[-i, , drop = FALSE]),
config = config)
optim_out <- do.call(private$optimizer$main, args)
optim_out[c("B", "Omega")]
Expand Down

0 comments on commit f89d7d0

Please sign in to comment.