So I want to find $E(\sum_{i=1}^n \hat{y_i}^2) = E(\hat{y}^T \hat{y})$. So, I have that $$\hat{y}^T \hat{y} = \hat{\beta}^T X^T X \hat{\beta} = [(X^TX)^{-1}X^Ty]^TX^TX(X^TX)^{-1}X^Ty$$ $$ = y^TX(X^TX)^{-1}X^Ty $$ $$ = y^THy $$ I'm not really sure where to go from here. The above result is just a scalar so I think I can take the trace and say that $$ E(y^THy)=E(tr(y^THy))=E(\sum_{i=1}^n{y_i}^2) $$ $$ =\sum_{i=1}^nE({y_i}^2) = \sum_{i=1}^nV(y_i)+\sum_{i=1}^n[E(y_i)]^2 $$ $$ =n({\sigma}^2 +\bar{y}^2). $$ I have a few questions about my approach here. (1) Here we assumed that the $y$ are normally distributed with constant variance (due to the nature of the random error). Does this mean that the estimates, $\hat{y}$, are also normally distributed? (2) I'm having trouble understanding intuitively why the expected value of the estimate would be different from the expected value of $y$. It seems like if what I just derived is correct, then $E(\sum_{i=1}^n \hat{y_i}^2)=E(\sum_{i=1}^n {y_i}^2) $, does this make sense? (3) I'm having trouble understanding when an expectation can be further evaluated. For example, in this case should I have left the expectation in the final answer or was it appropriate to replace it with $\bar{y}$?
2026-03-31 16:26:53.1774974413
I want to derive the expectation of the sum of squares of the $n$ predicted $y$ values for a multiple linear regression model with $K$ regressors.
105 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
There are 1 best solutions below
Related Questions in STATISTICS
- Given is $2$ dimensional random variable $(X,Y)$ with table. Determine the correlation between $X$ and $Y$
- Statistics based on empirical distribution
- Given $U,V \sim R(0,1)$. Determine covariance between $X = UV$ and $V$
- Fisher information of sufficient statistic
- Solving Equation with Euler's Number
- derive the expectation of exponential function $e^{-\left\Vert \mathbf{x} - V\mathbf{x}+\mathbf{a}\right\Vert^2}$ or its upper bound
- Determine the marginal distributions of $(T_1, T_2)$
- KL divergence between two multivariate Bernoulli distribution
- Given random variables $(T_1,T_2)$. Show that $T_1$ and $T_2$ are independent and exponentially distributed if..
- Probability of tossing marbles,covariance
Related Questions in EXPECTED-VALUE
- Show that $\operatorname{Cov}(X,X^2)=0$ if X is a continuous random variable with symmetric distribution around the origin
- prove that $E(Y) = 0$ if $X$ is a random variable and $Y = x- E(x)$
- Limit of the expectation in Galton-Watson-process using a Martingale
- Determine if an Estimator is Biased (Unusual Expectation Expression)
- Why are negative constants removed from variance?
- How to find $\mathbb{E}(X\mid\mathbf{1}_{X<Y})$ where $X,Y$ are i.i.d exponential variables?
- $X_1,X_2,X_3 \sim^{\text{i.i.d}} R(0,1)$. Find $E(\frac{X_1+X_2}{X_1+X_2+X_3})$
- How to calculate the conditional mean of $E(X\mid X<Y)$?
- Let X be a geometric random variable, show that $E[X(X-1)...(X-r+1)] = \frac{r!(1-p)^r}{p^r}$
- Taylor expansion of expectation in financial modelling problem
Related Questions in REGRESSION
- How do you calculate the horizontal asymptote for a declining exponential?
- Linear regression where the error is modified
- Statistics - regression, calculating variance
- Why does ANOVA (and related modeling) exist as a separate technique when we have regression?
- Gaussian Processes Regression with multiple input frequencies
- Convergence of linear regression coefficients
- The Linear Regression model is computed well only with uncorrelated variables
- How does the probabilistic interpretation of least squares for linear regression works?
- How to statistically estimate multiple linear coefficients?
- Ridge Regression in Hilbert Space (RKHS)
Related Questions in LINEAR-REGRESSION
- Least Absolute Deviation (LAD) Line Fitting / Regression
- How does the probabilistic interpretation of least squares for linear regression works?
- A question regarding standardized regression coefficient in a regression model with more than one independent variable
- Product of elements of a linear regression
- Covariance of least squares parameter?
- Contradiction in simple linear regression formula
- Prove that a random error and the fitted value of y are independent
- Is this a Generalized Linear Model?
- The expected value of mean sum of square for the simple linear regression
- How to get bias-variance expression on linear regression with p parameters?
Trending Questions
- Induction on the number of equations
- How to convince a math teacher of this simple and obvious fact?
- Find $E[XY|Y+Z=1 ]$
- Refuting the Anti-Cantor Cranks
- What are imaginary numbers?
- Determine the adjoint of $\tilde Q(x)$ for $\tilde Q(x)u:=(Qu)(x)$ where $Q:U→L^2(Ω,ℝ^d$ is a Hilbert-Schmidt operator and $U$ is a Hilbert space
- Why does this innovative method of subtraction from a third grader always work?
- How do we know that the number $1$ is not equal to the number $-1$?
- What are the Implications of having VΩ as a model for a theory?
- Defining a Galois Field based on primitive element versus polynomial?
- Can't find the relationship between two columns of numbers. Please Help
- Is computer science a branch of mathematics?
- Is there a bijection of $\mathbb{R}^n$ with itself such that the forward map is connected but the inverse is not?
- Identification of a quadrilateral as a trapezoid, rectangle, or square
- Generator of inertia group in function field extension
Popular # Hahtags
second-order-logic
numerical-methods
puzzle
logic
probability
number-theory
winding-number
real-analysis
integration
calculus
complex-analysis
sequences-and-series
proof-writing
set-theory
functions
homotopy-theory
elementary-number-theory
ordinary-differential-equations
circles
derivatives
game-theory
definite-integrals
elementary-set-theory
limits
multivariable-calculus
geometry
algebraic-number-theory
proof-verification
partial-derivative
algebra-precalculus
Popular Questions
- What is the integral of 1/x?
- How many squares actually ARE in this picture? Is this a trick question with no right answer?
- Is a matrix multiplied with its transpose something special?
- What is the difference between independent and mutually exclusive events?
- Visually stunning math concepts which are easy to explain
- taylor series of $\ln(1+x)$?
- How to tell if a set of vectors spans a space?
- Calculus question taking derivative to find horizontal tangent line
- How to determine if a function is one-to-one?
- Determine if vectors are linearly independent
- What does it mean to have a determinant equal to zero?
- Is this Batman equation for real?
- How to find perpendicular vector to another vector?
- How to find mean and median from histogram
- How many sides does a circle have?
$\hat{y} = X(X^TX)^{-1} X^T y = Hy$ and if $y \sim N(X\beta, \sigma^2 I)$, it follows that $\hat{y}$ is a linear transformation of $y$ and so is also Gaussian. We have
$$ E[\hat{y}] = E[X(X^TX)^{-1} X^T y] = X(X^TX)^{-1} X^T E[y] = X(X^TX)^{-1} X^T X \beta = X\beta $$ and \begin{align*} \text{var}[\hat{y}] &= X(X^TX)^{-1} X^T \text{var}(y) X (X^T X)^{-1}X^T\\ &= X(X^TX)^{-1} X^T \sigma^2 I X (X^T X)^{-1}X^T\\ &=\sigma^2 X(X^T X)^{-1}X^T \end{align*}
In summary
$$ \hat{y} \sim N(X\beta, \sigma^2 X(X^T X)^{-1}X^T) = N(X\beta, \sigma^2H) $$
So if we want to compute $E[\| \hat{y} \|^2]$ your working is mostly correct up to the point \begin{align*} E[\text{tr}(yy^T H)] &= \text{tr}(E[yy^T]H)\\ &=\text{tr}((X\beta \beta^T X^T + \sigma^2I)H)\\ &=\text{tr}(X\beta \beta^T X^TH) + \sigma^2 \text{tr}(H)\\ &=\text{tr}(X\beta \beta^T X^T (X(X^TX)^{-1}X^T)) + \sigma^2 \text{tr}(H)\\ &=\text{tr}(X\beta \beta^TX^T) + \sigma^2 \text{tr}(H)\\ &=\text{tr}(X\beta \beta^TX^T) + \sigma^2 \text{tr}(H)\\ &=\text{tr}((X\beta)^TX\beta ) + \sigma^2 \text{tr}(H)\\ &=\| X\beta\|^2_2 + \sigma^2 \text{tr}(H)\\ \end{align*}
More generally, for $Z \sim N(\mu, \Sigma)$ $$ E[\|Z\|^2_2] = \| \mu\|^2_2 + \text{tr}(\Sigma) $$
so we could have derived the result directly by noting that $\hat{y}$ has a multivariate normal distribution. Also note that $\text{tr}(H) = \text{rank}(X)$.
It is also not a good idea (in my opinion at least) to use sample notation for population quantities, i.e.
$$ \bar{y} = \frac{1}{n}\sum_{i=1}^n y_i $$ is the sample average, and in your last line you should write
$$ \frac{1}{n}\sum_{i=1}^n E[y_i] = \frac{1}{n}\sum_{i=1}^n \mu = \mu $$ since they are i.i.d.