You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lectures/orth_proj.md
+50-18Lines changed: 50 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -684,20 +684,57 @@ Numerical routines would in this case use the alternative form $R \hat \beta = Q
684
684
685
685
## Exercises
686
686
687
-
### Exercise 1
687
+
```{exercise-start}
688
+
:label: ex1
689
+
```
688
690
689
691
Show that, for any linear subspace $S \subset \mathbb R^n$, $S \cap S^{\perp} = \{0\}$.
690
692
691
-
### Exercise 2
693
+
```{exercise-end}
694
+
```
695
+
696
+
```{solution-start} ex1
697
+
:class: dropdown
698
+
```
699
+
If $x \in S$ and $x \in S^\perp$, then we have in particular
700
+
that $\langle x, x \rangle = 0$, but then $x = 0$.
701
+
702
+
```{solution-end}
703
+
```
692
704
705
+
```{exercise-start}
706
+
:label: ex2
707
+
```
693
708
Let $P = X (X' X)^{-1} X'$ and let $M = I - P$. Show that
694
709
$P$ and $M$ are both idempotent and symmetric. Can you give any
695
710
intuition as to why they should be idempotent?
696
711
697
-
### Exercise 3
712
+
```{exercise-end}
713
+
```
714
+
715
+
```{solution-start} ex2
716
+
:class: dropdown
717
+
```
718
+
719
+
Symmetry and idempotence of $M$ and $P$ can be established
720
+
using standard rules for matrix algebra. The intuition behind
721
+
idempotence of $M$ and $P$ is that both are orthogonal
722
+
projections. After a point is projected into a given subspace, applying
723
+
the projection again makes no difference (A point inside the subspace
724
+
is not shifted by orthogonal projection onto that space because it is
725
+
already the closest point in the subspace to itself).
726
+
727
+
```{solution-end}
728
+
```
729
+
730
+
731
+
```{exercise-start}
732
+
:label: ex3
733
+
```
698
734
699
735
Using Gram-Schmidt orthogonalization, produce a linear projection of $y$ onto the column space of $X$ and verify this using the projection matrix $P := X (X' X)^{-1} X'$ and also using QR decomposition, where:
700
736
737
+
701
738
$$
702
739
y :=
703
740
\left(
@@ -723,24 +760,14 @@ X :=
723
760
\right)
724
761
$$
725
762
726
-
## Solutions
727
-
728
-
### Exercise 1
729
763
730
-
If $x \in S$ and $x \in S^\perp$, then we have in particular
731
-
that $\langle x, x \rangle = 0$, but then $x = 0$.
764
+
```{exercise-end}
765
+
```
732
766
733
-
### Exercise 2
734
767
735
-
Symmetry and idempotence of $M$ and $P$ can be established
736
-
using standard rules for matrix algebra. The intuition behind
737
-
idempotence of $M$ and $P$ is that both are orthogonal
738
-
projections. After a point is projected into a given subspace, applying
739
-
the projection again makes no difference. (A point inside the subspace
740
-
is not shifted by orthogonal projection onto that space because it is
741
-
already the closest point in the subspace to itself.).
742
-
743
-
### Exercise 3
768
+
```{solution-start} ex3
769
+
:class: dropdown
770
+
```
744
771
745
772
Here's a function that computes the orthonormal vectors using the GS
0 commit comments