420_exam2_practice

pdf

School

Rumson Fair Haven Reg H *

*We aren’t endorsed by this school

Course

420

Subject

Economics

Date

Nov 24, 2024

Type

pdf

Pages

9

Uploaded by CoachRiverTiger30

Report
Practice Exam 2, Econ 420 (key and discussion are in the end) Total points are 100. But it counts 20% toward your final grade. So the effective total points are 20 Note: please write legibly Last Name First Name Consider the following R codes for a quadratic programming problem Dmat = matrix(c(2,0,0,4),2,2,byrow=T) dvec = c(4,8) Amat = matrix(c(0,0,0,0),2,2,byrow=T) bvec = c(0,0) solve.QP(Dmat,dvec,Amat,bvec) Q1 (5 points) Please use math (either by completing the squares or taking derivatives) to find the solution x * 1 and x * 2 . How much is the minimized value? Q2 (5 points) Continue Q1. Now consider adding the constraint using the R codes Amat = matrix(c(1,-1,0,1),2,2,byrow=T) bvec = c(5,3) please mathematically show me the constraint. 1
Q3 (5 points) Continue Q2. Do you expect to see new solution x * 1 and x * 2 after these con- straints are added? Why? (you do not need to find the new solution) Q4 (5 points) How to tell whether a matrix a b c d ! is positive definite? Q5 (5 points) How to ensure an algorithm gives us a global minimum other than a local minimum? 2
Consider constructing a portfolio based on the three assets with the following information. Complete Q6, Q7, Q8 and Q9 miu1 = 5;s1 = 4; miu2=8; s2 = 5; miu3=7; s3 = 4.5 rho12 = -0.5; rho13 = -0.3; rho23 = 0.4 Q6 (5 points) Please compute the covariance between the second and third assets. What does the sign of that covariance imply? An investor has a targeted return of 6 from the portfolio. The incomplete R codes of constructing that portfolio are below, and please complete the blanks var.port = function(co) { w1 = co[1] w2 = Blank A w3 = Blank B wv = c(w1,w2, w3) return(sqrt(t(wv)%*%sigma%*%wv)) } optim(Blank C) Q7 (5 points) Answer: blank A = Q8 (5 points) Answer: blank B = Q9 (5 points) Answer: blank C = 3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Q10 (5 points, True or False and Why) We want to consider using tree model when the relationship between y and x is linear. Consider the following tree model of using years to predict log salary years < 5 5.1 6.4 yes no Q11 (5 points) Please explain the number 6.4 on the right branch 4
Q12 (10 points) Please explain how to run a regression and how to get that number 6.4 based on the regression result Consider the following decision boundary diagram. Answer Q13-14 -2 -1 0 1 2 -2 -1 0 1 2 x1 x2 Q13 (5 points) Please explain why there are some red triangles above the blue dash line. 5
Q14 (10 points) Please explain what would happen to the decision boundary diagram if we change the sign of coefficient of x 1 . Q15 (10 points) Please briefly describe the KNN classier. Q16 (10 points) Please explain the difference between Cournot Nash Equilibrium and Stack- elberg Nash Equilibrium. 6
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Key and Discussion Note: more detailed answers are expected for actual exam. Q1: The objective function is x 2 1 + 2 x 2 2 - 4 x 1 - 8 x 2 . After completing the squares we get ( x 1 - 2) 2 + 2( x 2 - 2) 2 - 12 ≥ - 12 . Thus the solutions are x * 1 = 2 , x * 2 = 2 , and the minimized value is - 12 . Alternatively, we can take two derivatives, set them to zero, and the first order conditions are 2 x * 1 - 4 = 0 , 4 x * 2 - 8 = 0 . Solving them leads to x * 1 = 2 , x * 2 = 2 . Plugging those values back to x 2 1 + 2 x 2 2 - 4 x 1 - 8 x 2 , we get - 12 . Q2: The constraints are 1 - 1 0 1 ! 0 x 1 x 2 ! 5 3 ! 1 0 - 1 1 ! x 1 x 2 ! 5 3 ! Applying the transpose of a matrix and definition of inner product, we get x 1 5 , x 2 - x 1 3 . Q3: Because x * 1 = 2 , x * 2 = 2 satisfy neither of those two inequalities, so we expect to see new solutions to differ from old solutions. In other words, the two constraints are both binding. (Discussion, not required by exam) After we run those codes in R we get $‘solution‘ [1] 5 8 $value [1] 69 So the new solutions with constraints are x * 1 = 5 , x * 2 = 8 . The new minimized value is 69. Q4: The two conditions are a > 0 , ad - bc > 0 ( or d - bc a > 0) 7
Q5: A numerical method in general leads to a local minimum. To ensure we get a global minimum we should try different initial values, and compare the possibly multiple local minimums. Pick the smallest one. Q6: σ 23 = ρ 23 s 2 s 3 = (0 . 4)(5)(4 . 5) = 9 , which is positive, implying that the prices of the second and third assets on average move in the same direction Q7: blank A is 2 * w 1 - 1 Q8: blank B is 2 - 3 * w 1 Q9: blank C is c(0.1), var.port Q10: False. The main reason for using a tree model is to account for the nonlinear relationship between y and x Q11: 6.4 is the mean of log salary conditional on years are greater than or equal to 5. That number is the predicted log salary for players with years greater than or equal to 5. Q12: First we need to generate a dummy variable d i = 0 if years < 5 1 if years 5 and then run the regression logsalary i = β 0 + β 1 d i + e i The number 6.4 is β 0 + β 1 Q13: because of error term. Those naughty points will disappear if there is no other factors Q14: The blank and red points will switch horizontally and the blue dash line will become downward sloping 8
Q15: see class note Q16: There is Cournot Nash Equilibrium (CNE) when the two firms make decisions at the same time; there is Stackelberg Nash Equilibrium (SNE) when one firm leads and the other firm follows. 9
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help