Formula interfaces for reference penalized GWR models
Source:R/reference_models.R
gwr_reference_formulas.RdThese are concise formula wrappers around [gwr_penalized()].
Usage
gwr_lasso(formula, data, coords, ...)
gwr_ridge(formula, data, coords, ...)
gwr_en(formula, data, coords, ..., alpha = 0.5)Examples
quake <- datasets::quakes[1:30, ]
control <- gwrs_control(n_threads = 1)
lasso <- gwr_lasso(
mag ~ depth + stations, quake, c("long", "lat"),
k = 18, lambda = 0.05, control = control
)
ridge <- gwr_ridge(
mag ~ depth + stations, quake, c("long", "lat"),
k = 18, lambda = 0.05, control = control
)
elastic_net <- gwr_en(
mag ~ depth + stations, quake, c("long", "lat"),
k = 18, lambda = 0.05, alpha = 0.6, control = control
)
c(lasso$method, ridge$method, elastic_net$method)