def max_sharpe(self, risk_free_rate=<NUM_LIT>):
if not isinstance(risk_free_rate, (int, float)):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>args = (self.expected_returns, self.cov_matrix, self.gamma, risk_free_rate)<EOL>result = sco.minimize(<EOL>objective_functions.negative_sharpe,<EOL>x0=self.initial_guess,<EOL>args=args,<EOL>method="<STR_LIT>",<EOL>bounds=self.bounds,<EOL>constraints=self.constraints,<EOL>)<EOL>self.weights = result["<STR_LIT:x>"]<EOL>return dict(zip(self.tickers, self.weights))<EOL>
Maximise the Sharpe Ratio. The result is also referred to as the tangency portfolio,
as it is the tangent to the efficient frontier curve that intercepts the risk-free
rate.

:param risk_free_rate: risk-free rate of borrowing/lending, defaults to 0.02
:type risk_free_rate: float, optional
:raises ValueError: if ``risk_free_rate`` is non-numeric
:return: asset weights for the Sharpe-maximising portfolio
:rtype: dict