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 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[idx, :] 6)y_no_outliers = y[idx] 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?