coef.vem_fit: Extract Active Basis Coefficients from a VEM Fit

View source: R/coef.vem_fit.R

coef.vem_fitR Documentation

Extract Active Basis Coefficients from a VEM Fit

Description

Returns a K \times m matrix of estimated basis coefficients. Each column corresponds to one curve; each row to one basis function. Coefficients are set to zero when the posterior inclusion probability p_{ki} \leq threshold (inactive bases). When is.composite = TRUE, the matrix has dimension \max(K) \times m, where \max(K) is the highest K selected by GCV across all curves; coefficients for curves with smaller optimal K are zero-padded (structural padding).

Usage

## S3 method for class 'vem_fit'
coef(object, threshold = 0.5, ...)

Arguments

object

A vem_fit object from vem_fit.

threshold

Numeric in (0,1). Posterior inclusion probability below which a coefficient is set to zero. Default 0.5.

...

Currently unused.

Value

A numeric matrix of dimension \max(K) \times m, with row names B1, B2, ... and column names Curve_1, Curve_2, ....

References

da Cruz, A. C., de Souza, C. P. E., & Sousa, P. H. T. O. (2024). Fast Bayesian basis selection for functional data representation with correlated errors. arXiv:2405.20758. https://arxiv.org/abs/2405.20758

See Also

vem_fit, predict.vem_fit, summary.vem_fit

Examples


  data(toy_curves)
  fit <- vem_fit(y = toy_curves$y, Xt = toy_curves$Xt, K = 8)

  # K x m matrix of active coefficients
  coefs <- coef(fit)
  dim(coefs)   # 8 x 3

  # Compare estimated vs true coefficients for curve 1
  cbind(estimated = coefs[, 1], true = toy_curves$true_coef)

  # Stricter threshold — only very confident inclusions
  coef(fit, threshold = 0.9)


fda.vi documentation built on June 20, 2026, 5:06 p.m.