Skip to content

Instantly share code, notes, and snippets.

@quantra-go-algo
Created November 17, 2022 04:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quantra-go-algo/9670eabea7aae38138a18cfc94ee4ffc to your computer and use it in GitHub Desktop.
Save quantra-go-algo/9670eabea7aae38138a18cfc94ee4ffc to your computer and use it in GitHub Desktop.
# Calculate the VaR using point percentile function
VaR_90 = norm.ppf(1-0.9, mean, std_dev)
VaR_95 = norm.ppf(1-0.95, mean, std_dev)
VaR_99 = norm.ppf(1-0.99, mean, std_dev)
print (tabulate([['90%', VaR_90], ['95%', VaR_95], ['99%', VaR_99]], headers = ['Confidence Level', 'Value at Risk']))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment