|
| 1 | +\documentclass[crop,tikz]{standalone} |
| 2 | + |
| 3 | +\usepackage[utf8]{inputenc} |
| 4 | +\usepackage{fouriernc} |
| 5 | +\usepackage[T1]{fontenc} |
| 6 | +\usepackage{bm} |
| 7 | +\usepackage{amsmath} |
| 8 | +\usepackage{nicefrac} |
| 9 | +\usepackage{trfsigns} |
| 10 | +\usepackage{xcolor} |
| 11 | +\usetikzlibrary{arrows.meta} |
| 12 | + |
| 13 | +%matplotlib colors: |
| 14 | +\definecolor{C0}{HTML}{1f77b4} |
| 15 | +\definecolor{C1}{HTML}{ff7f0e} |
| 16 | +\definecolor{C2}{HTML}{2ca02c} |
| 17 | +\definecolor{C3}{HTML}{d62728} |
| 18 | +\definecolor{C4}{HTML}{9467bd} |
| 19 | +\definecolor{C5}{HTML}{8c564b} |
| 20 | +\definecolor{C6}{HTML}{e377c2} |
| 21 | +\definecolor{C7}{HTML}{7f7f7f} |
| 22 | +\definecolor{C8}{HTML}{bcbd22} |
| 23 | +\definecolor{C9}{HTML}{17becf} |
| 24 | + |
| 25 | +\begin{document} |
| 26 | +\begin{tikzpicture} |
| 27 | + |
| 28 | +\coordinate (u_space) at (+4,0); |
| 29 | +\coordinate (v_space) at (-4,0); |
| 30 | +\def\lengthrect{4}; |
| 31 | +\def\lengthvec{3}; |
| 32 | + |
| 33 | +\path (0,0) +(90:\lengthvec+2) coordinate (T); |
| 34 | +\draw (T) node[above]{Inverse Problem with SVD of $\bm{A}$}; |
| 35 | + |
| 36 | +\path (0,0) +(90:\lengthvec+1) coordinate (G); |
| 37 | +\draw (G) node[above]{$\bm{A}^+_{N \times M} = \bm{V}_{N \times N} \bm{\Sigma}^+_{N \times M} \bm{U}_{M \times M}^\mathrm{H}$}; |
| 38 | + |
| 39 | +\draw[draw=black, rotate around={45:(u_space)}, C0] (u_space) rectangle ++(\lengthrect,\lengthrect); |
| 40 | +\draw[draw=black, rotate around={225:(u_space)}, C4] (u_space) rectangle ++(\lengthrect,\lengthrect); |
| 41 | + |
| 42 | +\draw[draw=black, rotate around={45:(v_space)}, C2] (v_space) rectangle ++(\lengthrect,\lengthrect); |
| 43 | +\draw[draw=black, rotate around={225:(v_space)}, C1] (v_space) rectangle ++(\lengthrect,\lengthrect); |
| 44 | + |
| 45 | +%zero vectors |
| 46 | +\draw[fill] (u_space) circle (2pt) node[right]{$\bm{0}_{M \times 1}$}; |
| 47 | +\draw[fill] (v_space) circle (2pt) node[left]{$\bm{0}_{N \times 1}$}; |
| 48 | + |
| 49 | +% U space stuff: |
| 50 | +\path (u_space) +(135:\lengthvec) coordinate (u1); |
| 51 | +\draw[-{Latex[length=3mm]}, C0, thick] (u_space) -- (u1) node[left]{$\bm{u}_1$}; |
| 52 | + |
| 53 | +\path (u_space) +(45:\lengthvec) coordinate (ur); |
| 54 | +\draw[-{Latex[length=3mm]}, C0, thick] (u_space) -- (ur) node[right]{$\bm{u}_R$}; |
| 55 | + |
| 56 | +\path (u_space) +(225:\lengthvec) coordinate (ur1); |
| 57 | +\draw[-{Latex[length=3mm]}, C4, thick] (u_space) -- (ur1) node[left]{$\bm{u}_{R+1}$}; |
| 58 | + |
| 59 | +\path (u_space) +(315:\lengthvec) coordinate (um); |
| 60 | +\draw[-{Latex[length=3mm]}, C4, thick] (u_space) -- (um) node[right]{$\bm{u}_{M}$}; |
| 61 | + |
| 62 | +\path (u_space) +(90:\lengthvec) coordinate (col_space); |
| 63 | +\draw (col_space) node[above]{column space: $\text{Range}(\bm{A})$}; |
| 64 | + |
| 65 | +\path (u_space) +(90:\lengthvec-1) coordinate (col_space_dim); |
| 66 | +\draw (col_space_dim) node[above]{dim: $R$ = rank$(\bm{A})$}; |
| 67 | + |
| 68 | +\path (u_space) +(270:\lengthvec) coordinate (left_null_space); |
| 69 | +\draw (left_null_space) node[above]{left null space: $\text{Null}(\bm{A}^\mathrm{H})$}; |
| 70 | + |
| 71 | +\path (u_space) +(270:\lengthvec+1) coordinate (left_null_space_dim); |
| 72 | +\draw (left_null_space_dim) node[above]{dim: $M-R$}; |
| 73 | + |
| 74 | +% V space stuff: |
| 75 | +\path (v_space) +(45:\lengthvec) coordinate (v1); |
| 76 | +\draw[-{Latex[length=3mm]}, C2, thick] (v_space) -- (v1) node[left]{$\bm{v}_1$}; |
| 77 | + |
| 78 | +\path (v_space) +(135:\lengthvec) coordinate (vr); |
| 79 | +\draw[-{Latex[length=3mm]}, C2, thick] (v_space) -- (vr) node[left]{$\bm{v}_R$}; |
| 80 | + |
| 81 | +\path (v_space) +(315:\lengthvec) coordinate (vr1); |
| 82 | +\draw[-{Latex[length=3mm]}, C1, thick] (v_space) -- (vr1) node[right]{$\bm{v}_{R+1}$}; |
| 83 | + |
| 84 | +\path (v_space) +(225:\lengthvec) coordinate (vn); |
| 85 | +\draw[-{Latex[length=3mm]}, C1, thick] (v_space) -- (vn) node[left]{$\bm{v}_{N}$}; |
| 86 | + |
| 87 | +\path (v_space) +(90:\lengthvec) coordinate (row_space); |
| 88 | +\draw (row_space) node[above]{row space: $\text{Range}(\bm{A}^\mathrm{H})$}; |
| 89 | + |
| 90 | +\path (v_space) +(90:\lengthvec-1) coordinate (row_space_dim); |
| 91 | +\draw (row_space_dim) node[above]{dim: $R$ = rank$(\bm{A})$}; |
| 92 | + |
| 93 | +\path (v_space) +(270:\lengthvec) coordinate (null_space); |
| 94 | +\draw (null_space) node[above]{null space: $\text{Null}(\bm{A})$}; |
| 95 | + |
| 96 | +\path (v_space) +(270:\lengthvec+1) coordinate (null_space_dim); |
| 97 | +\draw (null_space_dim) node[above]{dim: $N-R$}; |
| 98 | + |
| 99 | +\path (u_space) +(135:\lengthvec-1) coordinate (u1s); |
| 100 | +\path (u_space) +(225:2) coordinate (b_lns); |
| 101 | +\path (b_lns) +(135:2) coordinate (b); |
| 102 | + |
| 103 | +\draw[-{Latex[length=3mm]}] (u_space) -- (u1s) node[right]{$\sigma_1 \bm{u}_1$}; |
| 104 | +\draw[-{Latex[length=3mm]}] (u_space) -- (b_lns) node[right]{$\bm{e}$}; |
| 105 | + |
| 106 | +\draw[C7, thin] (b_lns) -- (b); |
| 107 | +\draw[C7, thin] (b) -- (u1s); |
| 108 | + |
| 109 | +\draw[-{Latex[length=3mm]}] (u_space) -- (b) node[below]{$\bm{b}$}; |
| 110 | + |
| 111 | +\draw[-{Latex[length=2.5mm]}, dashed] (b) node[left=2cm, above=1cm]{$\bm{v}_1 = \bm{A}^+ \bm{b}$} -- (v1); |
| 112 | +\draw[-{Latex[length=2.5mm]}, dashed] (u1s) node[left=2.5cm, above=0.35cm]{$\bm{v}_1 = \bm{A}^+ (\sigma_1 \bm{u}_1)$} -- (v1); |
| 113 | + |
| 114 | +\draw[-{Latex[length=2.5mm]}, dashed] (b_lns) -- node[above]{$\bm{A}^+ \bm{e}=\bm{0}$}(v_space); |
| 115 | + |
| 116 | + |
| 117 | +\path (-0.25,0) +(-90:\lengthvec+2.5) coordinate (S); |
| 118 | +\draw (S) node[above] |
| 119 | +{ |
| 120 | +$ |
| 121 | +\bm{\Sigma}^+= |
| 122 | +\begin{bmatrix} |
| 123 | +\nicefrac{1}{\sigma_1} & 0& & 0 & 0\\ |
| 124 | +0 & \ddots & & \vdots & \vdots\\ |
| 125 | + & & \nicefrac{1}{\sigma_R} & & \\ |
| 126 | +0 & \cdots & & 0 & 0 |
| 127 | +\end{bmatrix} |
| 128 | +$}; |
| 129 | + |
| 130 | +\end{tikzpicture} |
| 131 | +\end{document} |
0 commit comments