cat_glm | R Documentation |
Fits a Catalytic Generalized Linear Models (GLMs) by using observed and synthetic data.
cat_glm(formula, cat_init, tau = NULL)
formula |
A formula specifying the GLMs. Should at least include response variables (e.g. |
cat_init |
A list generated from |
tau |
Optional numeric scalar controlling the weight of the synthetic data in the coefficient estimation. Defaults to the number of predictors / 4 for Gaussian models or the number of predictors otherwise. |
A list containing the values of all the arguments and the following components:
coefficients |
Estimated coefficient vector. |
model |
Fitted GLMs object ( |
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 = TRUE, # Indicating whether the data variance is known
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(
formula = ~.,
cat_init = cat_init, # Only accept object generated from `cat_glm_initialization`
tau = 1 # Weight for synthetic data
)
cat_model
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.