程序代做 Lecture 0B: Matrices in Finance and Matlab

Lecture 0B: Matrices in Finance and Matlab
Economics of Finance
School of Economic, UNSW1

Copyright By PowCoder代写 加微信 powcoder

• CaPiTaLiSaTiOn matters
• Scripts and functions can are saved in separate .m files
• Folder containing the scripts and functions must be Current Folder or you need to “Set Path”

Tables as Matrices
It is often desirable to think of matrices as the “inside” of tables. For example, matrix Q might contain the values of the following table
Tue 55 18
Wed 56 27
This is a matrix with dimensions days × assets, in this case 3 × 2. In MATLAB we’ll write
>> Q = [54 21; 55 18; 56 27];

Example: Asset allocation with investment funds
Funds Allocation, matrix A: Fund A
Fund B 0.20 0.50 0.30
Fund C 0.00 0.30 0.70
Domestic Bonds Domestic Stocks Foreign Stocks
Portfolio, vector x: Fund A 0.20 Fund B 0.30 Fund C 0.50
0.60 0.40 0.00

Asset allocation
• What is the Investor’s current allocation among the three major asset classes?
• WeknowthatAx=b:
0.6 0.2 0.00.2 0.18 0.4 0.5 0.30.3=0.38 0.0 0.3 0.7 0.5 0.44
How do we interpret b?

Funds Allocation, matrix A:
Fund Allocations
Fund A 0.60 0.40 0.00
Fund B 0.20 0.50 0.30
Fund C 0.00 0.30 0.70
Desired Allocation, vector b: 0.15
For S 0.50
• What should be the portfolio in terms of fund’s investment to obtain the desired allocation?
• Ax=b⇒A−1Ax=A−1b⇒x=A−1b

Desirable Portfolio
Now let’s suppose there is only two funds in the market:
Fund A 0.60 0.40 0.00
Fund B 0.20 0.50 0.30
Desired Allocation, vector b: 0.15
For S 0.50
• What should be the portfolio in terms of fund’s investment to obtain the desired allocation?
• not possible to answer: A is not square

Return and Variance
For a portfolio with each asset i weights Wi: • Portfolio Return = 􏰗∞i=1 WiRi=WTR
• Portfolio Variance = 􏰗∞i=1 􏰗j=1 WiWjσij=WTσW
• σij is covariance of asset i with asset j; • Ri is the return of each asset
Ri = P1/P0 − 1

An investor is constructing a 3-asset portfolio, denoted as X, with allocation of $0.25 million, $0.10 million and $0.65 million on assets A, B and C respectively. The expected returns for A, B and C are 10%, 11% and 12% respectively.
The covariance matrix of the portfolio is given below:
Formulate a Matlab function to determine the portfolio return and standard deviation.

Weight matrix and returns can be found as follows: WT = 􏰀 0.25 0.10 0.65 􏰁
 0.10  R= 0.11 
So, the return of portfolio:
RX = WTR = 0.114 = 11.4% (1)

Given that:
 0.25 0.078 σ =  0.078 0.35
0.09 0.053
 0.25 W= 0.10 0.65
0.09  0.053 
Variance of the portfolio can be found by: WTσW = 0.2620
Homework: Use Matlab to express, and calculate these!

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com