Phân tích danh mục đầu tư nâng cao với R
Ross Bennett
Instructor
Xây dựng trên các khái niệm nền tảng từ "Introduction to Portfolio Analysis in R"
Khám phá các khái niệm nâng cao trong quy trình tối ưu hóa danh mục
Dùng gói R PortfolioAnalytics để giải các bài toán tối ưu danh mục phản ánh vấn đề thực tế
Lý thuyết danh mục hiện đại (MPT) do Harry Markowitz giới thiệu năm 1952.
MPT cho rằng mục tiêu của nhà đầu tư là tối đa hóa lợi nhuận kỳ vọng với mức rủi ro cho trước.
Mục tiêu thường gặp:
Tối đa hóa thước đo lợi ích trên mỗi đơn vị rủi ro
Tối thiểu hóa một thước đo rủi ro
library(PortfolioAnalytics)
data(edhec)
data <- edhec[,1:8]
# Create the portfolio specification
port_spec <- portfolio.spec(colnames(data))
port_spec <- add.constraint(portfolio = port_spec, type = "full_investment")
port_spec <- add.constraint(portfolio = port_spec, type = "long_only")
port_spec <- add.objective(portfolio = port_spec, type = "return", name = "mean")
port_spec <- add.objective(portfolio = port_spec, type = "risk", name = "StdDev")
**************************************************
PortfolioAnalytics Portfolio Specification
**************************************************
Call:
portfolio.spec(assets = colnames(data))
Number of assets: 8
Asset Names
[1] "Convertible Arbitrage" "CTA Global" "Distressed Securities"
[4] "Emerging Markets" "Equity Market Neutral" "Event Driven"
[7] "Fixed Income Arbitrage" "Global Macro"
Constraints
Enabled constraint types
- full_investment
- long_only
Objectives:
Enabled objective names
- mean
- StdDev
# Run optimization and chart results in risk-reward space
opt <- optimize.portfolio(data,
portfolio = port_spec,
optimize_method = "random",
trace = TRUE)
chart.RiskReward(opt,
risk.col = "StdDev",
return.col = "mean",
chart.assets = TRUE)

Phân tích danh mục đầu tư nâng cao với R