Posted on Categories:Complex Network, 复杂网络, 数据科学代写, 统计代写, 统计代考

## avatest™帮您通过考试

avatest™的各个学科专家已帮了学生顺利通过达上千场考试。我们保证您快速准时完成各时长和类型的考试，包括in class、take home、online、proctor。写手整理各样的资源来或按照您学校的资料教您，创造模拟试题，提供所有的问题例子，以保证您在真实考试中取得的通过率是85%以上。如果您有即将到来的每周、季考、期中或期末考试，我们都能帮助您！

•最快12小时交付

•200+ 英语母语导师

•70分以下全额退款

## 数据科学代写|复杂网络代写Complex Network代考|Graph Partitioning Using the Cavity Method

The statistical mechanics formulation of the q-partitioning problem is done via the following ferromagnetic Potts Hamiltonian:
$$\mathcal{H}F({\sigma})=-\sum{i \neq j} J_{i j} \delta\left(\sigma_i, \sigma_j\right),$$
where $J_{i j}$ is the ${0,1}$ adjacency matrix of the graph and $\sigma_i$ denotes the Potts spin variable with $\sigma_i \in{1,2, \ldots, q}$. Once one finds the ground state under the constraint $\sum_i \delta\left(\sigma_i, \tau\right)=N / q$ for all $\tau \in{1,2, \ldots, q}$, one can write the total number of cut edges $C$ in the system using the ground state energy $E_g$ of the above Hamiltonian (6.1):
$$C_q=M+E_g=M\left(\frac{q-1}{q}-Q_q\right) .$$
Note the difference to (5.5). Also note that the modularity of the q-partition $Q_q$ can be expressed via Hamiltonian (6.1) as
$$Q_q=-\frac{\mathcal{H}_F}{M}-\frac{1}{q} .$$
This expression is only valid for magnetization zero, i.e., an exact q-partition.

## 数据科学代写|复杂网络代写Complex Network代考|Cavity Method at Zero Temperature

The ground state energy of (6.1) can be calculated by applying the cavity method at zero temperature following the approach presented by Mezard and Parisi [8] in the formulation for a Potts model as presented by Braunstein et al. $[9,10]$ for coloring random graphs. The energy of a system of $N$ spins is written as dependent on a “cavity spin” $\sigma_1$ via the “cavity field” $\boldsymbol{h}1$ : $$E^N\left(\sigma_1\right)=A-\sum{\tau=1}^q h_1^\tau \delta\left(\tau, \sigma_1\right)$$
Note that $h_1^\tau$ takes only integer values, if $J_{i j}$ is composed of only ${0,1}$. The components of the cavity field $\boldsymbol{h}i$ denote the change in energy of the system with a change in spin $i$. In general, these are different from the “effective fields” $\sum_j J{i j} \sigma_j$ acting on spin $\sigma_i$, which are used to calculate the magnetization. Adding a new spin $\sigma_0$ connected to $\sigma_1$, the energy of the now $N+1$ spin system is a function of both $\sigma_1$ and $\sigma_0$ :
$$E^{N+1}\left(\sigma_1, \sigma_0\right)=A-\sum_{\tau=1}^q h_1^\tau \delta\left(\tau, \sigma_1\right)-J_{10} \delta\left(\sigma_1, \sigma_0\right) .$$
One can now write this expression in such a way that it only depends on the newly added cavity spin $\sigma_0$ :
$$E^{N+1}\left(\sigma_0\right)=\min {\sigma_1} E^{N+1}\left(\sigma_1, \sigma_0\right) \equiv A-w\left(\boldsymbol{h}_1\right)-\sum{\tau=1}^q \hat{u}^\tau\left(J_{10}, \boldsymbol{h}_1\right) \delta\left(\tau, \sigma_0\right) .$$
The functions $w$ and $\hat{u}$ take the following form:
\begin{aligned} w(\boldsymbol{h}) & =\max \left(h^1, \ldots, h^q\right), \ \hat{u}^\tau(J, \boldsymbol{h}) & =\max \left(h^1, \ldots, h^\tau+J, \ldots, h^q\right)-w(\boldsymbol{h}) . \end{aligned}
From (6.8) one sees that $\hat{u}^\tau(\boldsymbol{h})$ is one, whenever the $\tau$ th component of $\boldsymbol{h}$ is maximal with respect to all other components in $\boldsymbol{h}$ and zero otherwise. Due to possible degeneracy in the components of $\boldsymbol{h}$, the vector $\hat{u}(\boldsymbol{h})$ may have more than one non-zero entry and is never completely zero.

## 数据科学代写|复杂网络代写Complex Network代考|Graph Partitioning Using the Cavity Method

q划分问题的统计力学公式是通过以下铁磁波茨哈密顿量来完成的:
$$\mathcal{H}F({\sigma})=-\sum{i \neq j} J_{i j} \delta\left(\sigma_i, \sigma_j\right),$$

$$C_q=M+E_g=M\left(\frac{q-1}{q}-Q_q\right) .$$

$$Q_q=-\frac{\mathcal{H}_F}{M}-\frac{1}{q} .$$

## 数据科学代写|复杂网络代写Complex Network代考|Cavity Method at Zero Temperature

(6.1)的基态能量可以按照Mezard和Parisi[8]在Braunstein等人$[9,10]$为随机图上色提出的Potts模型公式中提出的方法，在零温度下应用空腔法计算。一个$N$自旋系统的能量被写成依赖于“腔自旋”$\sigma_1$通过“腔场”$\boldsymbol{h}1$: $$E^N\left(\sigma_1\right)=A-\sum{\tau=1}^q h_1^\tau \delta\left(\tau, \sigma_1\right)$$

$$E^{N+1}\left(\sigma_1, \sigma_0\right)=A-\sum_{\tau=1}^q h_1^\tau \delta\left(\tau, \sigma_1\right)-J_{10} \delta\left(\sigma_1, \sigma_0\right) .$$

$$E^{N+1}\left(\sigma_0\right)=\min {\sigma_1} E^{N+1}\left(\sigma_1, \sigma_0\right) \equiv A-w\left(\boldsymbol{h}1\right)-\sum{\tau=1}^q \hat{u}^\tau\left(J{10}, \boldsymbol{h}_1\right) \delta\left(\tau, \sigma_0\right) .$$
$w$和$\hat{u}$函数的形式如下:
\begin{aligned} w(\boldsymbol{h}) & =\max \left(h^1, \ldots, h^q\right), \ \hat{u}^\tau(J, \boldsymbol{h}) & =\max \left(h^1, \ldots, h^\tau+J, \ldots, h^q\right)-w(\boldsymbol{h}) . \end{aligned}

## MATLAB代写

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

Posted on Categories:Complex Network, 复杂网络, 数据科学代写, 统计代写, 统计代考

## avatest™帮您通过考试

avatest™的各个学科专家已帮了学生顺利通过达上千场考试。我们保证您快速准时完成各时长和类型的考试，包括in class、take home、online、proctor。写手整理各样的资源来或按照您学校的资料教您，创造模拟试题，提供所有的问题例子，以保证您在真实考试中取得的通过率是85%以上。如果您有即将到来的每周、季考、期中或期末考试，我们都能帮助您！

•最快12小时交付

•200+ 英语母语导师

•70分以下全额退款

## 数据科学代写|复杂网络代写Complex Network代考|Theoretical Limits of Community Detection

With the results of the last section it is now possible to start explaining Fig. 4.5 and to give a limit to which extent a designed community structure in a network can be recovered. As was shown, for any random network one can find an assignment of spins into communities that leads to a modularity $Q>0$. For the computer-generated test networks with $\langle k\rangle=16$ one has a value of $p=\langle k\rangle /(N-1)=0.126$ and expects a value of $Q=0.227$ according to (4.15) and $Q=0.262$ according to (4.22). The modularity of the community structure built in by design is given by
$$Q\left(\left\langle k_{i n}\right\rangle\right)=\frac{\left\langle k_{i n}\right\rangle}{\langle k\rangle}-\frac{1}{4}$$
for a network of four equal sized groups of 32 nodes. Hence, below $\left\langle k_{i n}\right\rangle=8$, one has a designed modularity that is smaller than what can be expected from a random network of the same connectivity! This means that the minimum in the energy landscape corresponding to the community structure that was designed is shallower than those that one can find in the energy landscape defined by any network. It must be understood that in the search for the builtin community structure, one is competing with those community structures that arise from the fact that one is optimizing for a particular quantity in a very large search space. In other words, any network possesses a community structure that exhibits a modularity at least as large as that of a completely random network. If a community structure is to be recovered reliably, it must be sufficiently pronounced in order to win the comparison with the structures arising in random networks. In the case of the test networks employed here, there must be more than $\approx 8$ intra-community links per node. Figure 4.12 again exemplifies this. Observe that random networks with $\langle k\rangle=16$ are expected to show a ratio of internal and external links $k_{\text {in }} / k_{\text {out }} \approx 1$. Networks which are considerably sparser have a higher ratio while denser networks have a much smaller ratio. This means that in dense networks one can recover designed community structure down to relatively smaller $\left\langle k_{i n}\right\rangle$. Consider for example large test networks with $\langle k\rangle=100$ with four built-in communities. For such networks one expects a modularity of $Q \approx 0.1$ and hence the critical value of intra-community links to which the community structure could reliably be estimated would be $\left\langle k_{i n}\right\rangle_c=35$ which is much smaller in relative comparison to the average degree in the network.

## 数据科学代写|复杂网络代写Complex Network代考|Analytical Developments

Let us recall the modularity Hamiltonian:
$$\mathcal{H}=-\sum_{i<j}\left(A_{i j}-\gamma p_{i j}\right) \delta\left(\sigma_i, \sigma_j\right) .$$
For convenience, instead of a Potts model with $q$ different spin states, the discussion is limited to only two spin states as in the Ising model, namely $S_i \in-1,1$. The delta function in (5.1) can be expressed as
$$\delta\left(S_i, S_j\right)=\frac{1}{2} S_i S_j+\frac{1}{2},$$
which leads to the new Hamiltonian
$$\mathcal{H}=-\sum_{i<j}\left(A_{i j}-\gamma p_{i j}\right) S_i S_j .$$
Note that (5.3) differs from (5.1) only by an irrelevant constant which even vanishes for $\gamma=1$ due to the normalization of $p_{i j}$. Because of the factor $1 / 2$ in (5.2), the modularity of the partition into two communities is now and for the remainder of this chapter
$$Q_2=-\frac{\mathcal{H}}{2 M},$$
where $\mathcal{H}$ now denotes the Hamiltonian (5.3). For the number of cut edges of the partition one can write
$$\mathcal{C}=\frac{1}{2}\left(M+E_g\right)=\frac{M}{2}\left(1-2 Q_2\right),$$
with $E_g$ denoting the ground state energy of (5.3) and it is clear that $Q_2$ measures the improvement of the partition over a random assignment into groups.

Formally, (5.3) corresponds to a Sherrington-Kirkpatrick (SK) model of a spin glass [3]
$$\mathcal{H}=-\sum_{i<j} J_{i j} S_i S_j,$$
with couplings of the form
$$J_{i j}=\left(A_{i j}-\gamma p_{i j}\right) .$$

## 数据科学代写|复杂网络代写Complex Network代考|Theoretical Limits of Community Detection

$$Q\left(\left\langle k_{i n}\right\rangle\right)=\frac{\left\langle k_{i n}\right\rangle}{\langle k\rangle}-\frac{1}{4}$$

## 数据科学代写|复杂网络代写Complex Network代考|Analytical Developments

$$\mathcal{H}=-\sum_{i<j}\left(A_{i j}-\gamma p_{i j}\right) \delta\left(\sigma_i, \sigma_j\right) .$$

$$\delta\left(S_i, S_j\right)=\frac{1}{2} S_i S_j+\frac{1}{2},$$

$$\mathcal{H}=-\sum_{i<j}\left(A_{i j}-\gamma p_{i j}\right) S_i S_j .$$

$$Q_2=-\frac{\mathcal{H}}{2 M},$$

$$\mathcal{C}=\frac{1}{2}\left(M+E_g\right)=\frac{M}{2}\left(1-2 Q_2\right),$$
$E_g$表示(5.3)的基态能量，很明显，$Q_2$测量了随机分配到组上的分区的改进。

$$\mathcal{H}=-\sum_{i<j} J_{i j} S_i S_j,$$

$$J_{i j}=\left(A_{i j}-\gamma p_{i j}\right) .$$

## MATLAB代写

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

Posted on Categories:Complex Network, 复杂网络, 数据科学代写, 统计代写, 统计代考

## avatest™帮您通过考试

avatest™的各个学科专家已帮了学生顺利通过达上千场考试。我们保证您快速准时完成各时长和类型的考试，包括in class、take home、online、proctor。写手整理各样的资源来或按照您学校的资料教您，创造模拟试题，提供所有的问题例子，以保证您在真实考试中取得的通过率是85%以上。如果您有即将到来的每周、季考、期中或期末考试，我们都能帮助您！

•最快12小时交付

•200+ 英语母语导师

•70分以下全额退款

## 数据科学代写|复杂网络代写Complex Network代考|A New Error Function

We already said that we would like to use a statistical mechanics approach. The problem of finding a block structure which reflects the network as good as possible is then mapped onto finding the solution of a combinatorial optimization problem. Trying to approximate the adjacency matrix $\mathbf{A}$ of rank $r$ by a matrix $\mathbf{B}$ of rank $q<r$ means approximating $\mathbf{A}$ with a block model of only full and zero blocks. Formally, we can write this as $\mathbf{B}_{i j}=B\left(\sigma_i, \sigma_j\right)$ where $B(r, s)$ is a ${0,1}^{q \times q}$ matrix and $\sigma_i \in{1, \ldots, q}$ is the assignment of node $i$ from A into one of the $q$ blocks. We can view $B(r, s)$ as the adjacency matrix of the blocks in the network or as the image graph discussed in the previous chapter and its nodes represent the different equivalence classes into which the vertices of $\mathbf{A}$ may be grouped. From Table 3.1, we see that our error function can have only four different contributions. They should

reward the matching of edges in $\mathbf{A}$ to edges in $\mathbf{B}$,

penalize the matching of missing edges (non-links) in $\mathbf{A}$ to edges in $\mathbf{B}$,

penalize the matching of edges in $\mathbf{A}$ to missing edges in $\mathbf{B}$ and

reward the matching of missing edges in $\mathbf{A}$ to edges in $\mathbf{B}$

## 数据科学代写|复杂网络代写Complex Network代考|Fitting Networks to Image Graphs

The above-defined quality and error functions in principle consist of two parts. On one hand, there is the image graph $\mathbf{B}$ and on the other hand, there is the mapping of nodes of the network to nodes in the image graph, i.e., the assignment of nodes into blocks, which both determine the fit. Given a network $\mathbf{A}$ and an image graph $\mathbf{B}$, we could now proceed to optimize the assignment of nodes into groups ${\sigma}$ as to optimize (3.6) or any of the derived forms. This would correspond to “fitting” the network to the given image graph. This allows us to compare how well a particular network may be represented by a given image graph. We will see later that the search for cohesive subgroups is exactly of this type of analysis: If our image graph is made of isolated vertices which only connect to themselves, then we are searching for an assignment of nodes into groups such that nodes in the same group are as densely connected as possible and nodes in different groups as sparsely as possible. However, ultimately, we are interested also in the image graph which best fits to the network among all possible image graphs B. In principle, we could try out every possible image graph, optimize the assignment of nodes into blocks ${\sigma}$ and compare these fit scores. This quickly becomes impractical for even moderately large image graphs. In order to solve this problem, it is useful to consider the properties of the optimally fitting image graph $\mathbf{B}$ if we are given the networks plus the assignment of nodes into groups ${\sigma}$.

We have already seen that the two terms of (3.7) are extremized by the same $B\left(\sigma_i, \sigma_j\right)$. It is instructive to introduce the abbreviations
\begin{aligned} m_{r s} & =\sum_{i j} w_{i j} A_{i j} \delta\left(\sigma_i, r\right) \delta\left(\sigma_j, s\right) \text { and } \ {\left[m_{r s}\right]{p{i j}} } & =\sum_{i j} p_{i j} \delta\left(\sigma_i, r\right) \delta\left(\sigma_j, s\right), \end{aligned}
and write two equivalent formulations for our quality function:
\begin{aligned} & Q^1({\sigma}, \mathbf{B})=\sum_{r, s}\left(m_{r s}-\gamma\left[m_{r s}\right]{p{i j}}\right) B(r, s) \text { and } \ & Q^0({\sigma}, \mathbf{B})=-\sum_{r, s}\left(m_{r s}-\gamma\left[m_{r s}\right]{p{i j}}\right)(1-B(r, s)) . \end{aligned}

## 数据科学代写|复杂网络代写Complex Network代考|Fitting Networks to Image Graphs

\begin{aligned} m_{r s} & =\sum_{i j} w_{i j} A_{i j} \delta\left(\sigma_i, r\right) \delta\left(\sigma_j, s\right) \text { and } \ {\left[m_{r s}\right]{p{i j}} } & =\sum_{i j} p_{i j} \delta\left(\sigma_i, r\right) \delta\left(\sigma_j, s\right), \end{aligned}

\begin{aligned} & Q^1({\sigma}, \mathbf{B})=\sum_{r, s}\left(m_{r s}-\gamma\left[m_{r s}\right]{p{i j}}\right) B(r, s) \text { and } \ & Q^0({\sigma}, \mathbf{B})=-\sum_{r, s}\left(m_{r s}-\gamma\left[m_{r s}\right]{p{i j}}\right)(1-B(r, s)) . \end{aligned}

## MATLAB代写

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

Posted on Categories:Linear Regression, 数据科学代写, 线性回归, 统计代写, 统计代考

## avatest™帮您通过考试

avatest™的各个学科专家已帮了学生顺利通过达上千场考试。我们保证您快速准时完成各时长和类型的考试，包括in class、take home、online、proctor。写手整理各样的资源来或按照您学校的资料教您，创造模拟试题，提供所有的问题例子，以保证您在真实考试中取得的通过率是85%以上。如果您有即将到来的每周、季考、期中或期末考试，我们都能帮助您！

•最快12小时交付

•200+ 英语母语导师

•70分以下全额退款

## 统计代写|线性回归代写Linear Regression代考|Properties of the Estimates

Additional properties of the ols estimates are derived in Appendix A.8 and are only summarized here. Assuming that $\mathrm{E}(\mathbf{e} \mid X)=\mathbf{0}$ and $\operatorname{Var}(\mathbf{e} \mid X)=\sigma^2 \mathbf{I}_n$, then $\hat{\boldsymbol{\beta}}$ is unbiased, $\mathrm{E}(\hat{\boldsymbol{\beta}} \mid X)=\boldsymbol{\beta}$, and
$$\operatorname{Var}(\hat{\boldsymbol{\beta}} \mid X)=\sigma^2\left(\mathbf{X}^{\prime} \mathbf{X}\right)^{-1}$$
Excluding the intercept regressor,
$$\operatorname{Var}\left(\hat{\boldsymbol{\beta}}^* \mid X\right)=\sigma^2\left(\mathcal{X}^{\prime} \mathcal{X}\right)^{-1}$$
and so $\left(\mathcal{X}^{\prime} \mathcal{X}\right)^{-1}$ is all but the first row and column of $\left(\mathbf{X}^{\prime} \mathbf{X}\right)^{-1}$. An estimate of $\sigma^2$ is given by
$$\hat{\sigma}^2=\frac{\mathrm{RSS}}{n-(p+1)}$$
If $\mathbf{e}$ is normally distributed, then the residual sum of squares has a chi-squared distribution,
$$\frac{n-(p+1) \hat{\sigma}^2}{\sigma^2} \sim \chi^2(n-(p+1))$$
By substituting $\hat{\sigma}^2$ for $\sigma^2$ in (3.14), we find the estimated variance of $\hat{\boldsymbol{\beta}}$ to be
$$\widehat{\operatorname{Var}}(\hat{\boldsymbol{\beta}} \mid X)=\hat{\sigma}^2\left(\mathbf{X}^{\prime} \mathbf{X}\right)^{-1}$$

## 统计代写|线性回归代写Linear Regression代考|Simple Regression in Matrix Notation

For simple regression, $\mathbf{X}$ and $\mathbf{Y}$ are given by
$$\mathbf{X}=\left(\begin{array}{cc} 1 & x_1 \ 1 & x_2 \ \vdots & \vdots \ 1 & x_n \end{array}\right) \quad \mathbf{Y}=\left(\begin{array}{c} y_1 \ y_2 \ \vdots \ y_n \end{array}\right)$$
and thus
$$\left(\mathbf{X}^{\prime} \mathbf{X}\right)=\left(\begin{array}{rr} n & \sum x_i \ \sum x_i & \sum x_i^2 \end{array}\right) \quad \mathbf{X}^{\prime} \mathbf{Y}=\left(\begin{array}{r} \sum y_i \ \sum x_i y_i \end{array}\right)$$
By direct multiplication, $\left(\mathbf{X}^{\prime} \mathbf{X}\right)^{-1}$ can be shown to be
$$\left(\mathbf{X}^{\prime} \mathbf{X}\right)^{-1}=\frac{1}{\operatorname{SXX}}\left(\begin{array}{rr} \sum x_i^2 / n & -\bar{x} \ -\bar{x} & 1 \end{array}\right)$$
so that
\begin{aligned} \hat{\boldsymbol{\beta}} & =\left(\begin{array}{c} \hat{\beta}_0 \ \hat{\beta}_1 \end{array}\right)=\left(\mathbf{X}^{\prime} \mathbf{X}\right)^{-1} \mathbf{X}^{\prime} \mathbf{Y}=\frac{1}{\mathrm{SXX}}\left(\begin{array}{rr} x_i^2 / n & -\bar{x} \ -\bar{x} & 1 \end{array}\right)\left(\begin{array}{c} \sum y_i \ \sum x_i y_i \end{array}\right) \ & =\left(\begin{array}{c} \bar{y}-\hat{\beta}_1 \bar{x} \ \text { SXY } / \mathrm{SXX} \end{array}\right) \end{aligned}
as found previously. Also, since $\sum x_i^2 /(n \mathrm{SXX})=1 / n+\bar{x}^2 / \mathrm{SXX}$, the variances and covariances for $\hat{\beta}_0$ and $\hat{\beta}_1$ found in Chapter 2 are identical to those given by $\sigma^2\left(\mathbf{X}^{\prime} \mathbf{X}\right)^{-1}$

## 统计代写|线性回归代写Linear Regression代考|Properties of the Estimates

ols估计数的其他性质载于附录A.8，在此仅作概述。假设$\mathrm{E}(\mathbf{e} \mid X)=\mathbf{0}$和$\operatorname{Var}(\mathbf{e} \mid X)=\sigma^2 \mathbf{I}_n$，那么$\hat{\boldsymbol{\beta}}$是无偏的，$\mathrm{E}(\hat{\boldsymbol{\beta}} \mid X)=\boldsymbol{\beta}$，和
$$\operatorname{Var}(\hat{\boldsymbol{\beta}} \mid X)=\sigma^2\left(\mathbf{X}^{\prime} \mathbf{X}\right)^{-1}$$

$$\operatorname{Var}\left(\hat{\boldsymbol{\beta}}^* \mid X\right)=\sigma^2\left(\mathcal{X}^{\prime} \mathcal{X}\right)^{-1}$$

$$\hat{\sigma}^2=\frac{\mathrm{RSS}}{n-(p+1)}$$

$$\frac{n-(p+1) \hat{\sigma}^2}{\sigma^2} \sim \chi^2(n-(p+1))$$

$$\widehat{\operatorname{Var}}(\hat{\boldsymbol{\beta}} \mid X)=\hat{\sigma}^2\left(\mathbf{X}^{\prime} \mathbf{X}\right)^{-1}$$

## 统计代写|线性回归代写Linear Regression代考|Simple Regression in Matrix Notation

$$\mathbf{X}=\left(\begin{array}{cc} 1 & x_1 \ 1 & x_2 \ \vdots & \vdots \ 1 & x_n \end{array}\right) \quad \mathbf{Y}=\left(\begin{array}{c} y_1 \ y_2 \ \vdots \ y_n \end{array}\right)$$

$$\left(\mathbf{X}^{\prime} \mathbf{X}\right)=\left(\begin{array}{rr} n & \sum x_i \ \sum x_i & \sum x_i^2 \end{array}\right) \quad \mathbf{X}^{\prime} \mathbf{Y}=\left(\begin{array}{r} \sum y_i \ \sum x_i y_i \end{array}\right)$$

$$\left(\mathbf{X}^{\prime} \mathbf{X}\right)^{-1}=\frac{1}{\operatorname{SXX}}\left(\begin{array}{rr} \sum x_i^2 / n & -\bar{x} \ -\bar{x} & 1 \end{array}\right)$$

\begin{aligned} \hat{\boldsymbol{\beta}} & =\left(\begin{array}{c} \hat{\beta}_0 \ \hat{\beta}_1 \end{array}\right)=\left(\mathbf{X}^{\prime} \mathbf{X}\right)^{-1} \mathbf{X}^{\prime} \mathbf{Y}=\frac{1}{\mathrm{SXX}}\left(\begin{array}{rr} x_i^2 / n & -\bar{x} \ -\bar{x} & 1 \end{array}\right)\left(\begin{array}{c} \sum y_i \ \sum x_i y_i \end{array}\right) \ & =\left(\begin{array}{c} \bar{y}-\hat{\beta}_1 \bar{x} \ \text { SXY } / \mathrm{SXX} \end{array}\right) \end{aligned}

## MATLAB代写

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

Posted on Categories:Linear Regression, 数据科学代写, 线性回归, 统计代写, 统计代考

## avatest™帮您通过考试

avatest™的各个学科专家已帮了学生顺利通过达上千场考试。我们保证您快速准时完成各时长和类型的考试，包括in class、take home、online、proctor。写手整理各样的资源来或按照您学校的资料教您，创造模拟试题，提供所有的问题例子，以保证您在真实考试中取得的通过率是85%以上。如果您有即将到来的每周、季考、期中或期末考试，我们都能帮助您！

•最快12小时交付

•200+ 英语母语导师

•70分以下全额退款

## 统计代写|线性回归代写Linear Regression代考|ADDING A REGRESSOR TO A SIMPLE LINEAR REGRESSION MODEL

We start with a response $Y$ and the simple linear regression mean function
$$\mathrm{E}\left(Y \mid X_1=x_1\right)=\beta_0+\beta_1 x_1$$
Now suppose we have a second variable $X_2$ and would like to learn about the simultaneous dependence of $Y$ on $X_1$ and $X_2$. By adding $X_2$ to the problem, we will get a mean function that depends on both the value of $X_1$ and the value of $X_2$,
$$\mathrm{E}\left(Y \mid X_1=x_1, X_2=x_2\right)=\beta_0+\beta_1 x_1+\beta_2 x_2$$
The main idea in adding $X_2$ is to explain the part of $Y$ that has not already been explained by $X_1$.
United Nations Data
We will use the United Nations data discussed in Problem 1.1. To the regression with response lifeExpF and regressor $\log (\mathrm{ppgdp}$ ) we consider adding fertility, the average number of children per woman. Interest therefore centers on the distribution of $\log ($ iffeExpF $)$ as $\log (\mathrm{ppgdp})$ and fertility both vary. The data are in the file UN11.
Figure 3.1a is a summary graph for the simple regression of lifeExpF on $\log (\mathrm{ppg} \mathrm{dp})$. This graph can also be called a marginal plot because it ignores all other regressors. The fitted mean function to the marginal plot using oLs is
$$\hat{\mathrm{E}}(\text { lifeExpF } \mid \log (\mathrm{ppgdp}))=29.815+5.019 \log (\mathrm{ppgdp})$$
with $R^2=0.596$, so about $60 \%$ of the variability in lifeExpF is explained by $\log (p p g d p)$. Expected lifeExpF increases as $\log (p p g d p)$ increases.
Similarly, Figure $3.1 \mathrm{~b}$ is the marginal plot for the regression of lifeExpF on fertility. This simple regression has fitted mean function
$$\hat{E}(\text { lifeExpFlfertility })=89.481-6.224 \text { fertility }$$
with $R^2=0.678$, so fertility explains about $68 \%$ of the variability in lifeExpF. Expected lifeExpF decreases as fertility increases. Thus, from Figure 3.1a, the response lifeExpF is related to the regressor $\log (\mathrm{ppgdp})$ ignoring fertility, and from Figure 3.1b, lifeExpF is related to fertility ignoring $\log (p p g d p)$.

## 统计代写|线性回归代写Linear Regression代考|Explaining Variability

Given these graphs, what can be said about the proportion of variability in lifeExpF explained jointly by $\log (\mathrm{ppgdp})$ and fertility? The total explained variation must be at least $67.8 \%$, the larger of the variation explained by each variable separately, since using both $\log (\mathrm{ppgdp})$ and fertility must surely be at least as informative as using just one of them. If the regressors were uncorrelated, then the variation explained by them jointly would equal the sum of the variations explained individually. In this example, the sum of the individual variations explained exceeds $100 \%, 59.6 \%+67.8 \%$ $=127.4 \%$. As confirmed by Figure 3.2, the regressors are correlated so this simple addition formula won’t apply. The variation explained by both variables can be smaller than the sum of the individual variation explained if the regressors are in part explaining the same variation. The total can exceed the sum if the variables act jointly so that knowing both gives more information than knowing just one of them. For example, the area of a rectangle may be only poorly determined by either the length or width alone, but if both are considered at the same time, area can be determined exactly. It is precisely this inability to predict the joint relationship from the marginal relationships that makes multiple regression rich and complicated.

To get the effect of adding fertility to the model that already includes $\log (\mathrm{ppgdp})$, we need to examine the part of the response lifeExpF not explained by $\log (p p g d p)$ and the part of the new regressor fertility not explained by $\log (p p g d p)$.

Compute the regression of the response lifeExpF on the first regressor $\log (\mathrm{ppgdp})$, corresponding to the ols line shown in Figure 3.1a. The fitted equation is given at (3.2). Keep the residuals from this regression. These residuals are the part of the response lifeExpF not explained by the regression on $\log (\mathrm{ppg} \mathrm{dp})$.

Compute the regression of fertility on $\log ($ ppgdp), corresponding to Figure 3.2. Keep the residuals from this regression as well. These residuals are the part of the new regressor fertility not explained by $\log ($ ppgdp $)$.

The added-variable plot is of the unexplained part of the response from (1) on the unexplained part of the added regressor from (2).

## 统计代写|线性回归代写Linear Regression代考|ADDING A REGRESSOR TO A SIMPLE LINEAR REGRESSION MODEL

$$\mathrm{E}\left(Y \mid X_1=x_1\right)=\beta_0+\beta_1 x_1$$

$$\mathrm{E}\left(Y \mid X_1=x_1, X_2=x_2\right)=\beta_0+\beta_1 x_1+\beta_2 x_2$$

$$\hat{\mathrm{E}}(\text { lifeExpF } \mid \log (\mathrm{ppgdp}))=29.815+5.019 \log (\mathrm{ppgdp})$$

$$\hat{E}(\text { lifeExpFlfertility })=89.481-6.224 \text { fertility }$$
$R^2=0.678$，所以生育率解释了$68 \%$生命指数的变化。预期寿命随着生育率的增加而下降。因此，从图3.1a中，响应lifeExpF与忽略生育率的回归量$\log (\mathrm{ppgdp})$相关，从图3.1b中，lifeExpF与忽略生育率$\log (p p g d p)$相关。

## MATLAB代写

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