Best fitting line
- Vector \(\mathbf v\) (move this by dragging the head of the arrow; click here to optimize)
- Orthoprojector is \(P = \frac1{\|\mathbf v\|^2} \mathbf v \mathbf v^{\scriptscriptstyle\mathsf{T}}\)
- Data points \(\mathbf a_1,\dotsc, \mathbf a_m\) (move by dragging the points; click here to re-randomize)
- Projections of data points \(P\mathbf a_1,\dotsc,P\mathbf a_m\) (automatically computed)
- Cost (sum of squared distances to line) is
Please excuse the horrible Javascript and user interface design.