Download presentation
Presentation is loading. Please wait.
1
1 MF-852 Financial Econometrics Lecture 2 Matrix Operations in Econometrics, Optimization with Excel Roy J. Epstein Fall 2003
2
2 Matrix Application in Excel: Curve Fitting Data for 3 different years as follows: YearValue 115 745 2560 Fit a smooth curve through these points using a quadratic (2 nd degree) polynomial. Why does a parabola work?
3
3 Quadratic Equation System x i = year i, y i = data for year i Knowns: x and y Unknowns:
4
4 Matrix Solution for Can solve when X has an inverse! Must be square, non-singular matrix
5
5 Matrix Solution for
6
6 Excel Graph
7
7 Sum of Squares Suppose Then
8
8 Cross-Products Matrix Suppose m > n and Does X –1 exist? XX is the cross-products matrix.
9
9 Cross-Products Matrix XX = Can (XX ) –1 exist?
10
10 Exact Linear Model y is dependent variable (a vector). 3 independent variables: x 1, x 2, x 3 (each is a vector). Each observation is of the form The ’s are unknown and have to be estimated from the data.
11
11 Matrix Setup
12
12 Model Dimensionality Model is y = X . How many equations? How many unknowns? Is there a solution?
13
13 Solution to Linear Model Multiply through by X X y = X X How many equations, how many unknowns? Solution is = (X X ) –1 X y
14
14 Linear Regression Model Each observation is of the form e i is “noise” or an “error” term. Why would a model contain an error term?
15
15 Solution to Regression Model Multiply through by X X y = X X + X e Suppose X e = 0. What are the implications? Then solution is = (X X ) –1 X y
16
16 Regression Example RR: Dataset data4-1 Model of housing prices as function of house characteristics Price = f(sq. ft., # bedrooms, # baths)
17
17 Constrained Optimization We often need to maximize (or minimize) a function subject to constraints on the function’s arguments. E.g. Maximize a 1 x 1 + a 2 x 2 + a 3 x 3 subject to b 11 x 1 + b 12 x 2 + b 13 x 3 c 1 b 21 x 1 + b 22 x 2 + b 23 x 3 c 2 Knowns: a i, b i, c i Unknowns: x i
18
18 Matrix Notation Use Excel Solver to find solution.
19
19 Example — Bond Portfolio Maximize expected after-tax return subject to constraints on portfolio characteristics InstrumentAfter-tax yield Maturity T-bill4.85%0.5 T-bond6.88%18.5 State bond8.05%19.4 Local bond7.65%7.3 Corporates7.34%24.4
20
20 Constraints No more than 32% of portfolio in any one instrument At least 12% in T-bills No more than 50% in state and local combined Weighted average maturity cannot exceed 12 years
21
21 Problem Set-Up Max.0485x 1 +.0688x 2 +.0805x 3 +.0765x 4 +.0734x 5 s.t. x 1 + x 2 + x 3 + x 4 + x 5 = 1 x 1 0.32 x 2 0.32 x 3 0.32 x 4 0.32 x 5 0.32 x 3 + x 4 0.50 0.5x 1 + 18.5x 2 + 19.4x 3 + 7.3x 4 + 24.4x 5 12 x 1 0.12
22
22 Solution (Excel) Set up solver create cells in spreadsheet for objective function, vector Bx of constraints specify objective function, max/min, cells to vary (i.e., x), and add constraint vector c) Solution vector is x 1 = 17.3% x 2 = 32.0% x 3 = 18.0% x 4 = 32.0% x 5 = 0.7%
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.