Assigment (Econometrics and Matlab Codes)
Assigment (Econometrics and Matlab Codes)
Assigment (Econometrics and Matlab Codes)
Student’s Name:
Professor:
Course:
Date:
Assignment
Question 1
Y = βX+ u
X ∼ N ( μ x , σ 2x ) ,u ∼ N (0 , σ 2)
Solution
COV ( XY )
corr ( XY ) =
Var ( x ) var ( y )
COV ( XY )
β=
var ( x )
β
corr ( XY ) =
var ( y )
β
corr ( XY ) =
β σ 2x + σ 2
2
β μx
μx
corr ( XY ) = 2 2 2
β σ x+ σ
2
Question 2
White’s covariance estimator is the most commonly used strategy to deal with the likelihood of
heteroskedasticity-consistent standard errors and it was developed by white. It is similar to the
Breusch-Pagan test. It should be used as the z variables with all variables in its original
equation. The squares of x variables should be computed or the cross products of x variables. It
should not be used where dummies are included in the squares.
Question 3
y i=a+b x i+ ei
e i= y i−a−b x i
n
2
mina ,b E [ (Y −a−bX ) ]=mina ,b E ∑ ( y ¿ ¿i−a−b x i ¿ )2 ¿ ¿
i=1
n n
∂
min E ∑ ( y ¿ ¿ i−a−b x i ¿ )2=−2 ∑ ( y ¿ ¿ i−a−b x i ¿ )=0 ¿ ¿ ¿ ¿
∂a a ,b i=1 i=1
n n
∑ yi −na−b ∑ xi =0
i=1 i=1
n n
na=∑ y i−b ∑ x i
i=1 i =1
n n
∑ y i−b ∑ x i
a= i=1 i=1
= ý−b x́
n
n n
∂
min E ∑ ( y ¿ ¿ i−a−b x i ¿ )2=−2 ∑ ( y ¿ ¿ i−a−b x i ¿ ) x i=0 ¿ ¿ ¿ ¿
∂b a ,b i=1 i=1
n
¿−2 ∑ ( y ¿ ¿ i−a−b x i ¿) x i=0 ¿ ¿
i =1
∑ (x ¿¿ i y ¿¿ i− ý xi +b x́ xi −b xi2¿)=0¿ ¿ ¿
i=1
∑ ( y ¿ ¿ i− ý +b x́−b x i ¿ ) x i=0 ¿ ¿
i=1
∑ ( y ¿ ¿ i− ý +b x́−b x i ¿ )=0 ¿ ¿
i=1
n n
∑ ( y ¿¿ i− ý )−b ∑ ( xi −x́)=0¿
i=1 i=1
n n
b ∑ (x i−x́)=∑ ( y ¿¿ i− ý )¿
i=1 i=1
Question 4
For asset i
This is a better asset for I , the regression coefficient β i serves as an important measure of
individual assets risks called portfolios that is different from σ 2 which measures the no
diversifiable risk part.
Question 5.
4
GRS test on a model that uses industrial popularion growth can be used since GRS test is
statistical F-test for the hypothesis that all coeffients are equal to zero for a linear model. From
the provided equation it is clear that the model is a linear and therefore GRS can be used.
Question 6
Pricing errors are not correlated with betas in a test of a factor pricing model on industry
portfolios because cross-sectional estimate sets the cross-sectional correlation between right-
hand variables (betas) and error terms (pricing errors) to zero by construction.
Question 7
“My beta is your alpha” statement contains two main measurements that is beta and alpha.
These two measures are used to evaluate the stock performance, investment portfolio, or fund.
Beta measures the volatility of the investment or it indicates the relative risk. Alpha measures the
amount of investment that has been returned as compared to market index or any other broad
benchmark. The statement means that the relative risk of the company is same to the amount of
investment returned by the other company in comparison to market index.
Question 8
α i=0.05352 , this indicates that the investment outperformed its benchmark index
by 5.352%.
β i=1.4622 , the company has a beta of 1.4622, indicating that the company is exceeds the
market volatility by 46.22%.
μ' μ 4.594
b. R−Square=1− ' =1− =1−0.3119=0.6881
y y 14.730
This indiactes that 68.81% of the variation in the model is explained by the inputs.
c.
i. test the null of H0 : αi = 0 at the 10% significance level
H 0 :α i =0 vs.
H 1 : αi ≠ 0
0.05352−0
t−statistic= =4.316
0.0124
Reject null hypothesis and conclude that αi is not equal to 0
ii. test the null of H0 : βi = 1.1 at the 10% significance level.
H 0 : βi =1.1vs.
5
H 1 : : β i ≠1.1
1.4622−1.1
t−statistic= =1.1535
0.3140
Reject null hypothesis and conclude that β i is equal to 1.1
Question 9
a. Increasing portfolios reduces mean excess returns and alphas. Taking it the to have
negatives returns until Ls1090 which takes the excess returns back to the positive side.
Adding more factors helps in controlling the size of alphas.
b. 3-factor betas increase across the table as the portfolio sizes increases. It shows a
negative association with an increase with the portfolio sizes. The most significant
portfolio is of size 9900 because it has the greatest ratio of alpha versus standard error.
Making it the most significant.
c. The asset pricing model in this scenario is anomaly because it has a pattern in average
stock returns that is inconsistent with prevailing models of asset-price behavior.
6
d. The most reasonable interval for price of risk is between -1.435 and -1.215 because this is
the most significant interval and it does not include zero meaning that it is the most
significant interval.
Coding
9. matlab code that return probability density function of a normal distribution at point x is
mu = [-2,-1,0,1,2];
sigma = 1;
y = normpdf(0,mu,sigma)
10.
a). Line 3 is unnecessary because there is no preceding code that defines T. This can be
corrected by defining the value of variable T in line 2.
line 3-7 assigns and provides the formula for bhat , giving the necessary values for the inputs
of the formula in line 7.
Line 9-13 gives the first condition when i=1 and natural numbers are used.
d). These codes computed Harmonic and geometric mean of natural numbers. It defines the
values of x and y by providing their formulas. Allocation is made in percentages as
7
demonstrated above. One factor and N excess returns Re of data length T forming a TxN
matrix.