get_stan_model: Generate Stan Model Based on Specified Parameters

get_stan_modelR Documentation

Generate Stan Model Based on Specified Parameters

Description

This function retrieves a Stan model file based on a combination of input parameters, constructs the file path, and loads the Stan model.

Usage

get_stan_model(
  type = c("glm", "cox"),
  glm_family_string = c("gaussian", "binomial"),
  joint_tau = FALSE,
  glm_binomial_joint_theta = FALSE,
  glm_binomial_joint_alpha = FALSE,
  glm_gaussian_known_variance = FALSE
)

Arguments

type

Character, either "glm" or "cox", specifying the type of model to load.

glm_family_string

Character, specifying the family for GLM models, either "binomial" or "gaussian". Required for "glm" models, ignored for "cox" models.

joint_tau

Logical, if TRUE, includes "joint" in the file name to indicate a joint model with tau parameter.

glm_binomial_joint_theta

Logical, if TRUE and glm_family_string is "binomial", includes "theta" in the file name for joint theta parameter.

glm_binomial_joint_alpha

Logical, if TRUE and glm_family_string is "binomial", includes "alpha" in the file name for joint alpha parameter.

glm_gaussian_known_variance

Logical, if TRUE and glm_family_string is "gaussian", includes "known_variance" in the file name to specify known variance.

Value

A compiled Stan model loaded by rstan::stan_model.


catalytic documentation built on April 4, 2025, 5:51 a.m.