central_diff: Calculate the Central Difference Approximation of the First...

View source: R/get-pstar.R

central_diffR Documentation

Calculate the Central Difference Approximation of the First Derivative

Description

This function calculates the central difference approximation of the first derivative of a generalized additive model (GAM) with respect to a specified predictor variable.

Usage

central_diff(gam_object, newdata, x, h)

Arguments

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)

Value

A numeric vector representing the central difference approximation of the first derivative.


pbs-assess/gfsynopsis documentation built on March 26, 2024, 7:30 p.m.