Learn R Programming

bayesGAM (version 0.0.2)

coefficients: Extract Model Coefficients

Description

Method for bayesGAMfit objects. Extracts the specified quantile of the posterior. The user may specify all or some of the parameters \(\beta\), \(\epsilon\), \(\lambda\), \(u\), \(sigma\), \(a\).

Usage

# S4 method for bayesGAMfit
coefficients(
  object,
  params = c("beta", "eps", "lambda", "u", "sigma", "a"),
  FUN = median
)

# S4 method for bayesGAMfit coef( object, params = c("beta", "eps", "lambda", "u", "sigma", "a"), FUN = median )

Arguments

object

an object of class bayesGAMfit, usually a result of a call to bayesGAM.

params

character vector of the names of parameters to return

  • \(\beta\) beta

  • \(\epsilon\) eps

  • \(\lambda\) lambda

  • \(a] a\)

FUN

function from which to estimate coefficients. Default is median

Value

Numeric vector of parameter point estimates based on the given prob, with a default of the median estimate.

Examples

Run this code
# NOT RUN {
require(stats); require(graphics)
f <- bayesGAM(weight ~ np(height), data = women, family = gaussian, 
              iter = 500, chains = 1)
coef(f, params=c("beta", "eps"))
# }

Run the code above in your browser using DataLab