Difference between revisions of "Midterm Study Guide"

From Quantitative Analysis Software Courses
Jump to navigation Jump to search
Line 21: Line 21:
 
* Beta_A = 0.5, Beta_B = 1.0
 
* Beta_A = 0.5, Beta_B = 1.0
 
* alpha_A = 5%, alpha_B = -10%
 
* alpha_A = 5%, alpha_B = -10%
 +
 +
5. Write the equation for Sharpe Ratio using 6 months of data assuming returns are calculated monthly or weekly.
 +
 +
6. What is the output of the following code snippet?
 +
 +
<PRE>
 +
import numpy as np
 +
A = np.ones((3,3))
 +
w = np.array([0.0, 0.1, 0.2])
 +
print (A*w).sum()
 +
print (A*w).sum(axis=0)
 +
print (A*w).sum(axis=1)
 +
</PRE>

Revision as of 16:51, 19 October 2015

1. Fill in section A to complete code that will cause the following output:

import numpy as np
j = np.random.random([2,2])
print j
print _A_ 

Output:

[[ 0.1624438 ,  0.14157016],
[ 0.07818402,  0.85854546]]
[[ 1.        ,  1.        ],
[ 0.48129886,  6.06445229]])

2. Why (or why not) is Sharpe Ratio a better measure of portfolio performance than cumulative return?

3. Suppose we have a group of N assets in our portfolio with allocation w_i to each asset i, each with a specific Beta_i and alpha_i. Write an equation that describes the expected return of the entire portfolio in terms of the market return r_m.

4. Assume two stocks, A and B, that you’d like to combine into a portfolio with weights w_a, w_b respectively. You have calculated Beta values and estimated alphas for each. Your objective is to gain positive return while minimizing market risk. Utilize CAPM to find the weights that achieve this goal. Assuming your estimates of alpha are correct, what is your expected return?

  • Beta_A = 0.5, Beta_B = 1.0
  • alpha_A = 5%, alpha_B = -10%

5. Write the equation for Sharpe Ratio using 6 months of data assuming returns are calculated monthly or weekly.

6. What is the output of the following code snippet?

import numpy as np
A = np.ones((3,3))
w = np.array([0.0, 0.1, 0.2])
print (A*w).sum()
print (A*w).sum(axis=0)
print (A*w).sum(axis=1)