get_var_historic
- AssetList.get_var_historic(time_frame=12, level=1)
Calculate historic Value at Risk (VaR) for the assets with a given timeframe.
The VaR calculates the potential loss of an investment with a given time frame and confidence level. Loss is a positive number (expressed in cumulative return). If VaR is negative there are expected gains at this confidence level.
- Parameters:
- time_frameint, default 12
Time period size in months
- levelint, default 1
Confidence level in percents (1 - 100%). Default value is 1%.
- Returns:
- Series
VaR values for each asset in form of Series.
See also
risk_monthlyCalculate montly risk for each asset.
risk_annualCalculate annualized risks.
semideviation_monthlyCalculate semideviation monthly values.
semideviation_annualCalculate semideviation annualized values.
get_cvar_historicCalculate historic Conditional Value at Risk (CVaR).
drawdownsCalculate drawdowns.
Examples
>>> x = ok.AssetList(["SPY.US", "AGG.US"]) >>> x.get_var_historic(time_frame=60, level=1) SPY.US 0.2101 AGG.US -0.0867 Name: VaR, dtype: float64