okama.AssetList.describe
- AssetList.describe(years=(1, 5, 10), tickers=True)
Generate descriptive statistics for a list of assets.
Statistics includes:
YTD (Year To date) compound return
CAGR for a given list of periods and full available period
Annualized mean rate of return (full available period)
LTM Dividend yield - last twelve months dividend yield
Risk metrics (full period):
risk (standard deviation)
CVAR (timeframe is 1 year)
max drawdowns (and dates of the drawdowns)
Statistics also shows for each asset: - inception date - first date available for each asset - last asset date - available for each asset date - Common last data date - common for the asset list data (may be set by last_date manually)
- Parameters:
- yearstuple of (int,), default (1, 5, 10)
List of periods for CAGR.
- tickersbool, default True
Defines whether show tickers (True) or assets names in the header.
- Returns:
- DataFrame
Table of descriptive statistics for a list of assets.
See also
get_cumulative_return
Calculate cumulative return.
get_cagr
Calculate assets Compound Annual Growth Rate (CAGR).
dividend_yield
Calculate dividend yield (LTM).
risk_annual
Return annualized risks (standard deviation).
get_cvar
Calculate historic Conditional Value at Risk (CVAR, expected shortfall).
drawdowns
Calculate drawdowns.
Examples
>>> al = ok.AssetList(['SPY.US', 'AGG.US'], last_date='2021-08') >>> al.describe(years=[1, 10, 15]) property period AGG.US SPY.US inflation 0 Compound return YTD -0.005620 0.180519 0.048154 1 CAGR 1 years -0.007530 0.363021 0.053717 2 CAGR 10 years 0.032918 0.152310 0.019136 3 CAGR 15 years 0.043013 0.107598 0.019788 4 CAGR 17 years, 10 months 0.039793 0.107972 0.022002 5 Dividend yield LTM 0.018690 0.012709 NaN 6 Risk 17 years, 10 months 0.037796 0.158301 NaN 7 CVAR 17 years, 10 months 0.023107 0.399398 NaN