Consider the following two assets. The return on asset 1 has an expected value of 16.4% and a volatility of 20.2%. The return on Asset 2 has an expected value of 18.0% and a volatility of 25.0%. The correlation between these two returns is 0.19.
Write a function called get_portfolio_return that will compute the expected return and volatility of a portfolio of two assets. The first line of your function file the functions signature or declaration must be:function [E_Rp, sigma_Rp] = get_portfolio_return( weight,exp_rets, vols, corr) where weight is a 11 scalar denoting the weight of Asset 1 in the portfolio, exp_rets is a 21 vector of expected returns of the two assets, vols is a 21 vector of volatilities of the two assets, and corr is a 11 scalar denoting the correlation between the two assets. Your function must create two outputs the expected return and volatility of the portfolio and store them in variables E_rp and sigma_Rp.Note: your function must work for any two assets. In other words, the specific values for expected returns, volatilities, correlation, and weights must be passed into the function as arguments, not defined in the function code itself.Your function must have comments under the first line that explain what the function does, what inputs it takes in, and what outputs it returns. See the functions we wrote in class for an example of what such a comment looks like.The code answer to this part of the question should be the entirety of your function. The output answer to this part of the question should be the output of the command help portfolio_return.
Use your function to compute the expected return and volatility of a portfolio that invests 40% in Asset 1 and the remainder in Asset 2. Report the results in percent with 1 decimal place e.g. 11.3%.
In this part, you will use your function to compute the investment opportunity set for these two assets the set of expected returns and volatilities achievable with all long positions in these two assets.Define a 1001 vector of equally-spaced Asset 1 weights from 0 to 1. Use a for loop to compute expected returns and volatilities for each weight in this vector. Store the results in two 1001 vectors one for expected returns and one for volatilities.Plot the Investment Opportunity Set. Label the horizontal axis Portfolio Volatility. Label the vertical axis Portfolio Expected Return. Title your plot Part (c): Investment Opportunity Set.Describe the relationship between risk and return apparent in your plot.
Now lets consider how correlation affects the portfolio return and volatility. Fix the weight of Asset 1 at 30%. Use a for loop to compute the portfolio return and volatility for the following different 6 correlation values: -1.0, -0.5, 0, 0.5, and 1.0 as well the original value of 0.19. Store the results in two 61 vectors one for expected returns and one for volatilities.Report two outputs:First, check if the expected returns change as you vary correlations. Use an if statement to print Part (d): Expected returns are equal if all 6 expected returns are equal and print Part (d): Expected returns are not equal otherwise. To check if all elements are equal, you can compare the vectors maximum and minimum value. Second, Professor Vadim Elenev wrote a function construct_bar_chart.m to help you plot bar charts. Use this function to plot a bar chart of volatilities for every correlation. The vertical axis label should read Portfolio Volatility and title Part (d): Volatilities When Asset 1 Portfolio Weight is = 0.4. Use help construct_bar_chart to find out what inputs the function takes, and pass on appropriate values accordingly.
Create another function called get_portfolio_return_vec that will compute portfolio expected return and volatility for multiple correlation values at once. It should take the same inputs and produce outputs as get_portfolio_return, except: corr should be a 1 x n vector for n different values of correlation sigma_Rp should be a 1 x n vector, one volatility for each value of the correlationUse your code for get_portfolio_return as the base, and modify where necessary to allow vectorization. Dont forget to update the comment. Remember a scalar times a vector returns a vector in MATLAB.
Report the output of help get_portfolio_return_vec.Use the new function to re-do part (d). Use the equality operator to compare the answers of (d) to the answers of (e) for each of 6 correlation values. Report the results of these comparisons.
Use the new function to re-do part (c) for each of the 6 correlation values. Store the results in a 100 x 1 vector of expected returns and a 100 x 6 matrix of portfolio volatilities, where the (i,j)th element is the volatility of the portfolio with the ith weights when the correlation is jth of 6 possible correlation values.Use a for loop together with the hold on command to plot all 6 investment opportunity sets on the same graph. Label axes and titles as in part (c). Use legend to label the different curves.As correlations increase, how does the investment opportunity set change?
For each correlation, identify the minimum variance (MV) portfolio i.e. the portfolio weights and corresponding return and volatility that produces the lowest possible volatility. To do this, use both outputs of the min function the minimum value and the array index of this minimum value.
Use the supplied construct_bar_chart function to plot 3 bar charts showing the volatilities, weights, and expected returns of the 6 MV portfolios. Label the vertical axes and title the plots appropriately using the arguments of the supplied function.Looking at your plots, at which correlation is the smallest volatility attained? At which is the highest attained? How does the weight on Asset 1 change as correlation increases? Can you explain why?
Programming
[SOLVED] matlab scala graph Consider the following two assets. The return on asset 1 has an expected value of 16.4% and a volatility of 20.2%. The return on Asset 2 has an expected value of 18.0% and a volatility of 25.0%. The correlation between these two returns is 0.19.
$25
File Name: matlab_scala_graph_ Consider_the_following_two_assets._The_return_on_asset_1_has_an_expected_value_of_16.4%_and_a_volatility_of_20.2%._The_return_on_Asset_2_has_an_expected_value_of_18.0%_and_a_volatility_of_25.0%._The_correlation_between_these_two_returns_is_0.19..zip
File Size: 2496.3 KB
Only logged in customers who have purchased this product may leave a review.
Reviews
There are no reviews yet.