|
libena 0.4.18-dev.9021
QE C++ library
|
Generalized Means Rotation (GMR) with Lasso-based covariate adjustment. More...
#include <libqe/linalg_fallback.hpp>#include <libqe/lasso.hpp>#include "rotation.hpp"#include <armadillo>#include <stdexcept>#include <string>#include <vector>Go to the source code of this file.
Classes | |
| struct | qe::GMRStepResult |
| Result of one GMR axis step. More... | |
| struct | qe::GeneralizedRotationParams |
Parameters for generalized_means_rotation(). More... | |
Namespaces | |
| namespace | qe |
Functions | |
Between-group scatter | |
| arma::mat | qe::between_group_scatter (const arma::mat &V, const arma::uvec &labels, arma::uword n_groups) |
| Compute the between-group scatter matrix S_B. | |
Rotation direction | |
| arma::vec | qe::gmr_direction (const arma::mat &Vx, const arma::vec &target, bool categorical, arma::uword n_groups=0) |
| Compute the unit rotation direction from a covariate-adjusted contribution matrix. | |
GMR axis step | |
| GMRStepResult | qe::gmr_step (const arma::mat &V, const arma::mat &X_model, const arma::vec &target, const arma::uvec &x1_cols, bool categorical, arma::uword n_groups, const arma::uvec &subset, int n_lambda=50, int k_folds=5, double lasso_eps=0.01) |
| Compute the rotation direction for one axis of the Generalized Means Rotation. | |
Generalized Means Rotation | |
| RotationResult | qe::generalized_means_rotation (const arma::mat &V, const GeneralizedRotationParams ¶ms) |
| Full Generalized Means Rotation (GMR) producing a complete q×q rotation matrix. | |
Generalized Means Rotation (GMR) with Lasso-based covariate adjustment.
Mirrors rENA's ena.rotate.by.generalized() + gmr() + get_x1_main_effect(). Authoritative reference: commit 46776a1981a90b3a3b2861ed1010e9dbb7acf901 ("Fixed bugs in rotation functions") by Zhiqiang Cai.
Algorithm overview
lasso_x1_contribution).complete_rotation() to fill remaining dimensions from the SVD of the doubly-deflated space.Caller responsibilities
X_raw) from the data frame, including dummy variables for categorical predictors and any desired interaction terms. No formula parsing is done here.x1_cols: the 0-based column indices in X_raw that correspond to the target variable (these are unpenalized in the Lasso).x_target.x_n_groups to the number of distinct groups when x_categorical=true.The R wrapper (rENA::ena.rotate.by.generalized) handles these steps and calls libqe::generalized_means_rotation() with the prepared matrices.