Simple Linear Regression

Estimation of the parameters by least squares

  • By far the most common approach involves minimizing the least squares criterion.

  • Let be prediction for based on the th value of .

  • Then represents the th redisual

  • We define the residual sum of squares(RSS) as or equivalently as:

  • The least squares approach chooses and to minimize the RSS. The minimizing values can be shown to be

where and

Assessing the Accuracy of the Coefficient Estimates

In real applications, we have access to a set of observations from which we can compute the least squares line; however, the population regression line is unobserved, it's like the relationship between sample mean and population mean. If we estimate and on the basis of a particular data set, then our estimates won't be exactly equal to and , but if we could average the estimates obtained over a huge number of data sets, then the average of these estimates obtained over a huge number of data sets, then the average of these estimates would be spot on!

terms

  • standard deviation(标准差): 即方差的标准化,(总体)标准差-方差的正平方根,反映样本的离散程度。
  • standard error(标准误差): 样本统计量(这里的样本统计量可以是平均数,标准差,相关系数等等)的标准差,衡量抽样样本(统计量)的误差。 知道总体的标准差: 如果不知道总计的标准差,用样本的标准差的无偏估计: 其中,样本标准差为
  • residual standard error(剩余标准差、均方差):真实值和估计值之间差称为残差/剩余,则残差/剩余的标准差即为RSE.
  • distribution

则显然有: 与之比较类似的形式: 是一个与 相关的随机变量,相关性被抵消,所以随机性下降了。

统计学中的averagemean是两种不同的概念。

  • 前者是基于一定数量的样本通过求平均值得出的summary statistics,是样本统计量(Sample statistics)的样本均值;后者是作为总体参数(Population parameter)的总体均值.
  • 后者求解往往需要先知道这个population服从于什么分布.

但现实生活当中我们无法从小样本中得知这个总体是服从什么分布的,只能用算数平均值来代替。这样一来,当你知道样本总和(n*样本均值)时,只知道其中n-1个值就可以推出剩下的一个是多少了,也就是说只有一个是不自由的。求样本标准差时我们只知道样本均值所以除以(n-1),求总体标准差时我们知道总体均值所以除以n.

SE for slop and intercept

where . For these formulas to be strictly valid, we need to assume that the error for each observation are uncorrelated with common variance

confidence intervals

These SE can be used to compute confidence intervals. A 95% confidence intervals is defined as a range of values such that with 95% probability, the range will contain the true unknown value of the parameter.That is, there is approximately a 95% chance that the interval will contain the true value of

Hypothesis Testing

In the case of the advertising data, 95% confidence interval for is [6.130, 7.935] and the 95% confidence interval for is [0.042, 0,053]. Therefore, we can conclude that in the absence of any advertising, sales will(on average), fall somewhere between 6130 and 7940 units. SE can also be used to preform hypothesis tests on the coefficients.The most common hypothesis test involves testing the null hypothesis of(There is no relationship between X and Y): versus the alternative hypothesis(There is some relationship between X and Y): To test the null hypothesis, we need to determine whether (estimate for ) is far from zero that we can confident that is non-zero.

We compute a t-statistic give by: which measures the number of standard deviations that is away from 0.If there really is no relationship between X and Y, then we expect that the formal formula will have a t-distribution with n-2 degrees of freedom.

p值是Fisher先提出来的“显著性检验”理论体系中的概念:

  • 有一个命题,称之为”零假设“(null hypothesis)
  • 找到一个统计量T,可以计算T的统计分布;
  • 一次试验结果可以计算得到一个确切的T值(),在成立的情况下,出现比更极端情况的概率值记作p值
  • 如果p很小,则可以作为”零假设并不成立“的有力证据。

Consequently, it is a simple matter to compute the probability of observing any value equal to or larger, assuming . We call this probability the p-value. If we see a small p-value, then we can infer that there is an association between the predictor and the response.

Assessing the Accuracy of the Model

It's natural to want to quantify the extent to which the model fits the data. The quality of a linear regression fit is typically assessed using two quantities: the residual standard error(RSE) and the statistic.

Residual Standard Error

The RSE is an estimate of the standard deviation. whether or not the RSE is an acceptable prediction depends on the problem context. where the residual sum-of-squares is The RSE is considered a measure of the lack of the model to the data(模型对数据是否合适的一种度量):

  • if the predictions obtained using the model are very close to the true outcome value, we can conclude that the model fits the data very well.
  • on the other hand, RSE may be quite large, indicating that the model doesn't fit the data well. In advertising data set, the mean value of sales over all markets is approximately 14000 units, and so the percentage error is

Statistics

The RSE provides an absolute measure, it takes the form of a proportion——the proportion of variance explained:

  • is the total sum of squares, which measures the total variance in the response , and can be thought of as the amount of variability inherent in the response before the regression is performed(一种在regression 执行前响应中固有的变量)
  • is the residual sum of squares, which measures the amount of variability that is left unexplained after performing the regression(执行完regression后不明原因/不可解释的变量)
  • An statistic that is close to 1 indicates that a large proportion of the variability in the response has been explained by the regression
  • A number near 0 indicates that the regression did't explain much of the variability in the response; this might occur because the linear model is wrong, or the inherent error is high, or both

References

如何理解自由度

卡方分布

standard deviation 和standard error的区别

standard deviation 和standard error

p value

统计学假设检验中 p 值的含义具体是什么

hypothesis testing

Stastical Learning ch2

results matching ""

    No results matching ""