You are on page 1of 2

MA653P: Computational Financial Modelling Lab

Assignment 2

Name: Prachi Sharma


Roll No.: V21078
Branch: MSc Applied Mathematics
Year: 1st

Following are the inferences I have made from the results obtained and are correct up to the best of my knowledge.

For the portfolio, I have chosen three stocks from NIFTY 50, namely, HDFCBANK (Banking), ONGC (Oil & Gas), and
TCS (Technology). I have downloaded monthly stock price data of these three stocks from April 2017 to March 2022.

To calculate returns, I have used the formula:

Present Value −Past Value


Rate of Return=
Past Value
Plot for returns of these stocks:

1
671290952.docx
Next, I have randomly generated 10000 weight vectors of length 3 and scaled each vector to satisfy
i=3

∑ wi=1
i=1

Where w i represents weight of ith stock.

For scaling, we shall use the formula:

w w2 w3
^ =( i=3 1
w i=3 i=3
)
∑ wi ∑ wi ∑ w i
i=1 i=1 i=1

Next, we will form Variance-Covariance Matrix (C) for our stock data of each stock.

Finally, we will calculate portfolio risk associated with each weight vector by the formula:
2 t
^ Cw
σ =w ^
To calculate expected return of each stock, we find mean for 5*12=60 return values of each stock data.

Finally, we calculate expected portfolio return associated with each weight vector by the formula:

μ=mt w
^

Scatter Plot for Risk v/s Return of portfolio of three stocks:

2
671290952.docx

You might also like