coef.gamtree: Extract estimated coefficients of a GAM tree

Description Usage Arguments Value

View source: R/gamtree.R

Description

Returns the estimates global or local coefficients of a GAM tree.

Usage

1
2
## S3 method for class 'gamtree'
coef(object, which = "local", ...)

Arguments

object

an object of class gamtree.

which

character. Specifies whether local ("local"; node-specific estimates from the tree) or globally ("global") estimated coefficients should be returned.

...

currently not used.

Value

Returns a matrix (if which = "local") or a vector (if which = "global") with estimated coefficients. ## GAM tree without global terms: gt1 <- gamtree(Pn ~ s(PAR, k = 5L) | Species, data = eco, cluster = eco$specimen) coef(gt1)

## GAM tree with global terms: gt2 <- gamtree(Pn ~ s(PAR, k = 5L) | s(cluster_id, bs = "re") + noise | Species, data = eco, cluster = eco$specimen) coef(gt2) coef(gt2, which = "global")


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