Skip to contents

Fits a Dirichlet Process Regression model via `RcppDPR::fit_model` and returns the per-variant weights, computed as `beta + alpha` (matching `RcppDPR:::predict.DPR_Model`, which uses `(beta + alpha)

Usage

dpr_weights(X, y, fitting_method = "VB", retain_fit = FALSE, ...)

dpr_vb_weights(X, y, n_k = 8, retain_fit = FALSE, ...)

dpr_gibbs_weights(X, y, s_step = 5000, retain_fit = FALSE, ...)

dpr_adaptive_gibbs_weights(X, y, retain_fit = FALSE, ...)

Arguments

X

A numeric matrix of predictors.

y

A numeric response vector.

fitting_method

One of "VB", "Gibbs", or "Adaptive_Gibbs". Default is "VB".

...

Additional arguments passed through to `RcppDPR::fit_model`.

Value

A numeric vector of length `ncol(X)` of variant weights.

Details

By default the variational Bayes (`VB`) fitting method is used, which is fast and deterministic. The user may switch to `Gibbs` or `Adaptive_Gibbs` for full Bayesian MCMC inference. `rotate_variables` is held to `FALSE` under the assumption that any covariates have already been regressed out upstream; an intercept-only covariate matrix is supplied to `fit_model`.