You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#' @description Extracts univariate standard errors for the estimated coefficient of B. Standard errors are computed from the (approximate) Fisher information matrix.
157
157
#'
158
158
#' @param object an R6 object with class PLNfit
159
-
#' @param type string describing the type of variance approximation: "variational", "jackknife", "sandwich" (only for fixed covariance). Default is "variational".
159
+
#' @param type string describing the type of variance approximation: "variational", "jackknife", "sandwich". Default is "sandwich".
160
160
#' @param parameter string describing the target parameter: either B (regression coefficients) or Omega (inverse residual covariance)
161
161
#'
162
162
#' @seealso [vcov.PLNfit()] for the complete variance covariance estimation of the coefficient
#' * jackknife boolean indicating whether jackknife should be performed to evaluate bias and variance of the model parameters. Default is FALSE.
456
440
#' * bootstrap integer indicating the number of bootstrap resamples generated to evaluate the variance of the model parameters. Default is 0 (inactivated).
457
441
#' * variational_var boolean indicating whether variational Fisher information matrix should be computed to estimate the variance of the model parameters (highly underestimated). Default is FALSE.
458
-
#' * rsquared boolean indicating whether approximation of R2 based on deviance should be computed. Default is TRUE
442
+
#' * sandwich_var boolean indicating whether sandwich estimator should be computed to estimate the variance of the model parameters (highly underestimated). Default is FALSE.
459
443
#' * trace integer for verbosity. should be > 1 to see output in post-treatments
## 5. compute and store matrix of standard variances for B with sandwich correction approximation
484
+
if (config_post$sandwich_var) {
485
+
if(config_post$trace>1) cat("\n\tComputing sandwich estimator of the variance...")
486
+
private$vcov_sandwich_B(responses, covariates)
487
+
}
499
488
},
500
489
501
490
#' @description Predict position, scores or observations of new data.
@@ -920,25 +909,8 @@ PLNfit_fixedcov <- R6Class(
920
909
optim_out<- do.call(private$optimizer$main, args)
921
910
do.call(self$update, optim_out)
922
911
private$Sigma<- solve(optim_out$Omega)
923
-
},
924
-
925
-
#' @description Update R2, fisher and std_err fields after optimization
926
-
#' @param config_post a list for controlling the post-treatments (optional bootstrap, jackknife, R2, etc.). See details
927
-
#' @param config_optim a list for controlling the optimization parameter. See details
928
-
#' @details The list of parameters `config` controls the post-treatment processing, with the following entries:
929
-
#' * trace integer for verbosity. should be > 1 to see output in post-treatments
930
-
#' * jackknife boolean indicating whether jackknife should be performed to evaluate bias and variance of the model parameters. Default is FALSE.
931
-
#' * bootstrap integer indicating the number of bootstrap resamples generated to evaluate the variance of the model parameters. Default is 0 (inactivated).
932
-
#' * variational_var boolean indicating whether variational Fisher information matrix should be computed to estimate the variance of the model parameters (highly underestimated). Default is FALSE.
933
-
#' * rsquared boolean indicating whether approximation of R2 based on deviance should be computed. Default is TRUE
0 commit comments