validate_ARCHmXAdditive <- function(eps, X, p, delta, covariates, method, n_burn, k.choice) {
  if (!is.null(X)) 
  {
    # Error check: checks if X is a matrix
    if (!is.matrix(X)){
      stop("X must be a matrix with number of rows equal to the length of eps")
    } # End if
    if (nrow(X) != length(eps)) {
      stop("Data matrix X incompatible with epsilon vector.")
    }
    if (!identical(covariates,"all") & length(covariates) > ncol(X)) {
      stop("Data matrix X incompatible with covariate list.")
    }
  }
  if ((k.choice != "plugin") && (k.choice != "CV")) {
    stop("bandwidth should be CV or plugin.")
  }
  if (!is.numeric(p) || length(p) != 1 || p <= 0) {
    stop("p must be a positive integer.")
  }
  if (delta <= 0) {
    stop("delta must be a positive number.")
  }  
  if (length(eps) <= p + n_burn){
    stop("Need length(eps) > p + n_burn.")
  } 
  if (!is.character(method) || length(method) != 1 || !(method %in% c("smooth_means_Positive_Constraint_Exp", "smooth_means_lowes", "smooth_variance"))) {
    stop("method must be one of 'smooth_means_Positive_Constraint_Exp', 'smooth_means_lowes', 'smooth_variance'.")
  }
  
}