As we know, bo and bį are the least squares estimators of the unknown parameters Bo and Bi of simply linear regression m
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
As we know, bo and bį are the least squares estimators of the unknown parameters Bo and Bi of simply linear regression m
As we know, bo and bį are the least squares estimators of the unknown parameters Bo and Bi of simply linear regression model, respectively. In this question, we will study the correlation between bo and by both from theory and numerical simulations. The simulation codes are provided as follows: # Set your Uni ID number as the seed of random number generator. # For example, if your Uni ID is u1234567, then use # set.seed (1234567) x <- 1:10 n <- length(x) estimates <- matrix(NA, 1000, 2) names (estimates) <- c("b0", "b1") for(r in 1:1000) { y <- 1 + 2*x + rnorm(n,0,2) estimates [r,] <- lm(y-x)$coefficients } (a) [4 marks] Show the covariance of bo and b1: Cov(bo, bı) X Sxx Note that you cannot use the matrix approach introduced in week 6. (b) (4 marks] Write down the true model and the distribution of the error terms used in the simulation. Based on this model, calculate the values of the theoretical covariance and correlation of bo and bi.