### Value-at-Risk (VaR) Calculator Class in Python

As part of my self-development, I wanted to rework a script, which are typically one-offs, and turn it into a reusable component, although there are existing packages for VaR. As such, this is currently a work in progress. This code is a Python-based class for VaR calculations, and for those unfamiliar with VaR, it is an acronym for value at risk, the worst case loss in a period for a particular probability. It is a reworking of prior work with scripted VaR calculations, implementing various high-level good practices, e.g., hiding/encapsulation, do-not-repeat-yourself (DRY), dependency injection, etc.

Features:

Requires data frame of stock returns, factor returns, and stock weightsExpose a method to calculate and return a single VaR number for different variance typesExpose a method to calculate and return an array of VaR values by confidence levelExpose a method to calculate and plot an array of VaR values by confidence level Still to do:

Dynamic factor usage Note: Data to valida…

Features:

Requires data frame of stock returns, factor returns, and stock weightsExpose a method to calculate and return a single VaR number for different variance typesExpose a method to calculate and return an array of VaR values by confidence levelExpose a method to calculate and plot an array of VaR values by confidence level Still to do:

Dynamic factor usage Note: Data to valida…