MulaiMulai sekarang secara gratis

Optimal weights

This exercise is a continuation of the last exercises analysing the the output of opt and opt_rebal. Extracting and visualizing the optimal weights is an important component of the optimization. The optimal weights can be extracted with extractWeights() and charted with chart.Weights(). This is particularly useful for backtests to understand the evolution of weights over time. We can then answer questions about how allocations change through time.

Latihan ini adalah bagian dari kursus

Intermediate Portfolio Analysis in R

Lihat Kursus

Petunjuk latihan

  • Extract the optimal weights for the single period optimization.
  • Chart the weights for the single period optimization.
  • Extract the optimal weights for the optimization backtest.
  • Chart the weights for the optimization backtest.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.


# Extract the optimal weights for the single period optimization


# Chart the weights for the single period optimization


# Extract the optimal weights for the optimization backtest


# Chart the weights for the optimization backtest
Edit dan Jalankan Kode