fit_smooths | R Documentation |
Once formulas have been mapped onto a sspm discrete object, the GAMs can be
fitted with this function. Arguments can be passed onto bam
.
fit_smooths(
sspm_object,
boundaries,
keep_fit = TRUE,
predict = TRUE,
family = mgcv::tw,
drop.unused.levels = F,
method = "fREML",
...
)
fit_spm(
sspm_object,
sspm_formula,
keep_fit = TRUE,
family = mgcv::scat,
drop.unused.levels = F,
select = TRUE,
method = "REML",
...
)
## S4 method for signature 'sspm_dataset,sspm_discrete_boundary'
fit_smooths(
sspm_object,
boundaries,
keep_fit = TRUE,
predict = TRUE,
family = mgcv::tw,
drop.unused.levels = F,
method = "fREML",
...
)
## S4 method for signature 'sspm,sspm_formula'
fit_spm(
sspm_object,
sspm_formula,
keep_fit = TRUE,
family = mgcv::scat,
drop.unused.levels = F,
select = TRUE,
method = "REML",
...
)
sspm_object |
[sspm_dataset] An object of class sspm_dataset. |
boundaries |
[sspm_boundary] An object of class sspm_discrete_boundary. |
keep_fit |
[logical] Whether or not to keep the fitted values and model (default to TRUE, set to FALSE to reduce memory footprint). |
predict |
[logical] Whether or not to generate the smoothed predictions (necessary to fit the final SPM model, default to TRUE). |
family |
This is a family object specifying the distribution and link to use in
fitting etc. See |
drop.unused.levels |
by default unused levels are dropped from factors before fitting. For some smooths involving factor variables you might want to turn this off. Only do so if you know what you are doing. |
method |
The smoothing parameter estimation method. |
... |
Arguments passed on to
|
sspm_formula |
[sspm_formula] The formula specifying the the smoothing model. |
select |
Should selection penalties be added to the smooth effects, so that they can in principle be
penalized out of the model? See |
A object of the class sspm_fit
.
## Not run:
fit_smooths(boundaries = boundaries, keep_fit = TRUE, ...)
fit_spm(sspm_object = sspm_object, sspm_formula = sspm_formula, ...)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.