Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions R/evaluate_models.R
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,8 @@ evaluate_models <- function(input_data,
} else {
cl <- parallel::makeCluster(ncores)
doParallel::registerDoParallel(cl)

on.exit(parallel::stopCluster(cl))

vc_res_gam <- foreach::foreach(
i = 1:nrow(terms_grid),
.combine = "rbind",
Expand All @@ -423,7 +424,6 @@ evaluate_models <- function(input_data,
vars, coords_x, coords_y, time_var, spatial_k, temporal_k)
}

parallel::stopCluster(cl)
}

return(vc_res_gam)
Expand Down
2 changes: 1 addition & 1 deletion vignettes/stgam_intro_chaco.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ ggplot() +
theme_bw()
```

Thus, this diversion into smooths and splines illustrates how they model different relationships (slopes) with `y` at different locations within the variable feature space, (the `x` axis in the above example). In this way, spline smooth curves can be used to capture non-linear relationships in attribute-space (here the relationship of `x` with `y`).
Thus, this diversion into smooths and splines illustrates how they model different relationships (slopes) with `y` at different locations within the variable feature space (the `x` axis in the above example). In this way, spline smooth curves can be used to capture non-linear relationships in attribute-space (here the relationship of `x` with `y`).

Importantly, in the context of space-time varying coefficient modelling with `stgam` (see the accompanying vignette in this package), the smooth can be used to model how relationships between `x` and `y` varies with respect to time or location, if the smooth is also parameterised with those. That is moving from attribute-space to temporal- or geographical-space, respectively.

Expand Down
2 changes: 1 addition & 1 deletion vignettes/stgam_vc_models_chaco.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ t1 <- Sys.time()
stvc_mods <- evaluate_models(
input_data = chaco |> st_drop_geometry(),
target_var = "ndvi",
family = "gaussian()",
model_family = "gaussian()",
vars = c("tmax", "pr"),
coords_x = "X",
coords_y = "Y",
Expand Down