### 经济代写|计量经济学作业代写Econometrics代考|The Algebra of Least Squares

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

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

## 经济代写|计量经济学作业代写Econometrics代考|Samples

In Section $2.18$ we derived and discussed the best linear predictor of $y$ given $x$ for a pair of random variables $(y, \boldsymbol{x}) \in \mathbb{R} \times \mathbb{R}^{k}$ and called this the linear projection model. We are now interested in estimating the parameters of this model, in particular the projection coefficient
$$\boldsymbol{\beta}=\left(\mathbb{E}\left[\boldsymbol{x} \boldsymbol{x}^{\prime}\right]\right)^{-1} \mathbb{E}[\boldsymbol{x} y]$$
We can estimate $\boldsymbol{\beta}$ from observational data which includes joint measurements on the variables $(y, x)$. For example, supposing we are interested in estimating a wage equation, we would use a dataset with observations on wages (or weekly earnings), education, experience (or age), and demographic characteristics (gender, race, location). One possible dataset is the Current Population Survey (CPS), a survey of U.S. households which includes questions on employment, income, education, and demographic characteristics.

Notationally we wish to distinguish observations from the underlying random variables. The convention in econometrics is to denote observations by appending a subscript $i$ which runs from 1 to $n$, thus the $i^{t h}$ observation is $\left(y_{i}, \boldsymbol{x}{i}\right)$, and $n$ denotes the sample size. The dataset is then $\left{\left(y{i}, \boldsymbol{x}_{i}\right) ; i=1, \ldots, n\right}$. We call this the sample or the observations.

From the viewpoint of empirical analysis a dataset is an array of numbers often organized as a table, where the columns of the table correspond to distinct variables and the rows correspond to distinct observations. For empirical analysis the dataset and observations are fixed in the sense that they are numbers presented to the researcher. For statistical analysis we need to view the dataset as random, or more precisely as a realization of a random process.

In order for the coefficient $\boldsymbol{\beta}$ defined in (3.1) to make sense as defined the expectations over the random variables $(\boldsymbol{x}, y)$ need to be common across the observations. The most elegant approach to ensure this is to assume that the observations are draws from an identical underlying population $F$. This is the standard assumption that the observations are identically distributed:

This assumption does not need to be viewed as literally true, rather it is a useful modeling device so that parameters such as $\boldsymbol{\beta}$ are well defined. This assumption should be interpreted as how we view an observation a priori, before we actually observe it. If I tell you that we have a sample with $n=59$ observations set in no particular order, then it makes sense to view two observations, say 17 and 58 , as draws from the same distribution. We have no reason to expect anything special about either observation.
In econometric theory we refer to the underlying common distribution $F$ as the population. Some authors prefer the label the data-generating-process (DGP). You can think of it as a theoretical concept or an infinitely-large potential population. In contrast we refer to the observations available to us $\left{\left(y_{i}, x_{i}\right): i=1, \ldots, n\right}$ as the sample or dataset. In some contexts the dataset consists of all potential observations, for example administrative tax records may contain every single taxpayer in a political unit. Even in this case we view the observations as if they are random draws from an underlying infinitely-large population as this will allow us to apply the tools of statistical theory.

The linear projection model applies to the random observations $\left(y_{i}, \boldsymbol{x}{l}\right)$. This means that the probability model for the observations is the same as that described in Section $2.18$. We can write the model as $$y{i}=\boldsymbol{x}{i}^{\prime} \boldsymbol{\beta}+e{i}$$
where the linear projection coefficient $\boldsymbol{\beta}$ is defined as
$$\boldsymbol{\beta}=\underset{b \in \mathbb{R}^{k}}{\operatorname{argmin}} S(\boldsymbol{b}),$$
the minimizer of the expected squared error
$$S(\boldsymbol{\beta})=\mathbb{E}\left[\left(y_{i}-\boldsymbol{x}{i}^{\prime} \boldsymbol{\beta}\right)^{2}\right]$$ The coefficient has the explicit solution $$\boldsymbol{\beta}=\left(\mathbb{E}\left[\boldsymbol{x}{i} \boldsymbol{x}{i}^{\prime}\right]\right)^{-1} \mathbb{E}\left[\boldsymbol{x}{i} y_{i}\right]$$

## 经济代写|计量经济学作业代写Econometrics代考|Moment Estimators

We want tn estimate the cnefficient $\beta$ defined in (3.5) from the sample of nhservatinns. Nntice that $\boldsymbol{\beta}$ is written as a function of certain population expectations. In this context an appropriate estimator is the same function of the sample moments. Let’s explain this in detail.

To start, suppose that we are interested in the population mean $\mu$ of a random variable $y_{i}$ with dis= tribution function $F$
$$\mu=\mathbb{E}\left[y_{i}\right]=\int_{-\infty}^{\infty} y d F(y)$$
The mean $\mu$ is a function of the distribution $F$ as written in (3.6). To estimate $\mu$ given a sample $\left{y_{1}, \ldots, y_{n}\right}$ a natural estimator is the sample mean
$$\widehat{\jmath}=\bar{y}=\frac{1}{n} \sum_{i=1}^{n} y_{i} .$$
Notice that we have written this using two pieces of notation. The notation $\bar{y}$ with the bar on top is conventional for a sample mean. The notation $\hat{\mu}$ with the hat ” $\wedge$ ” is conventional in econometrics to

denote an estimator of the parameter $\mu$. In this case $\bar{y}$ is the estimator of $\mu$, so $\widehat{\mu}$ and $\bar{y}$ are the same. The sample mean $\bar{y}$ can be viewed as the natural analog of the population mean (3.6) because $\bar{y}$ equals the expectation (3.6) with respect to the empirical distribution – the discrete distribution which puts weight $1 / n$ on each observation $y_{i}$. There are many other justifications for $\bar{y}$ as an estimator for $\mu$. We will defer these discussions for now. Suffice it to say that it is the conventional estimator in the lack of other information about $\mu$ or the distribution of $y_{i}$.

Now suppose that we are interested in a set of population means of possibly non-linear functions of a random vector $\boldsymbol{y}$, say $\boldsymbol{\mu}=\mathbb{E}\left[\boldsymbol{h}\left(\boldsymbol{y}{i}\right)\right]$. For example, we may be interested in the first two moments of $y{i}$, $\mathbb{E}\left[y_{i}\right]$ and $\mathbb{E}\left[y_{i}^{2}\right]$. In this case the natural estimator is the vector of sample means,
$$\widehat{\boldsymbol{\mu}}=\frac{1}{n} \sum_{i=1}^{n} \boldsymbol{h}\left(y_{i}\right)$$
where $\boldsymbol{h}(y)=\left(y, y^{2}\right)$. In this case $\widehat{\mu}{1}=\frac{1}{n} \sum{i=1}^{n} y_{i}$ and $\widehat{\mu}{2}=\frac{1}{n} \sum{i=1}^{n} y_{i}^{2}$. We call $\hat{\boldsymbol{\mu}}$ the moment estimator for $\boldsymbol{\mu}$.

Now suppose that we are interested in a nonlinear function of a set of moments. For example, consider the variance of $y$
$$\sigma^{2}=\operatorname{var}\left[y_{i}\right]=\mathbb{E}\left[y_{i}^{2}\right]-\left(\mathbb{E}\left[y_{i}\right]\right)^{2} .$$
In general, many parameters of interest can be written as a function of moments of $\boldsymbol{y}$. Notationally,
\begin{aligned} &\boldsymbol{\beta}=\boldsymbol{g}(\boldsymbol{\mu}) \ &\boldsymbol{\mu}=\mathbb{E}\left[\boldsymbol{h}\left(\boldsymbol{y}{i}\right)\right] \end{aligned} Here, $\boldsymbol{y}{i}$ are the random variables, $\boldsymbol{h}\left(\boldsymbol{y}{i}\right)$ are functions (transformations) of the random variables, and $\boldsymbol{\mu}$ is the mean (expectation) of these functions. $\boldsymbol{\beta}$ is the parameter of interest, and is the (nonlinear) function $\boldsymbol{g}(\cdot)$ of these means. In this context a natural estimator of $\boldsymbol{\beta}$ is obtained by replacing $\boldsymbol{\mu}$ with $\hat{\boldsymbol{\mu}}$. \begin{aligned} &\widehat{\boldsymbol{\beta}}=\boldsymbol{g}(\widehat{\boldsymbol{\mu}}) \ &\widehat{\boldsymbol{\mu}}=\frac{1}{n} \sum{i=1}^{n} \boldsymbol{h}\left(\boldsymbol{y}{i}\right) . \end{aligned} The estimator $\widehat{\boldsymbol{\beta}}$ is sometimes called a “plug-in” estimator, and sometimes a “substitution” estimator. We typically call $\widehat{\boldsymbol{\beta}}$ a moment, or moment-based, estimator of $\boldsymbol{\beta}$, since it is a natural extension of the moment estimator $\hat{\boldsymbol{\mu}}$. Take the example of the variance $\sigma^{2}=\operatorname{var}\left[y{i}\right]$. Its moment estimator is
$$\widehat{\sigma}^{2}=\widehat{\mu}{2}-\widehat{\mu}{1}^{2}=\frac{1}{n} \sum_{i=1}^{n} y_{i}^{2}-\left(\frac{1}{n} \sum_{i=1}^{n} y_{i}\right)^{2} .$$
This is not the only possible estimator for $\sigma^{2}$ (there is also the well-known bias-corrected estimator) but $\widehat{\sigma}^{2}$ is a straightforward and simple choice.

## 经济代写|计量经济学作业代写Econometrics代考|Least Squares Estimator

The linear projectinn coefficient $\boldsymbol{\beta}$ is defined in (3.3) as the minimizer nf the experted squared errno $S(\overline{\boldsymbol{\beta}})$ defined in (3.4). For given $\overline{\boldsymbol{\beta}}$, the expected squared error is the expectation of the squared error

$\left(y_{i}-\boldsymbol{x}{i}^{\prime} \boldsymbol{\beta}\right)^{2}$. The moment estimator of $S(\boldsymbol{\beta})$ is the sample average: \begin{aligned} \widehat{S}(\boldsymbol{\beta}) &=\frac{1}{n} \sum{i=1}^{n}\left(y_{i}-\boldsymbol{x}{i}^{\prime} \boldsymbol{\beta}\right)^{2} \ &=\frac{1}{n} \operatorname{SSE}(\boldsymbol{\beta}) \end{aligned} where $$\operatorname{SSE}(\boldsymbol{\beta})=\sum{i=1}^{n}\left(y_{i}-\boldsymbol{x}{i}^{\prime} \boldsymbol{\beta}\right)^{2}$$ is called the sum-of-squared-errors function. Since $\widehat{S}(\boldsymbol{\beta})$ is a sample average we can interpret it as an estimator of the expected squared error $S(\boldsymbol{\beta})$. Examining $\widehat{S}(\boldsymbol{\beta})$ as a function of $\boldsymbol{\beta}$ is informative about how $S(\boldsymbol{\beta})$ varies with $\boldsymbol{\beta}$. Since the projection coefficient minimizes $S(\boldsymbol{\beta})$ an analog estimator minimizes (3.7). We define the estimator $\widehat{\boldsymbol{\beta}}$ as the minimizer of $\widehat{S}(\boldsymbol{\beta})$. Definition 3.1 The least-squares estimator $\widehat{\boldsymbol{\beta}}$ is $$\begin{gathered} \widehat{\boldsymbol{\beta}}=\underset{\hat{\boldsymbol{\beta} \in \widehat{R}^{l}}}{\operatorname{argmin}} \widehat{S}(\boldsymbol{\beta}) \ \boldsymbol{\beta})=\frac{1}{n} \sum{i=1}^{n}\left(y_{l}-\mathbf{x}{i}^{\prime} \boldsymbol{\beta}\right)^{2} \end{gathered}$$ where $$\widehat{\boldsymbol{\delta}}(\boldsymbol{\beta})=\frac{1}{n} \sum{l=1}^{n}\left(y_{i}-\boldsymbol{x}{l}^{\prime} \boldsymbol{\beta}\right)^{2}$$ As $\widehat{S}(\boldsymbol{\beta})$ is a scale multiple of $\operatorname{SSE}(\boldsymbol{\beta})$ we may equivalently define $\widehat{\boldsymbol{\beta}}$ as the minimizer of $S S E(\boldsymbol{\beta})$ ). Hence $\widehat{\boldsymbol{\beta}}$ is commonly called the least-squares (LS) estimator of $\boldsymbol{\beta}$. The estimator is also commonly refered to as the ordinary least-squares (OLS) estimator. For the origin of this label see the historical discussion on Adrien-Marie Legendre below. Here, as is common in econometrics, we put a hat ” $\wedge$ ” over the parameter $\boldsymbol{\beta}$ to indicate that $\widehat{\boldsymbol{\beta}}$ is a sample estimate of $\boldsymbol{\beta}$. This is a helpful convention. Just by seeing the symbol $\widehat{\boldsymbol{\beta}}$ we can immediately interpret it as an estimator (because of the hat) of the parameter $\boldsymbol{\beta}$. Sometimes when we want to be explicit about the estimation method, we will write $\widehat{\boldsymbol{\beta}}{\text {ols }}$ to signify that it is the OLLS estimator. It is also common to see the notation $\widehat{\boldsymbol{\beta}}_{n}$, where the subscript ” $n$ ” indicates that the estimator depends on the sample size $n$.

It is important to understand the distinction between population parameters such as $\boldsymbol{\beta}$ and sample estimators such as $\widehat{\boldsymbol{\beta}}$. The population parameter $\boldsymbol{\beta}$ is a non-random feature of the population while the sample estimator $\widehat{\boldsymbol{\beta}}$ is a random feature of a random sample. $\boldsymbol{\beta}$ is fixed, while $\widehat{\boldsymbol{\beta}}$ varies across samples.

## 经济代写|计量经济学作业代写Econometrics代考|Samples

b=(和[XX′])−1和[X是]

b=精氨酸b∈Rķ小号(b),

## 经济代写|计量经济学作业代写Econometrics代考|Moment Estimators

μ=和[是一世]=∫−∞∞是dF(是)

Ÿ^=是¯=1n∑一世=1n是一世.

μ^=1n∑一世=1nH(是一世)

σ2=曾是⁡[是一世]=和[是一世2]−(和[是一世])2.

b=G(μ) μ=和[H(是一世)]这里，是一世是随机变量，H(是一世)是随机变量的函数（变换），并且μ是这些函数的平均值（期望值）。b是感兴趣的参数，并且是（非线性）函数G(⋅)这些手段中。在这种情况下，自然估计b通过替换获得μ和μ^.b^=G(μ^) μ^=1n∑一世=1nH(是一世).估算器b^有时称为“插件”估计器，有时称为“替代”估计器。我们通常称b^矩或基于矩的估计量b, 因为它是矩估计量的自然延伸μ^. 以方差为例σ2=曾是⁡[是一世]. 它的矩估计量是
σ^2=μ^2−μ^12=1n∑一世=1n是一世2−(1n∑一世=1n是一世)2.

## 经济代写|计量经济学作业代写Econometrics代考|Least Squares Estimator

(是一世−X一世′b)2. 矩估计器小号(b)是样本平均值：小号^(b)=1n∑一世=1n(是一世−X一世′b)2 =1n上证所⁡(b)在哪里上证所⁡(b)=∑一世=1n(是一世−X一世′b)2称为误差平方和函数。自从小号^(b)是一个样本平均值，我们可以将其解释为预期平方误差的估计值小号(b). 检查小号^(b)作为一个函数b提供有关如何的信息小号(b)随b. 由于投影系数最小化小号(b)模拟估计器最小化（3.7）。我们定义估计器b^作为最小化器小号^(b). 定义 3.1 最小二乘估计器b^是b^=精氨酸b∈R^l^小号^(b) b)=1n∑一世=1n(是l−X一世′b)2在哪里d^(b)=1n∑l=1n(是一世−Xl′b)2作为小号^(b)是比例倍数上证所⁡(b)我们可以等价地定义b^作为最小化器小号小号和(b)）。因此b^通常称为最小二乘 (LS) 估计量b. 估计器通常也称为普通最小二乘 (OLS) 估计器。有关此标签的起源，请参见下面关于 Adrien-Marie Legendre 的历史讨论。在这里，正如计量经济学中常见的那样，我们戴上帽子”∧”过参数b表示b^是一个样本估计b. 这是一个有用的约定。只看符号b^我们可以立即将其解释为参数的估计量（因为帽子）b. 有时当我们想明确估计方法时，我们会写b^奥尔斯 表示它是 OLLS 估计量。看到符号也很常见b^n, 其中下标 ”n” 表示估计量取决于样本量n.

## 有限元方法代写

tatistics-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 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。