Internal helper to compute $$D = Var_p\left( \sum_{j \in s_p} d_j p_j x_j \right)$$ from an existing survey design object created by survey::svydesign() or survey::svrepdesign().
compute_D_ALP(sp_des, p_sp, Xp)A `p x p` covariance matrix `D`.
A survey design object of class `"survey.design2"` or `"svyrep.design"`.
Numeric vector of estimated participation probabilities for the probability sample. Length must equal the number of rows in `sp_des$variables`.
Numeric matrix of dimension `n_p x p`. Each row is the covariate vector `x_j` used in the ALP estimating equation.
In the ALP method, the probability sample contribution in the estimating equation is \(p_j d_j x_j\), so the design-based covariance matrix is obtained by treating \(h_j = p_j x_j\) as the survey total variable.