Robust Bayesian Longitudinal Regularized Semiparametric Mixed Models

Our recently developed fully robust Bayesian semiparametric mixed-effect model for high-dimensional longitudinal studies with heterogeneous observations can be implemented through this package (Fan et al. (2026) ). This model can distinguish between time-varying interactions and constant-effect-only cases to avoid model misspecifications. Facilitated by spike-and-slab priors, this model leads to superior performance in estimation, identification and statistical inference. In particular, robust Bayesian inferences in terms of valid Bayesian credible intervals on both parametric and nonparametric effects can be validated on finite samples. The Markov chain Monte Carlo algorithms of the proposed and alternative models are efficiently implemented in 'C++'.


Blend

Robust Bayesian Longitudinal Regularized Semiparametric Mixed Models

CRAN CRAN RStudio mirrordownloads CRAN RStudio mirrordownloads

Our recently developed fully robust Bayesian semiparametric mixed-effect model for high-dimensional longitudinal studies with heterogeneous observations can be implemented through this package (Fan et al. (2026)). This model can distinguish between time-varying interactions and constant-effect-only cases to avoid model misspecifications. Facilitated by spike-and-slab priors, this model leads to superior performance in estimation, identification and statistical inference. In particular, robust Bayesian inferences in terms of valid Bayesian credible intervals on both parametric and nonparametric effects can be validated on finite samples. The Markov chain Monte Carlo algorithms of the proposed and alternative models are efficiently implemented in 'C++'.

How to install

  • To install from github, run these two lines of code in R
install.packages("devtools")
devtools::install_github("kunfa/Blend")
  • Released versions of Blend are available on CRAN (link), and can be installed within R via
install.packages("Blend")

Examples

Example.1 (default method: robust structural with sparsity)

library(Blend)
data(dat)

truth = list(gamma0 = function(u) 2+2*sin(2*pi*u),
gamma1 = function(u) 2.5*exp(2.5*u-1),
gamma2 = function(u) 3*u^2-2*u+2,
gamma3 = function(u) -4*u^3+3,
gamma4 = function(u) 3-2*u,
gamma5 = 0.8,
gamma6 = -1.2,
gamma7 = 0.7,
gamma8 = -1.1,
gamma9 = 0,
gamma10 = 0,
gamma11 = 0,
gamma12 = 0,
gamma13 = 0,
gamma14 = 0,
gamma15 = 0)

fit = Blend(y,x,t,J,kn,degree)

## the posterior estimates of coefficients

fit$coefficient

## 95% empirical coverage probabilities

u = as.numeric(fit$basis$u)
rep=1000
CI_RBVSS_SI = matrix(NA, nrow=rep, ncol=length(truth))
colnames(CI_RBVSS_SI) = names(truth)
for(i in 1:rep){
 out = unlist(Coverage(fit, truth))
 CI_RBVSS_SI[i, ] = out
 cat("Replicate = ", i, "\n")
}
## the (varying) intercept has not been regularized
cp_RBVSS_SI =  colMeans(CI_RBVSS_SI) # 95% empirical coverage probabilities

## Plot the intercept function and the identified varying effects

plot_Blend(fit,sparse=TRUE)

Example.2 (alternative: robust non-structural with sparsity)

fit = Blend(y,x,t,J,kn,degree,structural=FALSE) 

Example.3 (alternative: non-robust structural with sparsity)

fit = Blend(y,x,t,J,kn,degree, robust=FALSE)

Example.4 (alternative: non-robust non-structural without sparsity)

fit = Blend(y,x,t,J,kn,degree, robust=FALSE, structural=FALSE, sparse = FALSE) 

Methods

This package provides implementation for methods proposed in

  • Fan, K., Ren, J., Ma, S. and Wu, C. (2026). Robust Bayesian Variable Selection and Inference Under Misspecified Nonparametric Mixed Models in Longitudinal Studies. Statistics in Medicine. 45(25-27), e70830

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("Blend")

0.1.5 by Kun Fan, 15 hours ago


https://github.com/kunfa/Blend


Report a bug at https://github.com/kunfa/Blend/issues


Browse source code at https://github.com/cran/Blend


Authors: Kun Fan [aut, cre] , Cen Wu [aut]


Documentation:   PDF Manual  


GPL-2 license


Imports Rcpp, splines, stats, ggplot2, withr

Linking to Rcpp, RcppArmadillo


See at CRAN