VaR 回测
Task 3:VaR 回测与基于 EWMA 波动率预测的 VaR 回测 VaR 回测 在大多数情况下,我们假设日收益率服从正态分布,并且按照题目要求,VaR 取 99% 置信水平。 导入库 1 await __import__("piplite").install('numpy', 'scipy', 'matplotlib', 'pandas', 'tabulate') 1 2 # hyy:fix the import failed issue await __import__("piplite").install('tabulate') 1 2 # hyy:fix excel issue, miss the excel read library, install here. await __import__("piplite").install('openpyxl') 1 2 3 4 5 import numpy as np import pandas as pd from scipy import stats import matplotlib.pyplot as plt from tabulate import tabulate 1 2 # set precision pd.set_option('display.precision', 4) 加载数据 ...