View source: R/transformations.R
get_Q | R Documentation |
Estimates the spectral transformation Q for spectral deconfounding by shrinking the leading singular values of the covariates.
get_Q(X, type, trim_quantile = 0.5, q_hat = 0, gpu = FALSE, scaling = TRUE)
X |
Numerical covariates of class |
type |
Type of deconfounding, one of 'trim', 'pca', 'no_deconfounding'. 'trim' corresponds to the Trim transform \insertCiteCevid2020SpectralModelsSDModels as implemented in the Doubly debiased lasso \insertCiteGuo2022DoublyConfoundingSDModels, 'pca' to the PCA transformation\insertCitePaul2008PreconditioningProblemsSDModels and 'no_deconfounding' to the Identity. |
trim_quantile |
Quantile for Trim transform, only needed for trim. |
q_hat |
Assumed confounding dimension, only needed for pca. |
gpu |
If |
scaling |
Whether X should be scaled before calculating the spectral transformation. |
Q of class matrix
, the spectral transformation matrix.
Markus Ulmer
set.seed(1)
X <- matrix(rnorm(50 * 20), nrow = 50)
Q_trim <- get_Q(X, 'trim')
Q_pca <- get_Q(X, 'pca', q_hat = 5)
Q_plain <- get_Q(X, 'no_deconfounding')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.