| .lagrangian_project | R Documentation |
Given unconstrained (or GEE-initialized) coefficient estimates
\hat{\boldsymbol{\beta}}, computes the constrained estimate
\tilde{\boldsymbol{\beta}} = \mathbf{U}\hat{\boldsymbol{\beta}}
where \mathbf{U} = \mathbf{I} - \mathbf{G}\mathbf{A}
(\mathbf{A}^{\top}\mathbf{G}\mathbf{A})^{-1}\mathbf{A}^{\top}.
.lagrangian_project(
GhalfXy,
Ghalf,
A,
K,
p_expansions,
R_constraints,
constraint_value_vectors,
family,
parallel_aga,
parallel_matmult,
cl,
chunk_size,
num_chunks,
rem_chunks,
parallel_qr = FALSE
)
GhalfXy |
Numeric column vector |
Ghalf |
List of |
A |
Constraint matrix |
K |
Integer; number of interior knots. |
p_expansions |
Integer; number of basis terms per partition. |
R_constraints |
Integer; number of columns of |
constraint_value_vectors |
List of constraint right-hand-side
vectors encoding |
family |
GLM family object (used for |
parallel_aga, parallel_matmult, parallel_qr |
Logical flags for parallel computation. |
cl |
Parallel cluster object. |
chunk_size, num_chunks, rem_chunks |
Parallel distribution parameters. |
Rather than forming \mathbf{U} directly, the projection is
reformulated as a residual from an OLS problem (the
\mathbf{G}^{1/2}\mathbf{r}^* trick):
\mathbf{y}^* = \mathbf{G}^{-1/2}\hat{\boldsymbol{\beta}}
\mathbf{X}^* = \mathbf{G}^{1/2}\mathbf{A}
\mathbf{r}^* = (\mathbf{I} - \mathbf{X}^*(\mathbf{X}^{*\top}
\mathbf{X}^*)^{-1}\mathbf{X}^{*\top})\mathbf{y}^*
\tilde{\boldsymbol{\beta}} = \mathbf{G}^{1/2}\mathbf{r}^*
This avoids explicitly forming and inverting
\mathbf{A}^{\top}\mathbf{G}\mathbf{A}; the most expensive step is
the QR decomposition of the R \times R system inside
.lm.fit, which is far cheaper than the full P \times P
solve.
A list of length K+1, each element a column vector of
constrained coefficients \tilde{\boldsymbol{\beta}}_k.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.