okama.AssetList.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. Default value is 1%.
- Returns:
- Series
VaR values for each asset in form of Series.
See also
risk_monthly
Calculate montly risk for each asset.
risk_annual
Calculate annualized risks.
semideviation_monthly
Calculate semideviation monthly values.
semideviation_annual
Calculate semideviation annualized values.
get_cvar_historic
Calculate historic Conditional Value at Risk (CVaR).
drawdowns
Calculate 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