기본 콘텐츠로 건너뛰기

令和5年5月3日気になるニュース

yahooニュース 産経新聞、首相「腹を割って意見交換」 7、8日に訪韓し尹大統領と会談  岸田文雄首相は1日(日本時間2日)、7~8日の日程で韓国を訪問し、尹錫悦(ユン・ソンニョル)大統領と会談する方向で調整(ちょうせい)していると明らかにした。訪問先(ほうもんさき)のガーナで記者団の取材に答えた。首相は尹氏が3月に来日(らいにち)した際(さい)、首脳同士が相互(そうご)に訪問する「シャトル外交」の再開(さいかい)で合意(ごうい)しており、その第1弾(いちだん)となる。 続いて、日本政府は4月28日に韓国を輸出手続き簡略化などの優遇措置の対象国となる「グループA(旧ホワイト国)」に再指定(さいしてい)する方針を発表したが、首相の訪韓(ほうかん)で成果(せいか)を示(しめ)せるかが焦点(しょうてん)になると書いていました。 日韓関係が改善されているようでうれしい記事でした。

Capital Market Line

The capital market line (CML) represents portfolios that optimally combine risk and return.

def min_func_sharpe(weights, rf=0.015):
    return -statistics(weights, rf)[2]

Function min_func_sharpe export sharpe ratio.

cons = ({'type': 'eq', 'fun': lambda x:  np.sum(x) - 1})
bnds = tuple([(0, 1) for x in range(noa)])
noa * [1. / noa,]

opts = opt.minimize(min_func_sharpe, noa * [1. / noa,], method='SLSQP',
                       bounds=bnds, constraints=cons)

where opts is the optimized point contacting with optimal sharpe ratio level.

when the return of risk free is 0.015, we can make CML with the statement as follow :

rf = 0.015
slope = (statistics(opts['x'])[0] - rf ) / statistics(opts['x'])[1]
var_list = [x*slope + rf for x in np.linspace(0,0.3,5000)]

x = np.linspace(0,0.3,5000)
y = var_list

size of x (=5000) is random value. 

Visualization

plt.figure(figsize=(12,8))
plt.scatter(port_std, port_df,
            c=np.array(port_df) / np.array(port_std), marker='o', cmap='PuBuGn')
plt.plot(tvols, trets, label = 'mean-variance frontier')
plt.plot(x,y, label = 'CML with riskfree asset')
plt.plot(statistics(opts['x'])[1], statistics(opts['x'])[0],
         'r*', markersize=15.0, label = 'Portfolio with highest Sharpe Ratio')
plt.xlim(0.09,0.33)
plt.ylim(0.05,0.2)
plt.legend()
plt.grid(True)
plt.ylabel('expected return$(μ)$')
plt.xlabel('expected std $(σ)$');
plt.colorbar(label='Sharpe ratio')

the optimal CML and mean-variance frontier of economic expansion and recession is following images



댓글