coef.SPQR: coef method for class 'SPQR'

View source: R/coef.SPQR.R

coef.SPQRR Documentation

coef method for class SPQR

Description

Computes the estimated spline coefficients of a SPQR class object

Usage

## S3 method for class 'SPQR'
coef(object, X, ...)

Arguments

object

An object of class SPQR.

X

The covariate vector/matrix for which the coefficient is calculated.

...

Other arguments.

Value

A NROW(X) by K matrix containing values of the estimated coefficient, where K is the number of basis functions.

Examples


set.seed(919)
n <- 200
X <- rbinom(n, 1, 0.5)
Y <- rnorm(n, X, 0.8)
control <- list(iter = 200, warmup = 150, thin = 1)
fit <- SPQR(X = X, Y = Y, method = "MCMC", control = control,
            normalize = TRUE, verbose = FALSE)
coef(fit, X = 0)


SPQR documentation built on May 3, 2022, 1:08 a.m.