Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Challenge: Calculate and Visualize Portfolio VaR | Advanced Analysis and Automation for Investors
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Python for Investors

bookChallenge: Calculate and Visualize Portfolio VaR

Tehtävä

Swipe to start coding

You are given an array of daily portfolio returns and a confidence level. Your task is to:

  • Complete the calculate_var function to compute the Value at Risk (VaR) at the specified confidence level using the historical method (percentile approach).
  • Complete the plot_var function 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.

Ratkaisu

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 3. Luku 7
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

Suggested prompts:

Can you explain this in simpler terms?

What are the main points I should remember?

Can you give me an example?

close

bookChallenge: Calculate and Visualize Portfolio VaR

Pyyhkäise näyttääksesi valikon

Tehtävä

Swipe to start coding

You are given an array of daily portfolio returns and a confidence level. Your task is to:

  • Complete the calculate_var function to compute the Value at Risk (VaR) at the specified confidence level using the historical method (percentile approach).
  • Complete the plot_var function 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.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 3. Luku 7
single

single

some-alt