Runs the Atom-Based Regression Model on simulated data
run_abrm(
gridx,
gridy,
atoms,
model_code,
true_params = NULL,
norm_idx_x = NULL,
pois_idx_x = NULL,
binom_idx_x = NULL,
norm_idx_y = NULL,
pois_idx_y = NULL,
binom_idx_y = NULL,
dist_y = 2,
niter = 50000,
nburnin = 30000,
nchains = 2,
thin = 10,
sim_metadata = NULL,
save_plots = TRUE,
output_dir = NULL
)List containing MCMC results and parameter estimates
The X-grid sf dataframe, containing a numeric area ID variable named 'ID' and covariates named 'covariate_x_1','covariate_x_2',...
The Y-grid sf dataframe, containing a numeric area ID variable named 'ID', covariates named 'covariate_y_1','covariate_y_2',...., and an outcome named 'y'.
The atom sf dataframe, which should contain numeric variables named 'ID_x' and 'ID_y' holding the X-grid and Y-grid cell IDs for each atom, as well as an atom-level population count named 'population'.
NIMBLE model code from get_abrm_model()
The true outcome model regression coefficient parameters, if known (e.g., from simulate_misaligned_data())
Vector of numeric indices of X-grid covariates (ordered as 'covariate_x_1','covariate_x_2',...) that should be treated as normally-distributed
Vector of numeric indices of X-grid covariates (ordered as 'covariate_x_1','covariate_x_2',...) that should be treated as Poisson-distributed
Vector of numeric indices of X-grid covariates (ordered as 'covariate_x_1','covariate_x_2',...) that should be treated as binomial-distributed
Vector of numeric indices of Y-grid covariates (ordered as 'covariate_y_1','covariate_y_2',...) that should be treated as normally-distributed
Vector of numeric indices of Y-grid covariates (ordered as 'covariate_y_1','covariate_y_2',...) that should be treated as Poisson-distributed
Vector of numeric indices of Y-grid covariates (ordered as 'covariate_y_1','covariate_y_2',...) that should be treated as binomial-distributed
Distribution type for outcome (1=normal, 2=poisson, 3=binomial)
Number of MCMC iterations (default: 50000)
Number of burn-in iterations (default: 30000)
Number of MCMC chains (default: 2)
Thinning interval (default: 10)
Optional simulation metadata list
Logical, whether to save diagnostic plots (default: TRUE)
Directory for saving outputs (default: NULL)