Challenge: Calculate and Visualize Portfolio VaR
Tâche
Swipe to start coding
You are given an array of daily portfolio returns and a confidence level. Your task is to:
- Complete the
calculate_varfunction to compute the Value at Risk (VaR) at the specified confidence level using the historical method (percentile approach). - Complete the
plot_varfunction to display a histogram of the returns and clearly indicate the VaR threshold on the plot. - Ensure that the VaR is returned as a positive float value.
- Use only the libraries provided above.
The code provided includes sample portfolio returns and a confidence level. You should only modify the two functions indicated above.
Solution
Tout était clair ?
Merci pour vos commentaires !
Section 3. Chapitre 7
single
Demandez à l'IA
Demandez à l'IA
Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion
Génial!
Completion taux amélioré à 4.76
Challenge: Calculate and Visualize Portfolio VaR
Glissez pour afficher le menu
Tâche
Swipe to start coding
You are given an array of daily portfolio returns and a confidence level. Your task is to:
- Complete the
calculate_varfunction to compute the Value at Risk (VaR) at the specified confidence level using the historical method (percentile approach). - Complete the
plot_varfunction to display a histogram of the returns and clearly indicate the VaR threshold on the plot. - Ensure that the VaR is returned as a positive float value.
- Use only the libraries provided above.
The code provided includes sample portfolio returns and a confidence level. You should only modify the two functions indicated above.
Solution
Tout était clair ?
Merci pour vos commentaires !
Section 3. Chapitre 7
single