Learn R Programming

stgam (version 1.0.2)

gam_model_rank: Ranks models by GCV, giving the model form for each predictor variable.

Description

Ranks models by GCV, giving the model form for each predictor variable.

Usage

gam_model_rank(res_tab, n = 10)

Value

a tibble of the 'n' best models, ranked by GCV, with the form of each predictor variable where '---' indicates the absence of a predictor, 'Fixed' that a parametric form was specified, 's_S' a spatial smooth, 's_T' a temporal smooth and 't2_ST' a spatio-temporal smooth.

Arguments

res_tab

a data.frame returned from the evaluate_models() function.

n

the number of ranked models to return.

Examples

Run this code
require(dplyr)
require(doParallel)
# define input data
data("hp_data")
input_data <-
  hp_data |>
  # create Intercept as an addressable term
  mutate(Intercept = 1)
# evaluate different model forms
svc_mods <-
  evaluate_models(
    input_data = input_data,
    target_var = "priceper",
    vars = c("pef"),
    coords_x = "X",
    coords_y = "Y",
    VC_type = "SVC",
    time_var = NULL,
    ncores = 2
  )
gam_model_rank(svc_mods)

Run the code above in your browser using DataLab