predict_polar_gam {rticulate} | R Documentation |
Get all predictions from a polar GAM model
Description
It returns a tibble with the predictions from all the terms in a polar_gam model.
Usage
predict_polar_gam(
model,
origin = NULL,
exclude_terms = NULL,
length_out = 50,
values = NULL,
return_ci = FALSE,
ci_z = 1.96
)
Arguments
model |
A polar_gam model object. |
origin |
The coordinates of the origin as a vector of |
exclude_terms |
Terms to be excluded from the prediction. Term names should be given as they appear in the model summary (for example, |
length_out |
An integer indicating how many values along the numeric predictors to use for predicting the outcome term (the default is |
values |
User supplied values for numeric terms as a named list. |
return_ci |
Whether to return a tibble with cartesian confidence intervals (for use with geom_polar_ci). |
ci_z |
The z-value for calculating the CIs (the default is |
Details
The function behaves like predict_gam but it converts the
coordinates from polar to cartesian automatically. Check
vignette("predict-gam", package = "tidymv")
to an overview of the
predict method.
To see an example of plotting, see the examples in geom_polar_ci.
Value
A tibble with predictions from a polar_gam model.
Examples
library(dplyr)
tongue_it01 <- filter(tongue, speaker == "it01")
it01_pol <- polar_gam(Y ~ s(X, by = c2_place) + s(X, word, bs = "fs"),
data = tongue_it01)
# get predictions
it01_pred <- predict_polar_gam(it01_pol)
# get predictions excluding the random smooth for word (the coefficient for
# the random smooth is set to 0)
it01_excl_rand <- predict_polar_gam(it01_pol, exclude_terms = "s(X,word)")