R/summary.OptimRegModelObject.R

Defines functions summary.OptimRegModelObject

Documented in summary.OptimRegModelObject

#' Summary function for OptimRegModelObject
#'
#' @param object Object from optimRegModel
#' @param ... additional parameters.
#' @export
summary.OptimRegModelObject <- function(object,...){

  FinalModel <- object$bestmodel$Submodel
  bestPenalty <- object$`best penalty`
  print(paste("The best penalty value based on", object$call$criterion, "was:", bestPenalty))
  print("Parameter values for the best model:")
  for(mat in FinalModel$matrices){
    # check if there are any free parameters in the matrix
    if(any(mat$free)){
      print(paste("Values for",mat$name,":"))
      print(mat$values)

    }
  }

  print("Fit measures for different penalty values:")
  print(object$`fit measures`)

  retList <- list("FinalModel" = FinalModel, "bestPenalty" = bestPenalty, "fitMeasures" = object$`fit measures`)
  class(retList) <- "summary.OptimRegModelObject"
}
jhorzek/regmx documentation built on Sept. 19, 2022, 2:30 a.m.