| spBPS | R Documentation |
Orchestrates subsetting, local stacking weight estimation, global stacking
combination, and optional posterior or predictive simulation using the
multivariate Student-t spatial model. Works for both multivariate outcomes
and the univariate case via q = 1.
spBPS(
data,
priors,
coords,
hyperpar,
subset_size = 500L,
K = NULL,
cv_folds = 5L,
rp = 1,
combine_method = c("bps", "pseudoBMA"),
draws = 0L,
newdata = NULL,
include_latent = FALSE,
cores = NULL
)
data |
List with matrices |
priors |
List of priors for the multivariate model ( |
coords |
Matrix of observation coordinates. |
hyperpar |
List with elements |
subset_size |
Target subset size when |
K |
Optional number of subsets. When |
cv_folds |
Number of folds for local cross-validation (default 5). |
rp |
Fraction of rows used when recomputing global stacking weights
(passed to |
combine_method |
Choose between Bayesian Predictive Stacking ( |
draws |
Number of joint posterior/predictive draws to return (0 to
skip). When positive, |
newdata |
Optional list with |
include_latent |
Logical; if |
cores |
Optional integer; when >1 a parallel backend is registered
internally via |
List with components subsets, weights_global, weights_local,
epd, and optional posterior and predictive draws.
n <- 1000
p <- 2
q <- 1
Y <- matrix(rnorm(n*q), ncol = q)
X <- matrix(rnorm(n*p), ncol = p)
coords <- matrix(runif(n*2), ncol = 2)
data <- list(Y = Y, X = X)
priors <- list(mu_B = matrix(0, nrow = p, ncol = q),
V_r = diag(10, p),
Psi = diag(1, q),
nu = 3)
hyperpar <- list(alpha = 0.5, phi = 1)
subset_size <- 200
res <- spBPS(data, priors, coords, hyperpar, subset_size = subset_size)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.