check_grad: Sum of the observation-wise gradient contributions to the...

Description Usage Arguments Value

View source: R/gamtree.R

Description

Computes the sum of the column-wise sums of the observation-wise gradient contributions to the fitted GAM in each of the tree nodes. This yields a sum for each coefficients in each node. This sum should be reasonably close to zero. The more the column-wise sum of the observation-wise gradient contribution differts from zero, the more the parameter stability tests w.r.t. to that coefficient will be overpowered.

Usage

1
check_grad(object, return_fits = FALSE)

Arguments

object

an object of class gamtree.

return_fits

whether fitted GAMs should be returned.

Value

Returns a matrix with the sum of the observation-wise gradient contributions, with a row for each node of the tree and a column for each coefficient. If return_fits = TRUE, a list with two components is returned: The first component $grad contains the a matrix with the column-wise sums of the gradient contributions. The second component $fits contains a list of the node-specific GAM fits.


marjoleinF/gamtree documentation built on Sept. 17, 2021, 5:46 a.m.