Answered step by step
Verified Expert Solution
Question
1 Approved Answer
We have the following inputs into the optimization problem: RET: a 1801 vector of expected returns BETA: a 1801 vector of market betas RF: risk-free
We have the following inputs into the optimization problem: RET: a 1801 vector of expected returns BETA: a 1801 vector of market betas RF: risk-free rate =2.78% COV MAT: a 180180 Ledoit-Wolf covariance matrix of returns. Which set of contraints do we need to provide in the Python code below? from scipy.optimize import minimize def objective(weights, Eret, RF, cov): Risk_premium = weights.T @. Eret - RF portfolio_volatility = np.sqrt(weights.T @.cov @.weights) sharpe_ratio = Risk_premium / portfolio_volatility return -sharpe_ratio \# Define the constraint(s) constraints = [ THS INFORMATION IS MIS SING ] \# YOU NEED TO PROVIDE THIS INFORMATION \# Initial guess initial_weights = np.repeat (1/N,N) \# Solve the optimization problem result = minimize(objective, initial_weights, args =( RET, RF, COV_MAT), method='SLSQP', constraints=constraints a. constraints =[ \{'type': 'ineq', 'fun': lambda x:x.T@ betas.MKT - 0}, \{'type'. 'ineq', 'fun': lambda x: 2.0 - np.sum(np.abs(x))\} ] b. constraints =[ \{'type': 'eq', 'fun': lambda x: np.sum(x) - 0\}, \{type'. 'ineq', 'fun'. lambda x:x.T@ betas.MKT - 1.0\}, \{'type': 'ineq', 'fun': lambda x: 2.0 - np.sum(np.abs(x))\} ] c. constraints = \{type': 'eq', 'fun": lambda x: np.sum(minimum (x,0))0}, \{type'. 'ineq', 'fun': lambda x:x.T @ betas.MKT - 2.0\}, \{'type': 'ineq', 'fun': lambda x : 0 - np.sum(np.abs(x))\} ] d. constraints =[ \{'type': 'eq', 'fun': lambda x : np.sum (x)=0} \{type': 'ineq', 'fun': lambda x:x.T@ betas.MKT =0}, \{'type': 'ineq', 'fun': lambda x : np.sum(np.abs(x))
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started