{"repo":"rafa-rod/vartests","free":true,"listed":false,"github":"https://github.com/rafa-rod/vartests","clone":"git clone https://github.com/rafa-rod/vartests.git","description":"Statistical tests for Value at Risk (VaR) Models.","language":"Python","stars":16,"topics":["value-at-risk","finance","backtest","backtesting","statistical-tests","kupiec-test","duration-test","christoffersen-pelletier","christoffersen","berkowitz"],"license":"MIT","category":"trading","readme_excerpt":"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vartests is a Python library to perform some statistical tests to evaluate Value at Risk (VaR) Models, such as: - T-test : verify if mean of distribution is zero; - Kupiec Test (1995) : verify if the number of violations is consistent with the violations predicted by the model; - Berkowitz Test (2001) : verify if conditional distributions of returns \"GARCH(1,1)\" used in the VaR Model is adherent to the data. In this specific test, we do not observe the whole data, only the tail; - Christoffersen and Pelletier Test (2004) : also known as Duration Test. Duration is time between violations of VaR. It tests if VaR Model has quickly response to market movements by consequence the violations do not form volatility clusters. This test verifies if violations has no memory i.e. should be independent. Installation Using pip You can install using the pip package manager by running: Alternatively, you could install the latest version directly from Github: Why vartests is important? After VaR calculation, it is necessary to perform statistic tests to evaluate the VaR Models. To select the best model, they should be validated by backtests. Example First of all, lets read a file with a PnL (distribution of profit and loss) of a portfolio in which also contains the VaR and its violations. The dataframe looks like: Not all tests should be applied to the VaR Model. Some of them should be applied when the VaR Model has the assumption of zero mean or follow a s","default_branch":null,"files":null,"tree":[],"storefront":"/r/rafa-rod","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/rafa-rod/vartests/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}