Question

In: Advanced Math

how to represent the following in a linear model y=Xb + e where b' = (u,a1,a2,a3,y1,y2,y3)...

how to represent the following in a linear model y=Xb + e where b' = (u,a1,a2,a3,y1,y2,y3) and e'=(e11,e12,e13,e21,e22,e23,e31,e32,e33)

' means transpose

y11=u+a1+y1+e11

y12=u+a1+y2+e12

y13=u+a1+y3+e13

y21=u+a2+y1+e21

y22=u+a2+y2+e22

y23=u+a2+y3+e23

y31=u+a3+y1+e31

y32=u+a3+y2+e32

y33+u+a3+y3+e33

X is a matrix pattern but I am confused about 1 and 0 placement

Also can X'X and X'y be determined and written in normal equations

Solutions

Expert Solution

MATLAB Code:

close all
clear
clc

syms e11 e12 e13 e21 e22 e23 e31 e32 e33
syms u a1 a2 a3 y1 y2 y3
assume(e11, 'real'); assume(e12, 'real'); assume(e13, 'real');
assume(e21, 'real'); assume(e22, 'real'); assume(e23, 'real');
assume(e31, 'real'); assume(e32, 'real'); assume(e33, 'real');
assume(u, 'real'); assume(a1, 'real'); assume(a2, 'real'); assume(a3, 'real');
assume(y1, 'real'); assume(y2, 'real'); assume(y3, 'real');

X = [1 1 0 0 1 0 0;
1 1 0 0 0 1 0;
1 1 0 0 0 0 1;
1 0 1 0 1 0 0;
1 0 1 0 0 1 0;
1 0 1 0 0 0 1;
1 0 0 1 1 0 0;
1 0 0 1 0 1 0;
1 0 0 1 0 0 1]
b = [u a1 a2 a3 y1 y2 y3]'
e = [e11 e12 e13 e21 e22 e23 e31 e32 e33]'

y = X*b + e;
disp('Hence, y = X*b + e ='), disp(y)

disp('X''X ='), disp(X'*X)
disp('X''y ='), disp(X'*y)

Output:


Related Solutions

A four-bit binary number is represented as A3A2A1A0, where A3, A2, A1, and A0 represent the...
A four-bit binary number is represented as A3A2A1A0, where A3, A2, A1, and A0 represent the individual bits and A0 is equal to the LSB. Design a logic circuit that will produce a HIGH output whenever the binary number is greater than 0010 and less than 1000. how can I do this by using sum of product, not K map
In the simple linear regression model, y=Bo +B1x + u, suppose that E(u) is not equal to 0
In the simple linear regression model, y=Bo +B1x + u, suppose that E(u) is not equal to 0. Letting a0 = E(u), show that the model can always be written with the same slope, but a new intercept and error has a zero expected value.
Consider the simple linear regression model y = 10+25x+e where the random error term is normally...
Consider the simple linear regression model y = 10+25x+e where the random error term is normally and independently distributed with mean zero and standard deviation 2. Do NOT use software, generate a sample of eight observations, one each at the levels x = 10, 12, 14, 16, 18, 20, 22, and 24. DO NOT USE SOFTWARE! A.Fit the linear regression model by least squares and find the estimates of the slope and intercept. B.Find the estimate of s^2. C. Find...
Suppose the following linear probability model Y = 0.708 + 0.201M, n=1,989, R2=.049. (0.018) (0.020) Where...
Suppose the following linear probability model Y = 0.708 + 0.201M, n=1,989, R2=.049. (0.018) (0.020) Where y=1 if mortgage approved, M=1 if men, etc. 1. What is the probability of mortgage approval for a typical male applicant? 2. What is the probability of mortgage approval for a typical female applicant? 3. Is the discrimination based on gender significant? 4. What are the problems of this model? 5. What other variables do you think should be added in the model? And...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT