Observation-level orthogonal PLQR scores at a supplied coefficient (experimental)
Source:R/user-dnn-plqr.R
plqr_score_matrix.RdComputes, for each observation \(i\), the orthogonal PLQR score
$$
\psi_{i}
\;=\;
(\tau - \mathbf{1}\{\,Y_{i} \le D_{i}^{\top}\theta + g_{0}(U_{i})\,\})\,
(D_{i} - m_{D}(U_{i})) \, ,
$$
from supplied nuisance columns. No weights are applied and no localization
is performed; plqr_dnn() aggregates these scores with DNN rank weights.
Arguments
- data
A
data.framecontaining the outcome, regressor, and nuisance columns.- y_col
Name or index of the outcome column in
data.- D_cols
Names or indices of partially linear regressor columns in
data.- g_col
Name or index of the shape-nuisance column in
dataholding the values of \(g_0(U)\).- mD_cols
Names or indices of nuisance columns for
m_D(U); must have the same length and order asD_cols.- theta
Numeric coefficient vector with length
length(D_cols).- tau
Quantile level in
(0,1).
Lifecycle
Experimental. PLQR functionality is outside the CATE and regression workflow focus of the initial public release. Its API and inference interfaces may change in later releases.
Examples
demo <- plqr_demo_data(n = 100, p = 2, p_d = 2, tau = 0.5, seed = 1)
scores <- plqr_score_matrix(
data = demo$data,
y_col = "Y",
D_cols = c("D1", "D2"),
g_col = "g_oracle",
mD_cols = c("mD1", "mD2"),
theta = demo$truth$theta_true,
tau = 0.5
)
head(scores)
#> D1 D2
#> [1,] 0.12282055 0.2681021
#> [2,] -0.50666199 0.3141894
#> [3,] 0.47597653 0.5914012
#> [4,] -0.09927234 -0.1150896
#> [5,] 0.68557066 -0.4962436
#> [6,] 0.74929848 0.4536638