r/Algebra

▲ 72 r/Algebra+12 crossposts

The sample mean as a projection onto the span of the ones vector

I’ve been thinking about the sample mean from a linear algebra perspective.

If y is a data vector and 1 is the vector of all ones, then the average can be seen as the scalar you get when projecting y onto span(1).

So the projection has the form:

y-hat = y-bar · 1

where y-bar is the usual sample average.

I like this because it makes the average feel like the simplest possible least-squares problem: find the constant vector closest to the data vector.

It also connects naturally to ordinary least squares regression, where y gets projected onto the column space of X instead of just the one-dimensional space spanned by 1.

Does this seem like a good way to introduce projections/least squares, or would you teach it differently?

youtu.be
u/CubionAcademy — 13 days ago