
Python for Finance

From the previous discussion, we know that based on the assumption, that stock returns follow a normal distribution. Because of this, the skewness and kurtosis of returns are both assumed to be zero. However, in the real world, skewness and excess kurtosis of many stock returns are not zero. As a consequence, the modified VaR was developed to utilize those four moments instead of just two; see the following definition:
Here, z is the value based on a normal distribution, S is the skewness, K is kurtosis, t is an intermediate variable, and the scipy.stats.ppf()
function would offer a z-value for a given confidence level. The following program offers two VaRs based on the normality assumption and based on the preceding formula, that is, using all four moments. The number of shares is 500 at the end of year 2016. The stock tested is Walmart (WMT). The confidence level is 99% for a 1-day VaR:
import numpy as np import pandas as pd from scipy.stats import stats,norm from matplotlib...
Change the font size
Change margin width
Change background colour