Suppose we consider a one-step binomial tree model to price a derivative that pays in the up state and in the down state. What is the price of this derivative?
Consider the pseudo code below to obtain the effient portfol…
Consider the pseudo code below to obtain the effient portfolios:from scipy.optimize import minimize f = lambda w: TO BE FILLED mu = np.linspace(15, 30, 31) sd_optimal = np.zeros_like(mu) w_optimal = np.zeros() for i in range(len(mu)): # Optimization Constraints cons = ({‘type’:’eq’, ‘fun’: lambda w: np.sum(w) – 1}, {‘type’:’eq’, ‘fun’: lambda w: w @ ER * 252 * 100 – mu}) result = minimize(f, np.zeros(5), constraints=cons) w_optimal = result.x sd_optimal = np.sqrt(result.fun)Assuming that ER are Cov given, what should we substitute TO BE FILLED for in order to get the desired result?
Consider the same pseudo code from the previous question to…
Consider the same pseudo code from the previous question to compute the efficient portfolios:from scipy.optimize import minimize f = lambda w: TO BE FILLED mu = np.linspace(15, 30, 31) sd_optimal = np.zeros_like(mu) w_optimal = np.zeros() for i in range(len(mu)): # Optimization Constraints cons = ({‘type’:’eq’, ‘fun’: lambda w: np.sum(w) – 1}, {‘type’:’eq’, ‘fun’: lambda w: w @ ER * 252 * 100 – mu}) result = minimize(f, np.zeros(5), constraints=cons) w_optimal = result.x sd_optimal = np.sqrt(result.fun)For any given iteration i, what is the shape of the array w_optimal?
The law of diminishing marginal utility helps to explain why…
The law of diminishing marginal utility helps to explain why supply curves are generally upward sloping.
Suppose that you want to create a function that receives the…
Suppose that you want to create a function that receives the weights, the expected return on risky assets, and the covariance matrix between the assets, and returns the annualized portfolio volatility and expected return. def ER_SD(TO BE FILLED): ERp = w @ ER * 100 * 252 SDp = np.array(np.sqrt(w @ Cov @ w)) * 100 * np.sqrt(252) return SDp, ERpWhat should we substitute TO BE FILLED for in order to achieve the desired result?
Consider the following array: a = np.array([30, 101, 18, 190…
Consider the following array: a = np.array() If I want to select the last element of this array, what is the only option below that does not return me the element -55?
What is the main purpose of scaling your data?
What is the main purpose of scaling your data?
Consider the following matrices:
Consider the following matrices:
Consider the following code to identify outliers:1)from skle…
Consider the following code to identify outliers:1)from sklearn.ensemble import IsolationForest 2)iforest = IsolationForest(random_state=0, contamination=0.05).fit(x) 3)y_iforest = iforest.predict(x) 4)idx = (y_iforest==1) 5)x_no_outliers = x 6)y_no_outliers = y 7)print(f’Total Number of Observations: {len(y)}’) 8)print(f’Total Number of Outliers: {len(y) – len(y_no_outliers)}’)Which line has the label without outliers?
The word ‘like’ has become hackneyed. Rather than being used…
The word ‘like’ has become hackneyed. Rather than being used sparingly, people use it as verbal filler between pauses of actual verbal information. The word hackneyed as it is used in the sentence most nearly means