Visualize results
Now that we have run the optimization, we would like to take a look at the output and results. Recall that the optimization output is in a variable named opt
. In our case, for the portfolio optimization in the previous exercise, we are interested in the optimal weights and estimated objective value. The weights are considered optimal in the sense that the set of weights minimizes the objective value, portfolio standard deviation, and satisfies the full investment and long only constraints based on historical data.
Note that you won't recognize some of these functions right now. Don't worry! They will all be introduced throughout the course.
Este exercício faz parte do curso
Intermediate Portfolio Analysis in R
Instruções do exercício
- Print the output of the optimization from the previous problem. The output is stored in a variable named
opt
. - Extract the optimal weights with
extractWeights()
. - Chart the optimal weights with
chart.Weights()
.
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
# Print the results of the optimization
# Extract the optimal weights
# Chart the optimal weights