-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Projection on affine space #331
Conversation
Solution of Ly = b(P) with backward substitution (tested)
backward substitution: WIP
Not fully tested
cargo add ndarray and modcholesky
A has single row
New version: 0.9.0 (unreleased)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to agree on the equations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want to change that gradient in the PR method. Otherwise, lgtm
I'm merging this now. This has been implemented in Rust, but we need to make this available via |
The method
Let$A\in\mathbb{R}^{m\times n}$ with ${\rm rank} A = m$ and $m \leq n$ (typically $m < n$ ). Let $b\in\mathbb{R}^m$ . The projection of a vector $x\in\mathbb{R}^n$ on the set $X = \{x: Ax = b\}$ is given by
$$\Pi_X(x) = \mathrm{argmin}_{z\in X} \frac{1}{2}\|x - z\|^2.$$
This is a convex QP with Lagrangian
$$L(z, \lambda) = \frac{1}{2}\|x-z\|^2 + \lambda^\intercal (Az-b),$$ $z$ and $\lambda$ are
$$\nabla_z L(z, \lambda) = x - z + A^\intercal \lambda$$
$$\nabla_\lambda L(z, \lambda) = Az - b.$$ $(z^\star, \lambda^\star)$ such that $\nabla_z L(z^\star, \lambda^\star) = 0$ and $\nabla_\lambda L(z^\star, \lambda^\star) = 0$ , that is,
and its gradients with respect to
and
We are looking for a pair
Multiplying the first equation by$A$ from the left and substituting $Az^\star = b$ we have
We can solve this linear equaltion by computing the Cholesky factorisation of$AA^\intercal$ , that is, $PAA^\intercal P^\intercal = LL^\intercal,$ where $L$ is a lower triangular matrix and $P$ is a permutation matrix. Having solved this for $\lambda^\star$ , we can compute
We can also write
Main Changes
Associated Issues
TODOs
CHANGELOG
(s)CHANGELOG
,Cargo.toml
andVERSION
)