Estimates the anchor transformation for the Anchor-Objective.
The anchor transformation is \(W = I-(1-\sqrt{\gamma}))\Pi_A\),
where \(\Pi_A = A(A^TA)^{-1}A^T\). For \(\gamma = 1\) this is just the identity.
For \(\gamma = 0\) this corresponds to residuals after orthogonal projecting onto A.
For large \(\gamma\) this is close to the orthogonal projection onto A, scaled by \(\gamma\).
The estimator \(\text{argmin}_f ||W(Y - f(X))||^2\) corresponds to the Anchor-Regression Estimator
Rothenhausler2021AnchorCausalitySDModels, Buhlmann2020InvarianceRobustnessSDModels.
Usage
get_W(A, gamma, intercept = FALSE, gpu = FALSE)
Value
W of class matrix, the anchor transformation matrix.
Arguments
A
Numerical Anchor of class matrix.
gamma
Strength of distributional robustness, \(\gamma \in [0, \infty]\).
intercept
Logical, whether to include an intercept in the anchor.
gpu
If TRUE, the calculations are performed on the GPU.
If it is properly set up.