การวิเคราะห์พอร์ตโฟลิโอระดับกลางใน R
Ross Bennett
Instructor
แก้โจทย์การจัดพอร์ตโฟลิโอที่คล้ายกับปัญหาจริงในอุตสาหกรรม
นำเทคนิคที่เรียนตลอดคอร์สมาใช้
กำหนดพอร์ตโฟลิโอพร้อมข้อจำกัดและวัตถุประสงค์
รันการหาค่าเหมาะสุดพร้อม period rebalancing บนข้อมูลอดีต
วิเคราะห์ผลลัพธ์
ปรับข้อจำกัด วัตถุประสงค์ และการประมาณค่า moment
ข้อมูล
ผลตอบแทนรายเดือนของ EDHEC-Risk Alternative Indexes {6}
ม.ค. 1997 - มี.ค. 2016
data(indexes) returns <- indexes[,1:4]# Equal weight benchmark n <- ncol(returns) equal_weights <- rep(1 / n, n) benchmark_returns <- Return.portfolio(R = returns, weights = equal_weights, rebalance_on = "years") colnames(benchmark_returns) <- "benchmark"# Benchmark performance table.AnnualizedReturns(benchmark_returns)
benchmark
Annualized Return 0.0775
Annualized Std Dev 0.1032
Annualized Sharpe (Rf=0%) 0.7509
กำหนด portfolio specification เพื่อใช้เป็น base case
base portfolio specification ออกแบบให้เป็นแนวทางที่เรียบง่าย มีข้อจำกัดผ่อนคลาย และวัตถุประสงค์พื้นฐาน
# Base portfolio specification
base_port_spec <- portfolio.spec(assets = colnames(returns))
base_port_spec <- add.constraint(portfolio = base_port_spec,
type = "full_investment")
base_port_spec <- add.constraint(portfolio = base_port_spec,
type = "long_only")
base_port_spec <- add.objective(portfolio = base_port_spec,
type = "risk", name = "StdDev")
การวิเคราะห์พอร์ตโฟลิโอระดับกลางใน R