# \donttest{
gaussian_data <- data.frame(
X1 = stats::rnorm(10),
X2 = stats::rnorm(10),
Y = stats::rnorm(10)
)
cat_init <- cat_glm_initialization(
formula = Y ~ 1, # formula for simple model
data = gaussian_data,
syn_size = 100, # Synthetic data size
custom_variance = NULL, # User customized variance value
gaussian_known_variance = FALSE, # Indicating whether the data variance is unknown
x_degree = c(1, 1), # Degrees for polynomial expansion of predictors
resample_only = FALSE, # Whether to perform resampling only
na_replace = stats::na.omit # How to handle NA values in data
)
cat_model <- cat_glm_bayes_joint(
formula = ~.,
cat_init = cat_init, # Only accept object generated from `cat_glm_initialization`
chains = 1, # Number of Markov chains to be run in the RStan sampling
iter = 10, # Number of iterations per chain in the RStan sampling
warmup = 5, # Number of warm-up (or burn-in) iterations for each chain
algorithm = "NUTS", # Sampling algorithm to use in \code{rstan::sampling}
tau_alpha = 1, # Shape parameter of the prior for tau
tau_gamma = 2, # Scale parameter of the prior for tau
binomial_tau_lower = 0.05, # Lower bound for tau in Binomial models.
binomial_joint_theta = FALSE, # Indicator for using joint theta for Binomial models
binomial_joint_alpha = FALSE, # Indicator for using oint alpha for Binomial models
gaussian_variance_alpha = 1, # The shape parameter for the inverse-gamma prior for variance
gaussian_variance_beta = 2 # The scale parameter for the inverse-gamma prior for variance
)
cat_model
# }
Run the code above in your browser using DataLab