### 经济代写|计量经济学作业代写Econometrics代考|The Frisch-Waugh-Lovell Theorem

statistics-lab™ 为您的留学生涯保驾护航 在代写计量经济学Econometrics方面已经树立了自己的口碑, 保证靠谱, 高质且原创的统计Statistics代写服务。我们的专家在代写计量经济学Econometrics代写方面经验极为丰富，各种代写计量经济学Econometrics相关的作业也就用不着说。

• Statistical Inference 统计推断
• Statistical Computing 统计计算
• (Generalized) Linear Models 广义线性模型
• Statistical Machine Learning 统计机器学习
• Longitudinal Data Analysis 纵向数据分析
• Foundations of Data Science 数据科学基础

## 经济代写|计量经济学作业代写Econometrics代考|The Frisch-Waugh-Lovell Theorem

We now discuss an extremely important and useful property of least squares estimates, which, although widely known, is not as widely appreciated as it should be. We will refer to it as the Frisch-Waugh-Lovell Theorem, or FWL Theorem, after Frisch and Waugh (1933) and Lovell (1963), since those papers

seem to have introduced, and then reintroduced, it to econometricians. The theorem is much more general, and much more generally useful, than a casual reading of those papers might suggest, however. Among other things, it almost totally eliminates the need to invert partitioned matrices when one is deriving many standard results about ordinary (and nonlinear) least squares.

The FWL Theorem applies to any regression where there are two or more regressors, and these can logically be broken up into two groups. The regression can thus be written as
$$\boldsymbol{y}=\boldsymbol{X}{1} \boldsymbol{\beta}{1}+\boldsymbol{X}{2} \boldsymbol{\beta}{2}+\text { residuals, }$$
where $\boldsymbol{X}{1}$ is $n \times k{1}$ and $\boldsymbol{X}{2}$ is $n \times k{2}$, with $\boldsymbol{X} \equiv\left[\begin{array}{ll}\boldsymbol{X}{1} & \boldsymbol{X}{2}\end{array}\right]$ and $k=k_{1}+k_{2}$. For example, $\boldsymbol{X}{1}$ might be seasonal dummy variables or trend variables and $\boldsymbol{X}{2}$ genuine economic variables. This was in fact the type of situation dealt with by Frisch and Waugh (1933) and Lovell (1963). Another possibility is that $\boldsymbol{X}{1}$ might he regressors, the joint. significance of which we desire to test, and $\boldsymbol{X}{2}$ might be other regressors that are not being tested. Or $\boldsymbol{X}{1}$ might be regressors that are known to be orthogonal to the regressand, and $\boldsymbol{X}{2}$ might be regressors that are not orthogonal to it, a situation which arises very frequently when we wish to test nonlinear regression models; see Chapter 6 .
Now consider another regression,
$$\boldsymbol{M}{1} \boldsymbol{y}=\boldsymbol{M}{1} \boldsymbol{X}{2} \boldsymbol{\beta}{2}+\text { residuals, }$$
where $\boldsymbol{M}{1}$ is the matrix that projects off $\mathcal{S}\left(\boldsymbol{X}{1}\right)$. In (1.19) we have first regressed $\boldsymbol{y}$ and each of the $k_{2}$ columns of $\boldsymbol{X}{2}$ on $\boldsymbol{X}{1}$ and then regressed the vector of residuals $\boldsymbol{M}{1} \boldsymbol{y}$ on the $n \times k{2}$ matrix of residuals $\boldsymbol{M}{1} \boldsymbol{X}{2}$. The FWL Theorem tells us that the residuals from regressions (1.18) and (1.19), and the OLS estimates of $\boldsymbol{\beta}{2}$ from those two regressions, will be numerically identical. Geometrically, in regression (1.18) we project $\boldsymbol{y}$ directly onto $\mathcal{S}(\boldsymbol{X}) \equiv \mathcal{S}\left(\boldsymbol{X}{1}, \boldsymbol{X}{2}\right)$, while in regression (1.19) we first project $\boldsymbol{y}$ and all of the columns of $\boldsymbol{X}{2}$ off $\mathcal{S}\left(\boldsymbol{X}{1}\right)$ and then project the residuals $\boldsymbol{M}{1} \boldsymbol{y}$ onto the span of the matrix of residuals, $\mathcal{S}\left(\boldsymbol{M}{1} \boldsymbol{X}{2}\right)$. The FWL Theorem tells us that these two apparently rather different procedures actually amount to the same thing.
The FWL Theorem can be proved in several different ways. One standard proof is based on the algebra of partitioned matrices. First, observe that the estimate of $\boldsymbol{\beta}{2}$ from (1.19) is $$\left(\boldsymbol{X}{2}^{\top} \boldsymbol{M}{1} \boldsymbol{X}{2}\right)^{-1} \boldsymbol{X}{2}^{\top} \boldsymbol{M}{1} \boldsymbol{y}$$
This simple expression, which we will make use of many times, follows immediately from substituting $\boldsymbol{M}{1} \boldsymbol{X}{2}$ for $\boldsymbol{X}$ and $\boldsymbol{M}{1} \boldsymbol{y}$ for $\boldsymbol{y}$ in expression (1.04) for the vector of OLS estimates. The algebraic proof would now use results on the inverse of a partitioned matrix (see Appendix A) to demonstrate that the OLS estimate from (1.18), $\hat{\beta}{2}$, is identical to (1.20) and would then go on to demonstrate that the two sets of residuals are likewise identical. We leave this as an exercise for the reader and proceed, first with a simple semigeometric proof and then with a more detailed discussion of the geometry of the situation.

## 经济代写|计量经济学作业代写Econometrics代考|Computing OLS Estimates

In this section, we will briefly discuss how OLS estimates are actually calculated using digital computers. This is a subject that most students of econometrics, and not a few econometricians, are largely unfamiliar with. The vast majority of the time, well-written regression programs will yield reliable results, and applied econometricians therefore do not need to worry about how those results are actually obtained. But not all programs for OLS regression are written well, and even the best programs can run into difficulties if the data are sufficiently ill-conditioned. We therefore believe that every user of software for least squares regression should have some idea of what the software is actually doing. Moreover, the particular method for OLS regression on which we will focus is interesting from a purely theoretical perspective.
Before we discuss algorithms for least squares regression, we must say something about how digital computers represent real numbers and how this affects the accuracy of calculations carried out on such computers. With rare exceptions, the quantities of interest in regression problems $-\boldsymbol{y}, \boldsymbol{X}, \hat{\boldsymbol{\beta}}$, and so on-are real numbers rather than integers or rational numbers. In general, it requires an infinite number of digits to represent a real number exactly, and this is clearly infeasible. Trying to represent each number by as many digits as are necessary to approximate it with “sufficient” accuracy would mean using a different number of digits to represent different numbers; this would be difficult to do and would greatly slow down calculations. Computers therefore normally deal with real numbers by approximating them using a fixed number of digits (or, more accurately, bits, which correspond to digits in base 2). But in order to handle numbers that may be very large or very small, the computer has to represent real numbers as floating-point numbers. ${ }^{6}$
The basic idea of floating-point numbers is that any real number $x$ can always be written in the form
$\left(b^{c}\right) m$
where $m$, the mantissa (or fractional part), is a signed number less than 1 in absolute value, $b$ is the base of the system of floating-point numbers, and $c$ is the exponent, which may be of either sign. Thus $663.725$ can be written using base 10 as
$$0.663725 \times 10^{3} \text {. }$$
Storing the mantissa 663725 and the exponent 3 separately provides a convenient way for the computer to store the number 663.725. The advantage of this scheme is that very large and very small numbers can be stored just as easily as numbers of more moderate magnitudes; numbers such as $-0.192382 \times 10^{-23}$ and $0.983443 \times 10^{17}$ can be handled just as easily as a number like $3.42$ $\left(=0.342 \times 10^{1}\right)$.

## 经济代写|计量经济学作业代写Econometrics代考|Influential Observations and Leverage

Each element of the vector of OLS estimates $\hat{\boldsymbol{\beta}}$ is simply a weighted average of the elements of the vector $\boldsymbol{y}$. To see this, define $\boldsymbol{c}{i}$ as the $i^{\text {th }}$ row of the matrix $\left(\boldsymbol{X}^{\top} \boldsymbol{X}\right)^{-1} \boldsymbol{X}^{\top}$ and observe from (1.04) that $$\hat{\beta}{i}=\boldsymbol{c}_{i} \boldsymbol{y} .$$
Since each element of $\hat{\beta}$ is a weighted average, some observations may have a much greater influence on $\hat{\boldsymbol{\beta}}$ than others. If one or a few observations are extremely influential, in the sense that deleting them would change some elements of $\hat{\boldsymbol{\beta}}$ substantially, the careful econometrician will normally want to scrutinize the data carefully. It may be that these influential observations are erroneous or for some reason untypical of the rest of the sample. As we will see, even a single erroneous observation can have an enormous effect on $\hat{\boldsymbol{\beta}}$ in some cases. Thus it may be extremely important to identify and correct such observations if they are influential. Even if the data are all correct, the interpretation of the results may change substantially if it is known that one or a few observations are primarily responsible for those results, especially if those observations differ systematically in some way from the rest of the data.
The literature on detecting influential observations is relatively recent, and it has not yet been fully assimilated into econometric practice and available software packages. References include Belsley, Kuh, and Welsch (1980), Cook and Weisberg (1982), and Krasker, Kuh, and Welsch (1983). In this section, we merely introduce a few basic concepts and results with which all econometricians should be familiar. Proving those results provides a nice example of how useful the FWL Theorem can be.

The effect of a single observation on $\hat{\boldsymbol{\beta}}$ can be seen by comparing $\hat{\boldsymbol{\beta}}$ with $\hat{\beta}^{(t)}$, the estimate of $\boldsymbol{\beta}$ that would be obtained if OLS were used on a sample from which the $t^{\text {th }}$ observation was omitted. The difference between $\hat{\beta}$ and $\hat{\beta}^{(t)}$ will turn out to depend crucially on the quantity
$$h_{t} \equiv \boldsymbol{X}{t}\left(\boldsymbol{X}^{\top} \mathbf{X}\right)^{1} \boldsymbol{X}{t}^{\top},$$
which is the $t^{\text {th }}$ diagonal element of the matrix $\boldsymbol{P}{X}$. The notation $h{t}$ comes from the fact that $\boldsymbol{P}{X}$ is sometimes referred to as the hat matrix; because $\hat{\boldsymbol{y}} \equiv \boldsymbol{P}{X} \boldsymbol{y}, \boldsymbol{P}{X}$ “puts a hat on” $\boldsymbol{y}$. Notice that $h{t}$ depends solely on the regressor matrix $\boldsymbol{X}$ and not at all on the regressand $\boldsymbol{y}$.
It is illuminating to rewrite $h_{t}$ as
$$h_{t}=\boldsymbol{e}{t}^{\top} \boldsymbol{P}{X} \boldsymbol{e}{t}=\left|\boldsymbol{P}{X} \boldsymbol{e}{t}\right|^{2},$$ where $e{t}$ denotes the $n$-vector with 1 in the $t^{\text {th }}$ position and 0 everywhere else. Expression (1.38) follows from (1.37), the definition of $\boldsymbol{P}{X}$ and the fact that $e{t}^{\top} \boldsymbol{X}=\boldsymbol{X}{t}$. The right-most expression here shows that $h{t}$ is the

squared length of a certain vector, which ensures that $h_{L} \geq 0$. Moreover, since $\left|\boldsymbol{e}{t}\right|=1$, and since the length of the vector $\boldsymbol{P}{X} \boldsymbol{e}{t}$ can be no greater than the length of $e{t}$ itself, it must be the case that $h_{t}=\left|P_{X} e_{t}\right|^{2} \leq 1$. Thus (1.38) makes it clear that
$$0 \leq h_{t} \leq 1$$
Suppose that $\hat{u}{t}$ denotes the $t^{\text {th }}$ element of the vector of least squares residuals $\boldsymbol{M}{X} \boldsymbol{y}$. We may now state the fundamental result that
$$\hat{\boldsymbol{\beta}}^{(t)}=\hat{\boldsymbol{\beta}}-\left(\frac{1}{1-h_{t}}\right)\left(\boldsymbol{X}^{\top} \boldsymbol{X}\right)^{-1} \boldsymbol{X}{t}^{\top} \hat{u}{t \cdot}$$

## 经济代写|计量经济学作业代写Econometrics代考|The Frisch-Waugh-Lovell Theorem

FWL 定理适用于有两个或更多回归量的任何回归，并且这些回归量在逻辑上可以分为两组。因此回归可以写成

FWL 定理可以用几种不同的方式证明。一种标准证明是基于分区矩阵的代数。首先，观察估计b2从（1.19）是(X2⊤米1X2)−1X2⊤米1是

(bC)米

0.663725×103.

## 经济代写|计量经济学作业代写Econometrics代考|Influential Observations and Leverage

OLS估计向量的每个元素b^只是向量元素的加权平均值是. 要看到这一点，请定义C一世作为一世th 矩阵的行(X⊤X)−1X⊤并从（1.04）观察到b^一世=C一世是.

H吨≡X吨(X⊤X)1X吨⊤,

H吨=和吨⊤磷X和吨=|磷X和吨|2,在哪里和吨表示n-向量中的 1吨th 位置和 0 其他地方。表达式 (1.38) 来自 (1.37)，定义磷X并且事实上和吨⊤X=X吨. 这里最右边的表达式表明H吨是个

0≤H吨≤1

b^(吨)=b^−(11−H吨)(X⊤X)−1X吨⊤在^吨⋅

## 广义线性模型代考

statistics-lab作为专业的留学生服务机构，多年来已为美国、英国、加拿大、澳洲等留学热门地的学生提供专业的学术服务，包括但不限于Essay代写，Assignment代写，Dissertation代写，Report代写，小组作业代写，Proposal代写，Paper代写，Presentation代写，计算机作业代写，论文修改和润色，网课代做，exam代考等等。写作范围涵盖高中，本科，研究生等海外留学全阶段，辐射金融，经济学，会计学，审计学，管理学等全球99%专业科目。写作团队既有专业英语母语作者，也有海外名校硕博留学生，每位写作老师都拥有过硬的语言能力，专业的学科背景和学术写作经验。我们承诺100%原创，100%专业，100%准时，100%满意。

## MATLAB代写

MATLAB 是一种用于技术计算的高性能语言。它将计算、可视化和编程集成在一个易于使用的环境中，其中问题和解决方案以熟悉的数学符号表示。典型用途包括：数学和计算算法开发建模、仿真和原型制作数据分析、探索和可视化科学和工程图形应用程序开发，包括图形用户界面构建MATLAB 是一个交互式系统，其基本数据元素是一个不需要维度的数组。这使您可以解决许多技术计算问题，尤其是那些具有矩阵和向量公式的问题，而只需用 C 或 Fortran 等标量非交互式语言编写程序所需的时间的一小部分。MATLAB 名称代表矩阵实验室。MATLAB 最初的编写目的是提供对由 LINPACK 和 EISPACK 项目开发的矩阵软件的轻松访问，这两个项目共同代表了矩阵计算软件的最新技术。MATLAB 经过多年的发展，得到了许多用户的投入。在大学环境中，它是数学、工程和科学入门和高级课程的标准教学工具。在工业领域，MATLAB 是高效研究、开发和分析的首选工具。MATLAB 具有一系列称为工具箱的特定于应用程序的解决方案。对于大多数 MATLAB 用户来说非常重要，工具箱允许您学习应用专业技术。工具箱是 MATLAB 函数（M 文件）的综合集合，可扩展 MATLAB 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。