26  hyper_gam from gam

The examples in Chapter 26 require (see the explanation of the function name conflict in Section 6.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"

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

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

Table 26.1: S3 methods hyper.gam::*.hyper_gam (v0.2.2)
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

26.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.

26.2 Visualization

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

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

Visualizations of the integrand surface (Chapter 4, Equation 4.3) in the function integrandSurface() and the S3 methods persp.hyper_gam() and contour.hyper_gam() are inspired by function vis.gam() (Wood 2017, v1.9.4). 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.

26.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 4, Listing 4.6). The returned value is a numeric vector.

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

26.4 Update

The S3 method update.hyper_gam()

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