central_diff | R Documentation |
This function calculates the central difference approximation of the first derivative of a generalized additive model (GAM) with respect to a specified predictor variable.
central_diff(gam_object, newdata, x, h)
gam_object |
A fitted GAM model. |
newdata |
A data frame containing the values of predictor variables used to calculate the derivative. |
x |
Name of the predictor variable with respect to which you want to calculate the derivative. |
h |
Step size for the central difference approximation (default = 0.005) |
A numeric vector representing the central difference approximation of the first derivative.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.