27  hyper_gam from gam

The examples in Chapter 27 require (see the explanation of the function name conflict in Section 7.4)

library(hyper.gam)
# Loading required package: groupedHyperframe
# Registered S3 method overwritten by 'pROC':
#   method   from            
#   plot.roc spatstat.explore
search path & loadedNamespaces on author’s computer
search()
#  [1] ".GlobalEnv"                "package:hyper.gam"         "package:groupedHyperframe" "package:stats"             "package:graphics"          "package:grDevices"         "package:utils"            
#  [8] "package:datasets"          "package:methods"           "Autoloads"                 "package:base"
loadedNamespaces() |> sort.int()
#   [1] "abind"             "base"              "caret"             "class"             "cli"               "cluster"           "codetools"         "compiler"          "data.table"       
#  [10] "datasets"          "deldir"            "digest"            "doParallel"        "dplyr"             "evaluate"          "farver"            "fastmap"           "fastmatrix"       
#  [19] "foreach"           "future"            "future.apply"      "generics"          "geomtextpath"      "GET"               "ggplot2"           "globals"           "glue"             
#  [28] "goftest"           "gower"             "graphics"          "grDevices"         "grid"              "gridExtra"         "groupedHyperframe" "gtable"            "hardhat"          
#  [37] "htmltools"         "htmlwidgets"       "httr"              "hyper.gam"         "ipred"             "iterators"         "jsonlite"          "knitr"             "lattice"          
#  [46] "lava"              "lazyeval"          "lifecycle"         "listenv"           "lubridate"         "magrittr"          "MASS"              "Matrix"            "matrixStats"      
#  [55] "methods"           "mgcv"              "ModelMetrics"      "nlme"              "nnet"              "otel"              "parallel"          "parallelly"        "patchwork"        
#  [64] "pillar"            "pkgconfig"         "plotly"            "plyr"              "polyclip"          "pracma"            "pROC"              "prodlim"           "purrr"            
#  [73] "R6"                "RColorBrewer"      "Rcpp"              "recipes"           "reshape2"          "rlang"             "rmarkdown"         "rpart"             "rstudioapi"       
#  [82] "S7"                "scales"            "SpatialPack"       "spatstat.data"     "spatstat.explore"  "spatstat.geom"     "spatstat.random"   "spatstat.sparse"   "spatstat.univar"  
#  [91] "spatstat.utils"    "splines"           "stats"             "stats4"            "stringi"           "stringr"           "survival"          "systemfonts"       "tensor"           
# [100] "textshaping"       "tibble"            "tidyr"             "tidyselect"        "timechange"        "timeDate"          "tools"             "utils"             "vctrs"            
# [109] "viridisLite"       "withr"             "xfun"              "yaml"

Function hyper.gam::hyper_gam() (v0.2.1.20151215) creates an R object of the S3 class 'hyper_gam', which inherits from the S3 class 'gam' (Chapter 22) from package mgcv (Wood 2017, v1.9.4) with an additional attribute,

Table 27.1 summarizes the S3 methods for the class 'hyper_gam' in package hyper.gam (v0.2.1.20151215),

Table 27.1: S3 methods hyper.gam::*.hyper_gam (v0.2.1.20151215)
visible generic isS4
contour.hyper_gam TRUE graphics::contour FALSE
cor_xy.hyper_gam TRUE hyper.gam::cor_xy FALSE
persp.hyper_gam TRUE graphics::persp FALSE
predict.hyper_gam TRUE stats::predict FALSE
sign_adjust.hyper_gam TRUE hyper.gam::sign_adjust FALSE
update.hyper_gam TRUE stats::update FALSE

27.1 Sign Adjustment

The S3 generic functions hyper.gam::sign_adjust() and hyper.gam::cor_xy() ..

🚧 Rest of this section is under construction. Expected delivery by 2025-12-31.

27.2 Visualization

The S3 methods contour.hyper_gam() and persp.hyper_gam() .. Listing 5.5 ..

🚧 Rest of this section is under construction. Expected delivery by 2025-12-31.

Visualization of the integrand surface (Chapter 5, Equation 5.3) in functions integrandSurface(), persp.hyper_gam() and contour.hyper_gam() is inspired by function mgcv::vis.gam(). Visualization of the integrand paths, as well as their projections on the \((p,q)\)- and \((p,s)\)-plane, is an original idea and design by Tingting Zhan.

27.3 Prediction

The S3 method hyper.gam::predict.hyper_gam() calculates the quantile index predictors of the training and/or test data set, based on the training model m1a (Chapter 5, Listing 5.6). The returned value is a numeric vector.

Function hyper.gam::predict.hyper_gam() is a convenient wrapper and slight modification of the S3 method mgcv::predict.gam(). The use of S3 generic stats::predict(), which is typically for predicted values, could be confusing, but we choose to follow the practice and nomenclature of function mgcv::predict.gam().

27.4 Update

The S3 method update.hyper_gam()

🚧 Rest of this section is under construction. Expected delivery by 2025-12-31.