Skip to content

Commit

Permalink
.9999 MCD cutoff. PCA_kurt proj as default. fix DVARS cutoffs
Browse files Browse the repository at this point in the history
  • Loading branch information
Damon Pham committed Jun 5, 2020
1 parent fd5f7a8 commit 449cc65
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions R/clever.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' @param projection_methods Vector of projection methods to use. Choose at least
#' one of the following: \code{"PCA_var"} for PCA + variance, \code{"PCA_kurt"}
#' for PCA + kurtosis, and \code{"PCATF"} for PCA Trend Filtering + variance.
#' Or, use \code{"all"} to use all methods. Default is \code{c("PCA_var")}.
#' Or, use \code{"all"} to use all methods. Default is \code{c("PCA_kurt")}.
#'
#' clever will use all combinations of the requested projection and
#' outlyingness methods that make sense. For example, if
Expand Down Expand Up @@ -49,7 +49,7 @@
#' \code{4}, or \eqn{4 * median}.
#' @param MCD_cutoff The outlier cutoff quantile for MCD distance. Only used if
#' \code{"robdist" \%in\% projection_methods | "robdist_subset" \%in\% projection_methods}
#' and \code{id_outliers}. Default is \code{0.99}, for the \eqn{0.99} quantile.
#' and \code{id_outliers}. Default is \code{0.9999}, for the \eqn{0.9999} quantile.
#' The quantile is computed from the estimated F distribution.
#' @param lev_images Should leverage images be computed? If \code{FALSE} memory is
#' conserved. Default is \code{FALSE}.
Expand Down Expand Up @@ -152,7 +152,7 @@
#' clev = clever(X)
clever = function(
X,
projection_methods = "PCA_var",
projection_methods = "PCA_kurt",
outlyingness_methods = "leverage",
DVARS = TRUE,
PCs_detrend = FALSE,
Expand All @@ -161,7 +161,7 @@ clever = function(
kurt_detrend = TRUE,
id_outliers = TRUE,
lev_cutoff = 4,
MCD_cutoff = 0.99,
MCD_cutoff = 0.9999,
lev_images = TRUE,
verbose = FALSE) {

Expand Down Expand Up @@ -276,8 +276,8 @@ clever = function(
outlier_measures$DVARS_ZD <- X_DVARS$ZD

if(id_outliers){
outlier_cutoffs$DVARS_DPD <- qnorm(1-.05/T_)
outlier_cutoffs$DVARS_ZD <- 5
outlier_cutoffs$DVARS_DPD <- 5
outlier_cutoffs$DVARS_ZD <- qnorm(1-.05/T_)

outlier_flags$DVARS_DPD <- X_DVARS$DPD > outlier_cutoffs$DVARS_DPD
outlier_flags$DVARS_ZD <- X_DVARS$ZD > outlier_cutoffs$DVARS_ZD
Expand Down

0 comments on commit 449cc65

Please sign in to comment.