# Nearest singular matrix

Let the SVD of $A \in \mathbb R^{{n}*{n}}$ be given as $A=\sum_{i=0}^n \sigma_{i}u_{i}v_{i}^{T}$ where $\sigma_{1}\gt \sigma_{2}>{...}>\sigma_{n-1}=\sigma_{n}>0$

Compute a matrix $B$ such that $B$ is the nearest singular matrix to $A$ in $2-norm$ and rank of $(A-B)=3$.

Here by nearest singular matrix we mean that the matrix $B$ will be of rank $n-1$, But how to form such a matrix $B$, such that the rank of $(A-B)=3$?

Please can anyone help me to solve the prblem??

Hint: Suppose, $B = \sum_{i=1}^{n-3}\sigma_{i}u_iv_i^T + 0u_{n-2}v_{n-2}^{T} + 0u_{n-1}v_{n-1}^{T} +0u_{n}v_{n}^{T}$, then $A - B = \sum_{i=n-2}^{n}\sigma_iu_iv_i^{T}.$ Thus, rank of $A-B = 3$.
Useful theorem: Let $k < n$, where $n$ is the rank of $A$ as specified in the question and $A_k =\sum_{i=1}^{k}\sigma_iu_iv_i^T$ then $min_{rank(B)=k}\|A − B\|_2 = \|A − A_k\|_2 = σ_{k+1}$.
• Here rank of $(A-B)$ is $3$, but the problem is I want the nearest singular matrix which will be of rank $n-1$, but here $B$ is of rank $n-3$. – adember Apr 29 '16 at 16:58
• Suppose, $B = \sum_{i=1}^{n-3}\sigma_{i}u_iv_i^T + 0u_{n-2}v_{n-2}^{T} + 0.5\sigma_{n-1}u_{n-1}v_{n-1}^{T} +0.5\sigma_nu_{n}v_{n}^{T}$. Then $A-B$ is rank $3$ and $B$ is rank $n-1$. – minion Apr 29 '16 at 17:06