validate_GARCHX <- function(eps, X, order){
  # Fit the model and returns all the p-values
  
  # Just one pass of estimate
  
  # Declaring initial values for paramters
  # d = number of exogenous covariates
  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
    
    # Error check: checks if number of rows of X is equal to length of eps
    if(dim(X)[1] != (length(eps))){
      stop("Number of rows of matrix X must be the same as eps")
    } # End if
  }
  
  # Error check: checks of order is a vector of length 2 for p and q values
  if (!is.vector(order) || length(order) != 2){
    stop("order must be a vector of length 2 with entries determining the order of the GARCH model")
  } # End if
  
  # Error check: order is c(0, 0)
  if(order[2] < 0){
    stop("q must be a non negative integer")
  } # End if
  
  if(order[1] <= 0){
    stop("p must be greater than 0")
  } # End if
} 