Ensures that coefficients of covariates which exhibit strong pairwise correlation have a coherent sign.
pairwise_sign_coherence(
rho = 0.8,
exclude = "(Intercept)",
big_m = 100,
eps = 1e-06,
use = c("everything", "all.obs", "complete.obs", "na.or.complete",
"pairwise.complete.obs"),
method = c("pearson", "kendall", "spearman")
)A holistic generalized model constraint, object inheriting from class "hglmc".
a value in the range [0,1] specifying the maximum allowed collinearity between pairs of covariates.
a character vector giving the names of the covariates to be excluded from the constraint (default is "(Intercept)").
a double giving the big-M parameter.
a double giving the epsilon for the equal sign constraint.
Since most numerical solvers can only handle constraints up to some epsilon,
e.g., the constraint \(A x \geq b\) is typically transformed to
\(|A x - b| \geq 0\). By providing an eps\( > 0\) and changing
the constraint to \(|A x - b| \geq\) eps we can ensure \(|A x - b| > 0\).
an optional character string giving a method for computing
covariances in the presence of missing values.
The parameter is passed to cor,
therefore see cor for more information.
a character string indicating which correlation coefficient
is to be computed.
The parameter is passed to cor,
therefore see cor for more information.
Carrizosa, E., Olivares-Nadal, A. V., & Ramírez-Cobo, P. (2020). Integer Constraints for Enhancing Interpretability in Linear Regression. SORT. Statistics and Operations Research Transactions, 44: 67-98. tools:::Rd_expr_doi("10.2436/20.8080.02.95").
Other Constraint-Constructors:
group_equal(),
group_inout(),
group_sparsity(),
include(),
k_max(),
linear(),
lower(),
rho_max(),
sign_coherence(),
upper()
constraints <- c(k_max(7), pairwise_sign_coherence())
Run the code above in your browser using DataLab