Can be applied to Regression (external feature), time series (external + internal feature), casual models it is regression example.
A. categorized update
We need to categorized the update types which can be seen from below can be largely divided into three: predictor set, distributional family of both outcome and predictor, model structure (i.e. hierarchical model - most related to DAG),
U1. predictor update
U2. distributional family update
5. update(stan_glmp, family = neg_binomial_2)
6. y ~ sqrt_roach1 + treatment + senior + offset(log(exposure2)), zi ~ sqrt_roach1 + treatment + senior + offset(log(exposure2))), family=zero_inflated_negbinomial(),
U3. random effect (hierarchical model) update
7. y ~ sqrt_roach1 + treatment + senior + (1 | id)
# feature
1. simple <- outcome ~ rx
2. complex <- outcome ~ rx + site + gender + age + risk
# prior
3. complex_narrow: intercept_prior_loc = 3, intercept_prior_width = 0.5, predictor_prior_loc = c(-2, 2), predictor_prior_width = 0.5)
backend_indo_simple <- SBC_backend_glm(formula = formula_indo_simple, family = "binomial")
backend_indo_complex <- SBC_backend_glm(formula = formula_indo_complex, family = "binomial")
datasets_simple <- generate_datasets(SBC_generator_function(
generator_single_logistic,
formula = simple,
dataset = medicaldata::indo_rct),
n_datasets = 500)
# Model discrepancy metric
discrepancy <- function(A,B) {(compute_results(datasets_A, backend_B)$dist + compute_results(datasets_B,backend_A)$dist)/2}
simple-complex <- discrepancy(indo_simple, indo_complex)
simple-simple_narrow <- discrepancy(simple_narrow, simple)
complex-complex_narrow <- discrepancy(complex_narrow,complex)
## might need centering with self-discrepancy
complex-complex <- discrepancy(complex, complex)