| vem_smooth | R Documentation |
Fits m functional curves simultaneously via Bayesian basis function
selection with an Ornstein-Uhlenbeck within-curve correlation structure.
This function is called internally by vem_fit and only runs
the VEM algorithm itself, without performing basis construction,
standardization, or GCV tuning. Most users should call
vem_fit instead, which handles those steps automatically.
vem_smooth(
y,
B,
Xt = Xt,
m = length(y),
K = K,
mu_ki = 0.5,
lambda_1 = 1e-10,
lambda_2 = 1e-10,
delta_1 = 1e-10,
delta_2 = 1e-10,
maxIter = 1000,
initial_values,
convergence_threshold = 0.01,
lower_opt = 0.1
)
y |
List of length |
B |
List of length |
Xt |
Numeric vector of |
m |
Integer. Number of curves. Defaults to |
K |
Integer. Number of basis functions. |
mu_ki |
Numeric scalar in |
lambda_1, lambda_2 |
Positive scalars. Inverse-Gamma prior hyperparameters
for |
delta_1, delta_2 |
Positive scalars. Inverse-Gamma prior hyperparameters
for |
maxIter |
Integer. Maximum VEM iterations. Default |
initial_values |
Named list with elements |
convergence_threshold |
Positive scalar. Absolute ELBO tolerance for
convergence. Default |
lower_opt |
Positive scalar. Lower bound for |
The algorithm alternates between an E-step — sequential coordinate ascent variational inference (CAVI) updates for
q(\beta_i), q(\sigma^2), q(\tau^2), q(Z_{ki}),
and q(\theta_{ki}) — and an M-step that maximizes the ELBO with
respect to the correlation decay parameter w via L-BFGS-B with an
analytic gradient. Convergence is declared when the absolute ELBO change
between iterations falls below convergence_threshold.
For hyperparameter initialization, set delta_1 and delta_2
such that delta_2 / (delta_1 - 1) is a rough estimate of the noise
variance, and initialize w consistent with the expected correlation
strength in the data.
A named list containing:
mu_betaPosterior means \mu_{\beta_{ki}} (length mK).
Sigma_betaPosterior covariance array (K \times K \times m).
probPosterior inclusion probabilities p_{ki} (length mK).
Basis k is active for curve i when p_{ki} > 0.5.
delta1, delta2Final q(\sigma^2) parameters.
lambda1, lambda2Final q(\tau^2) parameters.
wEstimated correlation decay parameter (range-normalized scale).
cor_matThe n \times n Ornstein-Uhlenbeck correlation
matrix \Psi evaluated at the final estimated decay parameter
\hat{w}, as returned by computePsiMatrix.
elbo_valuesELBO trajectory across iterations.
convergedLogical. Whether the convergence criterion was met.
n_iterationsNumber of iterations run.
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
vem_fit, plot.vem_fit,
predict.vem_fit, coef.vem_fit
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.