okama.Portfolio.describe
- Portfolio.describe(years=(1, 5, 10))
Generate descriptive statistics for the portfolio.
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 available period):
risk (standard deviation)
CVAR (timeframe is 1 year)
max drawdowns (and dates)
- Parameters:
- yearstuple of (int,), default (1, 5, 10)
List of periods for CAGR statistics.
- Returns:
- DataFrame
Table of descriptive statistics for the portfolio.
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
>>> pf = ok.Portfolio(['SPY.US', 'BND.US'], ccy='USD', last_date='07-2021') >>> pf.describe(years=[2, 5, 7]) # 'years' customizes the timeframe for the CAGR property period portfolio_2951.PF inflation 0 compound return YTD 0.084098 0.048154 1 CAGR 2 years 0.141465 0.031566 2 CAGR 5 years 0.102494 0.025582 3 CAGR 7 years 0.091694 0.019656 4 CAGR 14 years, 3 months 0.074305 0.019724 5 Dividend yield LTM 0.016504 NaN 6 Risk 14 years, 3 months 0.086103 NaN 7 CVAR 14 years, 3 months 0.214207 NaN 8 Max drawdown 14 years, 3 months -0.266915 NaN 9 Max drawdown date 14 years, 3 months 2009-02 NaN