| Title: | Unified Dynamic Deep 'BART' for Interval-Censored Survival |
|---|---|
| Description: | Implements U-DDBART-IC, a unified Bayesian workflow for dynamic risk prediction from irregular longitudinal biomarkers when event times are interval-censored between clinical visits. The package turns long-format biomarker histories and patient-level interval endpoints L, R, C and delta into a discrete-time follow-up grid, summarises each landmark history with nine interpretable trajectory features (current, baseline and previous biomarker values, last visit gap, local slope, cumulative decline, best value, elapsed time and visit count), fits discrete-time interval hazards using optional logit-link Bayesian additive regression trees, a generalized linear model fallback, or a lightweight variational approximation, accumulates survival from the discrete-time product, and evaluates the interval-censored likelihood. Fitted models return landmark risk predictions over user-specified horizons with posterior or bootstrap uncertainty by evaluating survival ratios across fitted hazard draws. Utilities are provided for simulation, staged model fitting, plotting and summarising dynamic risk curves, IPCW Brier scores, cumulative/dynamic time-dependent area under the curve, calibration tables, and an anonymised chronic myeloid leukaemia molecular-monitoring example data set. |
| Authors: | Xulin Pan [aut, cre] (ORCID: <https://orcid.org/0000-0002-1072-2539>) |
| Maintainer: | Xulin Pan <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.2.0 |
| Built: | 2026-06-30 21:36:27 UTC |
| Source: | https://github.com/cran/uddbart |
IPCW estimator of the cumulative/dynamic time-dependent AUC for landmark dynamic predictions: among subjects at risk at the landmark, cases are those with an event within the horizon and controls are those event-free beyond it.
auc_td( pred, event, id = "patient_id", landmark_col = "landmark", ipcw = TRUE, eps_G = 0.001 )auc_td( pred, event, id = "patient_id", landmark_col = "landmark", ipcw = TRUE, eps_G = 0.001 )
pred |
A prediction data frame from |
event |
Observed outcomes with the id column and |
id |
Name of the patient identifier column. |
landmark_col |
Name of the landmark column in |
ipcw |
Logical; apply IPCW ( |
eps_G |
Lower clamp on the censoring-survival weights for numerical stability. |
A data frame with landmark, horizon, auc, n_cases and
n_controls.
brier_score(), calibration_table()
pred <- data.frame(patient_id = c("a", "b", "c"), landmark = 0, horizon = 12, risk = c(0.9, 0.2, 0.1)) event <- data.frame(patient_id = c("a", "b", "c"), R = c(6, 20, 30), C = c(6, 20, 30), delta = c(1, 1, 0)) auc_td(pred, event)pred <- data.frame(patient_id = c("a", "b", "c"), landmark = 0, horizon = 12, risk = c(0.9, 0.2, 0.1)) event <- data.frame(patient_id = c("a", "b", "c"), R = c(6, 20, 30), C = c(6, 20, 30), delta = c(1, 1, 0)) auc_td(pred, event)
Computes the time-dependent Brier score (and integrated Brier score) for landmark dynamic predictions, using inverse-probability-of-censoring weighting (IPCW) to account for right censoring (Graf et al., 1999).
brier_score( pred, event, id = "patient_id", landmark_col = "landmark", ipcw = TRUE, eps_G = 0.001 )brier_score( pred, event, id = "patient_id", landmark_col = "landmark", ipcw = TRUE, eps_G = 0.001 )
pred |
A prediction data frame from |
event |
Observed outcomes with the id column and |
id |
Name of the patient identifier column. |
landmark_col |
Name of the landmark column in |
ipcw |
Logical; apply IPCW ( |
eps_G |
Lower clamp on the censoring-survival weights for numerical stability. |
A data frame with one row per horizon: landmark, horizon,
brier, n (subjects at risk) and n_events (events within the
horizon). The attribute "IBS" holds the integrated Brier score
(trapezoidal average over the horizons).
Graf, E., Schmoor, C., Sauerbrei, W. and Schumacher, M. (1999). Assessment and comparison of prognostic classification schemes for survival data. Statistics in Medicine 18, 2529-2545.
auc_td(), calibration_table(), predict.uddbart()
pred <- data.frame(patient_id = c("a", "b", "c"), landmark = 0, horizon = 12, risk = c(0.9, 0.2, 0.1)) event <- data.frame(patient_id = c("a", "b", "c"), R = c(6, 20, 30), C = c(6, 20, 30), delta = c(1, 1, 0)) brier_score(pred, event)pred <- data.frame(patient_id = c("a", "b", "c"), landmark = 0, horizon = 12, risk = c(0.9, 0.2, 0.1)) event <- data.frame(patient_id = c("a", "b", "c"), R = c(6, 20, 30), C = c(6, 20, 30), delta = c(1, 1, 0)) brier_score(pred, event)
Groups subjects into bins of predicted risk and compares the mean predicted risk with the IPCW-estimated observed event probability within the horizon, for a single landmark and horizon.
calibration_table( pred, event, horizon, id = "patient_id", landmark_col = "landmark", groups = 5, eps_G = 0.001 )calibration_table( pred, event, horizon, id = "patient_id", landmark_col = "landmark", groups = 5, eps_G = 0.001 )
pred |
A prediction data frame from |
event |
Observed outcomes with the id column and |
horizon |
A single horizon at which to calibrate. |
id |
Name of the patient identifier column. |
landmark_col |
Name of the landmark column in |
groups |
Number of equal-count predicted-risk bins. |
eps_G |
Lower clamp on the censoring-survival weights for numerical stability. |
A data frame with one row per bin: bin, n, pred_mean
(mean predicted risk) and obs_rate (IPCW observed event probability).
pred <- data.frame(patient_id = letters[1:6], landmark = 0, horizon = 12, risk = c(0.9, 0.8, 0.5, 0.4, 0.2, 0.1)) event <- data.frame(patient_id = letters[1:6], R = c(6, 8, 20, 9, 30, 40), C = c(6, 8, 20, 9, 30, 40), delta = c(1, 1, 0, 1, 0, 0)) calibration_table(pred, event, horizon = 12, groups = 2)pred <- data.frame(patient_id = letters[1:6], landmark = 0, horizon = 12, risk = c(0.9, 0.8, 0.5, 0.4, 0.2, 0.1)) event <- data.frame(patient_id = letters[1:6], R = c(6, 8, 20, 9, 30, 40), C = c(6, 8, 20, 9, 30, 40), delta = c(1, 1, 0, 1, 0, 0)) calibration_table(pred, event, horizon = 12, groups = 2)
Anonymised BCR-ABL monitoring data for 84 imatinib-treated chronic myeloid
leukaemia (CML) patients, formatted for uddbart(). The event of interest is
time to deep molecular response (MR4.5). Provided as two linked tables.
cml_long cml_eventcml_long cml_event
cml_longLong-format biomarker monitoring data (469 rows): one row
per patient-visit, with patient_id, t_months (months since imatinib
start) and log_mrd (observed log molecular residual disease).
cml_eventPatient-level interval-censoring data (84 rows): one row
per patient, with patient_id, L and R (the visit times bracketing
the first observed MR4.5; the event time lies in ), C (the
right-censoring time) and delta (1 = MR4.5 observed, 0 = censored).
67 patients reach MR4.5; 17 are censored.
Anonymised CML molecular-monitoring cohort (2026).
Accumulates the discrete-time survival function
from per-interval
hazards, per patient, respecting interval order.
compute_survival_from_hazard(hazard, risk, id = "patient_id", level = 0.95)compute_survival_from_hazard(hazard, risk, id = "patient_id", level = 0.95)
hazard |
Either a numeric vector of length |
risk |
A risk set (from |
id |
Name of the patient identifier column. |
level |
Width of the equal-tailed credible interval for the tidy
summary (used only when |
A list with:
surv_drawsmatrix (draws x intervals) of aligned
to the rows of risk (a single-row matrix if hazard is a vector).
summarya tidy data frame with the id, interval, t_end,
hazard, surv (posterior mean), and, for draws, surv_lower /
surv_upper.
fit_bart_hazard(), interval_survival_likelihood()
sim <- simulate_uddbart_data(n = 20, seed = 1) prep <- prepare_uddbart_data(sim$long, sim$event) ## toy hazards for illustration h <- rep(0.1, nrow(prep$risk)) S <- compute_survival_from_hazard(h, prep$risk) head(S$summary)sim <- simulate_uddbart_data(n = 20, seed = 1) prep <- prepare_uddbart_data(sim$long, sim$event) ## toy hazards for illustration h <- rep(0.1, nrow(prep$risk)) S <- compute_survival_from_hazard(h, prep$risk) head(S$summary)
Builds the engineered latent-state feature matrix used by the
BART hazard. For each row of a prepared interval risk set, the biomarker
history available at the start of the interval (t_start, i.e.
) is summarised into the nine features of the
U-DDBART-IC version 0.1 latent state:
current biomarker , baseline , previous
, last visit gap , slope,
cumulative decline, best response, treatment duration
treattime, and number of visits nvisit.
construct_latent_state( long, risk, id = "patient_id", time = "t_months", marker = "log_mrd" )construct_latent_state( long, risk, id = "patient_id", time = "t_months", marker = "log_mrd" )
long |
Long-format biomarker data, one row per patient-visit. |
risk |
A prepared interval risk set (from
|
id |
Name of the patient identifier column (in both |
time |
Name of the visit-time column in |
marker |
Name of the biomarker column in |
The history for interval is all visits with
, so the latent state uses only information
available at the start of the interval. This makes the same feature
construction valid for dynamic prediction, where future biomarkers are
unknown.
A numeric matrix with one row per row of risk and nine named
columns: x_cur, x_base, x_prev, dt, slope, decline, best,
treattime, nvisit.
prepare_uddbart_data(), fit_bart_hazard()
sim <- simulate_uddbart_data(n = 30, seed = 1) prep <- prepare_uddbart_data(sim$long, sim$event) Z <- construct_latent_state(sim$long, prep$risk) head(Z)sim <- simulate_uddbart_data(n = 30, seed = 1) prep <- prepare_uddbart_data(sim$long, sim$event) Z <- construct_latent_state(sim$long, prep$risk) head(Z)
Fits the discrete-time interval hazard
. If the optional
BART package is installed, a logit-link BART model is used; otherwise
the function falls back to a binomial glm.
fit_bart_hazard( Z, grid_time, y, ntree = 200L, ndpost = 1000L, nskip = 250L, keepevery = 1L, sparse = FALSE, seed = NULL, verbose = FALSE )fit_bart_hazard( Z, grid_time, y, ntree = 200L, ndpost = 1000L, nskip = 250L, keepevery = 1L, sparse = FALSE, seed = NULL, verbose = FALSE )
Z |
Latent-state design matrix from |
grid_time |
Numeric vector of interval end times |
y |
Integer 0/1 event indicator, aligned to the rows of |
ntree, ndpost, nskip, keepevery
|
BART hyper-parameters used when the
optional |
sparse |
Logical; use the sparse Dirichlet variable-selection prior when
using |
seed |
Optional integer seed. |
verbose |
Logical; print BART progress when using |
A list of class "uddbart_hazard" with the fitted model, backend method,
training design, and design-matrix column names xnames.
uddbart, compute_survival_from_hazard
sim <- simulate_uddbart_data(n = 40, seed = 1) prep <- prepare_uddbart_data(sim$long, sim$event) Z <- construct_latent_state(sim$long, prep$risk) h <- fit_bart_hazard(Z, prep$risk$t_end, prep$risk$y, ntree = 20, ndpost = 50, nskip = 25, seed = 1)sim <- simulate_uddbart_data(n = 40, seed = 1) prep <- prepare_uddbart_data(sim$long, sim$event) Z <- construct_latent_state(sim$long, prep$risk) h <- fit_bart_hazard(Z, prep$risk$t_end, prep$risk$y, ntree = 20, ndpost = 50, nskip = 25, seed = 1)
Fits a lightweight Gaussian variational approximation to the logistic
discrete-time hazard coefficients using the same latent-state design as
fit_bart_hazard. This backend requires only base R and
stats.
fit_uddbart_vi( Z, grid_time, y, prior_sd = 2.5, max_iter = 100L, tol = 1e-06, ndraw = 1000L, seed = NULL, verbose = FALSE )fit_uddbart_vi( Z, grid_time, y, prior_sd = 2.5, max_iter = 100L, tol = 1e-06, ndraw = 1000L, seed = NULL, verbose = FALSE )
Z |
Latent-state design matrix from |
grid_time |
Numeric vector of interval end times, aligned to rows of
|
y |
Integer 0/1 event indicator, aligned to rows of |
prior_sd |
Prior standard deviation for non-intercept coefficients. |
max_iter |
Maximum Newton/variational optimization iterations. |
tol |
Convergence tolerance. |
ndraw |
Number of coefficient draws from the variational approximation. |
seed |
Optional integer seed. |
verbose |
Logical; currently reserved for future progress output. |
A list of class c("uddbart_vi", "uddbart_hazard") containing the
variational coefficient mean, covariance, coefficient draws, hazard draws, and
training design.
sim <- simulate_uddbart_data(n = 20, seed = 1) prep <- prepare_uddbart_data(sim$long, sim$event) Z <- construct_latent_state(sim$long, prep$risk) h <- fit_uddbart_vi(Z, prep$risk$t_end, prep$risk$y, ndraw = 20, seed = 1) h$methodsim <- simulate_uddbart_data(n = 20, seed = 1) prep <- prepare_uddbart_data(sim$long, sim$event) Z <- construct_latent_state(sim$long, prep$risk) h <- fit_uddbart_vi(Z, prep$risk$t_end, prep$risk$y, ndraw = 20, seed = 1) h$method
Evaluates the U-DDBART-IC interval-censored likelihood contributions
given a per-patient discrete-time survival function. Survival is treated as a right-continuous grouped step function that changes only at the grid points, evaluated by last-value-carried-forward.
interval_survival_likelihood( surv_summary, event, id = "patient_id", eps = 1e-12 )interval_survival_likelihood( surv_summary, event, id = "patient_id", eps = 1e-12 )
surv_summary |
The |
event |
Per-patient endpoints with the id column and |
id |
Name of the patient identifier column. |
eps |
Lower clamp applied to each likelihood contribution before taking
logs, to avoid |
A list with per_patient (a data frame with the id, lik and
loglik) and loglik (the total observed-data log-likelihood). The
plug-in survival in surv_summary (posterior mean) is used.
compute_survival_from_hazard(), uddbart()
sim <- simulate_uddbart_data(n = 20, seed = 1) prep <- prepare_uddbart_data(sim$long, sim$event) S <- compute_survival_from_hazard(rep(0.1, nrow(prep$risk)), prep$risk) ll <- interval_survival_likelihood(S$summary, prep$event) ll$logliksim <- simulate_uddbart_data(n = 20, seed = 1) prep <- prepare_uddbart_data(sim$long, sim$event) S <- compute_survival_from_hazard(rep(0.1, nrow(prep$risk)), prep$risk) ll <- interval_survival_likelihood(S$summary, prep$event) ll$loglik
Builds the discrete-time grid on which the
interval hazard is defined.
make_followup_grid(by = 3, max_time = 60, breaks = NULL)make_followup_grid(by = 3, max_time = 60, breaks = NULL)
by |
Grid spacing (e.g. |
max_time |
The largest grid time |
breaks |
Optional explicit, increasing vector of grid times beginning at
|
A numeric vector of grid breakpoints starting at 0.
make_followup_grid(by = 3, max_time = 24)make_followup_grid(by = 3, max_time = 24)
Plots the dynamic risk (or survival ratio) as a function
of the horizon, one curve per (patient, landmark) prediction, with a shaded
posterior credible band.
## S3 method for class 'uddbart' plot( x, pred, what = c("risk", "survival"), landmark = "landmark", add = FALSE, ... )## S3 method for class 'uddbart' plot( x, pred, what = c("risk", "survival"), landmark = "landmark", add = FALSE, ... )
x |
A |
pred |
A data frame from |
what |
|
landmark |
Name of the landmark column used in |
add |
Logical; add to an existing plot. |
... |
Further graphical parameters passed to |
pred, invisibly.
Computes the dynamic prediction target
conditional on each patient's biomarker history up to a landmark time .
## S3 method for class 'uddbart' predict( object, long, newdata, horizon, landmark = "landmark", level = 0.95, ... )## S3 method for class 'uddbart' predict( object, long, newdata, horizon, landmark = "landmark", level = 0.95, ... )
object |
A fitted |
long |
Long-format biomarker data for the patients to predict (same columns as used in fitting). Histories are taken up to the landmark. |
newdata |
A data frame with one row per prediction, containing the patient id column and a landmark-time column. |
horizon |
Numeric vector of prediction horizons |
landmark |
Name of the landmark-time column in |
level |
Width of the equal-tailed posterior credible interval. |
... |
Unused; for S3 compatibility. |
The latent state for grid interval is built
from the history up to , freezing the biomarker
trajectory at the landmark for future intervals (no biomarkers are assumed
after ). Survival is accumulated from the posterior hazard draws and
the ratio is formed draw by draw, so the reported
credible interval carries full posterior uncertainty.
A data frame with one row per (prediction, horizon): the patient id,
landmark, horizon, risk (posterior-mean ),
risk_lower, risk_upper, and survival ().
sim <- simulate_uddbart_data(n = 40, seed = 1) fit <- uddbart(sim$long, sim$event, grid_by = 3, ntree = 20, ndpost = 50, nskip = 25, seed = 1) nd <- data.frame(patient_id = sim$event$patient_id[1:3], landmark = 12) predict(fit, sim$long, nd, horizon = c(6, 12, 24))sim <- simulate_uddbart_data(n = 40, seed = 1) fit <- uddbart(sim$long, sim$event, grid_by = 3, ntree = 20, ndpost = 50, nskip = 25, seed = 1) nd <- data.frame(patient_id = sim$event$patient_id[1:3], landmark = 12) predict(fit, sim$long, nd, horizon = c(6, 12, 24))
Converts longitudinal biomarker data and patient-level interval-censored
event information into the discrete-time interval ("risk set") representation
used by uddbart(). Each patient contributes one row per grid interval in
which they are at risk, with a binary indicator y equal to 1 for the
interval in which the event is observed.
prepare_uddbart_data( long, event, id = "patient_id", L = "L", R = "R", C = "C", delta = "delta", grid = NULL, grid_by = 3 )prepare_uddbart_data( long, event, id = "patient_id", L = "L", R = "R", C = "C", delta = "delta", grid = NULL, grid_by = 3 )
long |
Long-format biomarker data, one row per patient-visit (used only
to determine each patient's id; the biomarker values are summarised later
by |
event |
A patient-level data frame with the id column and the
interval-censoring endpoints. For an observed event the event time lies in
|
id |
Name of the patient identifier column. |
L, R
|
Names of the left and right interval-endpoint columns in |
C |
Name of the right-censoring time column in |
delta |
Name of the 0/1 event-indicator column in |
grid |
A grid from |
grid_by |
Grid spacing used when |
A patient is at risk in interval while
. For an event patient (delta = 1),
y = 1 in the interval containing (the first grid interval with
) and y = 0 earlier. Right-censored patients have
y = 0 throughout. This is the standard discrete-time (grouped) survival
encoding whose Bernoulli factorisation matches the interval-censored
likelihood evaluated on the grid.
A list with elements:
riskthe interval risk set: one row per at-risk grid interval
with columns patient_id (the id), interval (k), t_start
(), t_end () and y (event indicator).
gridthe grid used.
eventthe per-patient endpoints used, with a resolved
obs_time (R for events, C for censored).
make_followup_grid(), construct_latent_state(), uddbart()
sim <- simulate_uddbart_data(n = 20, seed = 1) prep <- prepare_uddbart_data(sim$long, sim$event) head(prep$risk)sim <- simulate_uddbart_data(n = 20, seed = 1) prep <- prepare_uddbart_data(sim$long, sim$event) head(prep$risk)
Generates synthetic U-DDBART-IC data: each patient has a latent linear
log-biomarker trajectory , observed with
measurement error at irregular visit times. The event (reaching deep
molecular response, MR4.5) occurs when the latent trajectory first crosses a
threshold; because the biomarker is only measured at visits, the event time
is interval-censored between the last visit below threshold () and
the first visit at or beyond it (). Patients whose trajectory never
crosses within follow-up are right-censored at .
simulate_uddbart_data( n = 200, grid_by = 3, max_followup = 60, min_followup = 24, visit_jitter = 0.25, threshold = -4.5, b0_mean = 0.7, b0_sd = 0.6, slope_mean = -0.1, slope_sd = 0.06, sigma = 0.3, seed = NULL )simulate_uddbart_data( n = 200, grid_by = 3, max_followup = 60, min_followup = 24, visit_jitter = 0.25, threshold = -4.5, b0_mean = 0.7, b0_sd = 0.6, slope_mean = -0.1, slope_sd = 0.06, sigma = 0.3, seed = NULL )
n |
Number of patients. |
grid_by |
Nominal spacing between scheduled visits (months). |
max_followup |
Maximum administrative follow-up time (months); each
patient's censoring time is drawn between |
min_followup |
Minimum administrative follow-up time (months). |
visit_jitter |
SD of multiplicative timing noise on visit times. |
threshold |
Latent log-biomarker threshold defining the event
(e.g. |
b0_mean, b0_sd
|
Mean and SD of the patient baseline |
slope_mean, slope_sd
|
Mean and SD of the patient slope |
sigma |
Measurement-error SD of the observed biomarker. |
seed |
Optional integer seed. |
A list with:
longlong-format biomarker data: patient_id, t_months,
log_mrd, and the noise-free latent value.
eventper-patient interval-censoring data: patient_id, L,
R, C, delta, and the true crossing time true_T.
paramsper-patient true b0, b1, and the generative settings.
prepare_uddbart_data(), uddbart()
sim <- simulate_uddbart_data(n = 50, seed = 1) str(sim$event)sim <- simulate_uddbart_data(n = 50, seed = 1) str(sim$event)
Summarise a U-DDBART-IC fit
## S3 method for class 'uddbart' summary(object, ...) ## S3 method for class 'summary.uddbart' print(x, ...)## S3 method for class 'uddbart' summary(object, ...) ## S3 method for class 'summary.uddbart' print(x, ...)
object |
A fitted |
... |
Unused. |
x |
A |
An object of class "summary.uddbart" with fit metadata and
quantiles of the in-sample interval hazard.
End-to-end fit of the U-DDBART-IC pipeline: prepare the interval-censored risk set on a discrete grid, build the engineered latent state, fit the logit-link interval hazard, accumulate the discrete-time survival and evaluate the interval-censored likelihood. The interval hazard can be fitted with optional BART, a glm fallback, or the lightweight UDDBART-VI backend.
uddbart( long, event, id = "patient_id", time = "t_months", marker = "log_mrd", L = "L", R = "R", C = "C", delta = "delta", grid = NULL, grid_by = 3, engine = c("bart", "vi"), ntree = 200L, ndpost = 1000L, nskip = 250L, keepevery = 1L, sparse = FALSE, vi_prior_sd = 2.5, vi_max_iter = 100L, vi_tol = 1e-06, seed = NULL, verbose = FALSE ) ## S3 method for class 'uddbart' print(x, ...)uddbart( long, event, id = "patient_id", time = "t_months", marker = "log_mrd", L = "L", R = "R", C = "C", delta = "delta", grid = NULL, grid_by = 3, engine = c("bart", "vi"), ntree = 200L, ndpost = 1000L, nskip = 250L, keepevery = 1L, sparse = FALSE, vi_prior_sd = 2.5, vi_max_iter = 100L, vi_tol = 1e-06, seed = NULL, verbose = FALSE ) ## S3 method for class 'uddbart' print(x, ...)
long |
Long-format biomarker data, one row per patient-visit. |
event |
Patient-level interval-censoring data with the id column and
|
id, time, marker
|
Column names for the patient id, visit time and
biomarker in |
L, R, C, delta
|
Column names of the interval-censoring endpoints and the
event indicator in |
grid |
Optional grid from |
grid_by |
Grid spacing (months) used when |
engine |
Hazard backend. |
ntree, ndpost, nskip, keepevery, sparse
|
BART hyper-parameters passed to
|
vi_prior_sd, vi_max_iter, vi_tol
|
UDDBART-VI controls used when
|
seed |
Optional integer seed. |
verbose |
Logical; print progress. |
x |
A |
... |
Further arguments (ignored). |
An object of class "uddbart" containing the fitted hazard model,
the risk set, the grid, in-sample survival surv, the
interval-censored log-likelihood loglik, the per-patient event
endpoints, column-name metadata, and the call.
predict.uddbart, simulate_uddbart_data
sim <- simulate_uddbart_data(n = 40, seed = 1) fit <- uddbart(sim$long, sim$event, grid_by = 3, engine = "vi", ndpost = 50, seed = 1) fitsim <- simulate_uddbart_data(n = 40, seed = 1) fit <- uddbart(sim$long, sim$event, grid_by = 3, engine = "vi", ndpost = 50, seed = 1) fit