wikipedia的解釋:
http://en.wikipedia.org/wiki/Degrees_of_freedom_(statistics)
An only slightly less simple example is that of least squares estimation of a and b in the model
where εi and hence Yi are random. Let and be the least-squares estimates of a and b. Then the residuals
are constrained to lie within the space defined by the two equations
One says that there are n − 2 degrees of freedom for error.
The capital Y is used in specifying the model, and lower-case y in the definition of the residuals. That is because the former are hypothesized random variables and the latter are data.
We can generalise this to multiple regression involving p parameters and covariates (e.g. p − 1 predictors and one mean), in which case the cost in degrees of freedom of the fit is p.
說句實(shí)話,大家都是在一個(gè)層面上的理解,主要通過自然語言進(jìn)行解釋。而實(shí)際上,真正的數(shù)學(xué)推導(dǎo)并沒有給出。