Riemann surface
matlab

Exercise 1 (Simple random sampling):
Let there be two correlated random variables $X$ and $Y$. A sample of size $n$ is drawn from a population by simple random sampling without replacement. The observed paired sample is $\left(X_i, Y_i\right), i=1,2, \ldots, n$. If the sample totals are $\hat{X}{\text {tot }}=\frac{N}{n} \sum{i=1}^n X_i, \hat{Y}{\text {tot }}=\frac{N}{n} \sum{i=1}^n Y_i$, then find the covariance between $\hat{X}{\text {tot }}$ and $\hat{Y}{\text {tot }}$.

Solution:
The covariance between $X_{\text {tot }}$ and $Y_{\text {tot }}$ is
\begin{aligned} \operatorname{Cov}\left(\hat{X}{t o t}, \hat{Y}{t o t}\right) & =E\left[\left{\hat{X}{\text {tot }}-E\left(\hat{X}{t o t}\right)\right}\left{\hat{Y}{\text {tot }}-E\left(\hat{Y}{\text {tot }}\right)\right}\right] \ & =E\left(\hat{X}{\text {tot }} \hat{Y}{\text {tot }}\right)-E\left(\hat{X}{\text {tot }}\right) E\left(\hat{Y}{\text {tot }}\right) . \end{aligned}
Note that
$$\begin{gathered} E\left(\hat{X}{\text {tot }}\right)=X{\text {tot }}=\sum_{i=1}^N X_i=N \bar{X} \ E\left(\hat{Y}{\text {tot }}\right)=Y{\text {tot }}=\sum_{i=1}^N Y_i=N \bar{Y} \ \text { where } \bar{X}=\frac{1}{N} \sum_{i=1}^N X_i, \bar{Y}=\frac{1}{N} \sum_{i=1}^N Y_i, \ E\left(X_i Y_i\right)=\frac{1}{N} \sum_{i=1}^N X_i Y_i \ E\left(X_i Y_j\right)=\frac{1}{N(N-1)} \sum_{i \neq j=1}^N \sum_{j=1}^N X_i Y_i \end{gathered}$$
Also,
$$\begin{gathered} \qquad \sum_{i=1}^N X_i \sum_{j=1}^N Y_j=\sum_{i=1}^N X_i Y_i+\sum_{i \neq j=1}^N \sum_{j=1}^N X_i Y_j \ \Rightarrow \sum_{i \neq j=1}^N \sum_{j=1}^N X_i Y_j=N^2 \bar{X} \bar{Y}-\sum_{i=1}^N X_i Y_i \ \text { where } \bar{X}=\frac{1}{N} \sum_{i=1}^N X_i, \bar{Y}=\frac{1}{N} \sum_{i=1}^N Y_i \end{gathered}$$
Then

\begin{aligned} \operatorname{Cov}\left(\hat{X}{\text {tot }}, \hat{Y}{\text {tot }}\right) & =E\left[\left(\frac{N}{n}\right)^2 \sum_{i=1}^n X_i \sum_{i=1}^n Y_i\right]-N^2 \bar{X} \bar{Y} \ & =\left(\frac{N}{n}\right)^2\left[\sum_{i \neq j=1}^N \sum_{j=1}^N E\left(X_i Y_j\right)+\sum_{i \neq j=1}^N \sum_{j=1}^N X_i Y_i\right]-N^2 \bar{X} \bar{Y} \ & =\left(\frac{N}{n}\right)^2\left[\frac{n}{N} \sum_{i=1}^N X_i Y_i+\frac{n(n-1)}{N(N-1)} \sum_{i \neq j=1}^N \sum_{j=1}^N X_i Y_i\right]-N^2 \bar{X} \bar{Y} \ & =\left(\frac{N}{n}\right)^2\left[\frac{n}{N} \sum_{i=1}^N X_i Y_i+\frac{n(n-1)}{N(N-1)}\left(N^2 \bar{X} \bar{Y}-\sum_{j=1}^N X_i Y_i\right)\right]-N^2 \bar{X} \bar{Y} \ & =\left(\frac{N}{n}\right)^2\left[\left(\frac{n}{N}\right)\left(1-\frac{n(n-1)}{N(N-1)}\right) \sum_{i=1}^N X_i Y_i+\frac{n(n-1)}{N(N-1)} N^2 \bar{X} \bar{Y}\right]-N^2 \bar{X} \bar{Y} \ & =\frac{N^2(N-n)}{N n} \frac{1}{N-1} \sum_{i=1}^N\left(X_i-\bar{X}\right)\left(Y_i-\bar{Y}\right) \ & =\frac{N^2(N-n)}{N n} S_{X Y} \end{aligned}
where $S_{X Y}=\frac{1}{N-1}\left(X_i-\bar{X}\right)\left(Y_i-\bar{Y}\right)$.

Exercise 2 (Simple random sampling):
Under the simple random sampling without replacement, find $E\left(s_{x y}\right)$ where
\begin{aligned} & s_{x y}=\frac{1}{n-1} \sum_{i=1}^n\left(X_i-\bar{x}\right)\left(Y_i-\bar{y}\right) \ & \bar{x}=\frac{1}{n} \sum_{i=1}^n X_i, \bar{y}=\frac{1}{n} \sum_{i=1}^n Y_i . \end{aligned}

Solution:
Consider
\begin{aligned} s_{x y} & =\frac{1}{n-1} \sum_{i=1}^n\left(X_i-\bar{x}\right)\left(Y_i-\bar{y}\right) \ & =\frac{1}{n-1}\left[\sum_{i=1}^n X_i Y_i-n \overline{x y}\right] \ & =\frac{1}{n-1}\left[\sum_{i=1}^n X_i Y_i-\frac{n}{n^2}\left(\sum_{i=1}^n x_i\right)\left(\sum_{i=1}^n y_i\right)\right] \ & =\frac{1}{n-1}\left[\sum_{i=1}^n X_i Y_i-\frac{1}{n}\left{\sum_{i=1}^n X_i Y_i+\sum_{i \neq j=1}^n \sum_{j=1}^n X_i Y_j\right}\right] \ & =\frac{1}{n-1}\left[\frac{n-1}{n} \sum_{i=1}^n X_i Y_i-\frac{1}{n} \sum_{i \neq j=1}^n \sum_{j=1}^n X_i Y_j\right] . \end{aligned}

\text { Since } \begin{aligned} & E\left(\sum_{i=1}^n X_i Y_i\right)=\frac{n}{N} \sum_{i=1}^N X_i Y_i \ & E\left(\sum_{i \neq j=1}^n \sum_{j=1}^n X_i Y_j\right)=\frac{n(n-1)}{N(N-1)} \sum_{i=1}^n \sum_{j=1}^n X_i Y_j . \end{aligned}
Thus
\begin{aligned} E\left(s_{x y}\right) & =\frac{1}{n-1}\left[\frac{n-1}{n} \frac{N}{N} \sum_{i=1}^N X_i Y_i-\frac{n(n-1)}{n N(N-1)} \sum_{i=1}^N \sum_{j=1}^N X_i Y_j\right] \ & =\frac{1}{N} \sum_{i=1}^N X_i Y_i-\frac{1}{N(N-1)} \sum_{i \neq j=1}^N \sum_{j=1}^N X_i Y_j \ & =\frac{1}{N} \sum_{i=1}^N X_i Y_i-\frac{1}{N(N-1)}\left[N^2 \bar{X} \bar{Y}-\sum_{i=1}^N X_i Y_i\right] \ & =\left(\frac{1}{N}+\frac{1}{N(N-1)}\right) \sum_{i=1}^N X_i Y_i-\left(\frac{N}{N-1}\right) \bar{X} \bar{Y} \ & =\frac{1}{N-1}\left[\sum_{i=1}^n X_i Y_i-N \bar{X} \bar{Y}\right] \ & =\frac{1}{N-1} \sum_{i=1}^N\left(X_i-\bar{X}\right)\left(Y_i-\bar{Y}\right) \ & =S_{X Y} \end{aligned}

E-mail: help-assignment@gmail.com  微信:shuxuejun

help-assignment™是一个服务全球中国留学生的专业代写公司