分析最佳化結果

R 中級投資組合分析

Ross Bennett

Instructor

流程:分析結果

視覺化 資料擷取
plot() extractObjectiveMeasures()
chart.Concentration() extractStats()
chart.EfficientFrontier() extractWeights()
chart.RiskReward() print()
chart.RiskBudget() summary()
chart.Weights()
R 中級投資組合分析

範例:擷取權重

# Extract the optimal weights
extractWeights(opt)
Convertible Arbitrage   CTA Global      Distressed Securities    
         0.000000e+00   6.515184e-02         5.840055e-18                     

Emerging Markets     Equity Market Neutral      Event Driven
  -8.501425e-18           9.348482e-01          4.105887e-18
R 中級投資組合分析

範例:擷取權重

head(extractWeights(opt_rebal), n = 3)

         Convertible Arbitrage   CTA Global   Distressed Securities
2001-12-31          0.12986589   0.06849445            0.00000000
2002-12-31          0.08738164   0.08645814            0.00000000
2003-12-31          0.09177469   0.03192720            0.02419038

           Emerging Markets  Equity Market Neutral  Event Driven
2001-12-31     7.113112e-18             0.8016397  -1.608927e-16
2002-12-31    -2.553006e-19             0.8261602  -3.837233e-17
2003-12-31     0.000000e+00             0.8521077   2.991493e-19
R 中級投資組合分析

範例:擷取權重

# Extract the optimal weights
extractWeights(opt)
Convertible Arbitrage   CTA Global      Distressed Securities    
         0.000000e+00   6.515184e-02         5.840055e-18                     

Emerging Markets     Equity Market Neutral      Event Driven
  -8.501425e-18           9.348482e-01          4.105887e-18 
R 中級投資組合分析

範例:擷取權重

head(extractWeights(opt_rebal), n = 3)
           Convertible Arbitrage CTA Global 
         Convertible Arbitrage   CTA Global   Distressed Securities
2001-12-31          0.12986589   0.06849445            0.00000000
2002-12-31          0.08738164   0.08645814            0.00000000
2003-12-31          0.09177469   0.03192720            0.02419038

           Emerging Markets  Equity Market Neutral  Event Driven
2001-12-31     7.113112e-18             0.8016397  -1.608927e-16
2002-12-31    -2.553006e-19             0.8261602  -3.837233e-17
2003-12-31     0.000000e+00             0.8521077   2.991493e-19
R 中級投資組合分析

範例:繪製權重

# Chart the weights
chart.Weights(opt)
chart.Weights(opt_rebal)

權重圖表

R 中級投資組合分析

範例:繪製權重

# Chart the weights
chart.Weights(opt)
chart.Weights(opt_rebal)

再平衡期間圖

R 中級投資組合分析
# Extract the objective measures
extractObjectiveMeasures(opt)
$StdDev
     StdDev 
0.008855401
head(extractObjectiveMeasures(opt_rebal))
                StdDev
2001-12-31 0.006521328
2002-12-31 0.005886103
2003-12-31 0.005656744
2004-12-31 0.005855993
2005-12-31 0.004308911
2006-12-31 0.004198900
R 中級投資組合分析

範例:最佳化分析

# Compute the rebalancing returns
rr <- Return.portfolio(ret, weights = extractWeights(opt_rebal))
charts.PerformanceSummary(rr)

績效摘要圖

R 中級投資組合分析

一起來練習吧!

R 中級投資組合分析

Preparing Video For Download...