abaquant.marketdata.universe_statistics¶
Import path: abaquant.marketdata.universe_statistics
Domain: Provider-neutral market-data facades, normalized records, caching, and analytics.
Purpose¶
Annualized return and covariance statistics for ticker universes.
When to use it¶
Use this package to retrieve or inject quotes, price history, option chains, and financial statements while preserving a stable analytical interface.
Public objects¶
class:
UniverseStatistics— Annualized moment-estimation namespace for a :class:’MarketUniverse’. *UniverseStatistics.summary— Compute per-asset annualized return and risk summary statistics. *UniverseStatistics.covariance— Compute an annualized covariance matrix from aligned returns. *UniverseStatistics.expected_returns— Compute annualized arithmetic expected returns from aligned returns.
Detailed reference¶
Annualized return and covariance statistics for ticker universes.
Purpose¶
The module computes per-asset arithmetic means, volatility, and covariance matrices from aligned universe returns.
Conventions¶
Annualization uses the supplied periods-per-year factor, with 252 as the default. Covariances use pandas sample covariance conventions.
References
[ 1 ] Markowitz, H. (1952), “Portfolio Selection”.
- class abaquant.marketdata.universe_statistics.UniverseStatistics(universe)¶
Bases:
objectAnnualized moment-estimation namespace for a
MarketUniverse.- Parameters:
universe (MarketUniverse)
- universe¶
Universe that supplies aligned historical returns through its lazy history namespace.
- Type:
Notes
All estimates use complete aligned return observations and the caller’s
periods_per_yearannualization factor.- summary(*, kind='simple', start=None, end=None, period='1y', interval='1d', auto_adjust=True, periods_per_year=252)¶
Compute per-asset annualized return and risk summary statistics.
- Parameters:
kind (ReturnKind, default='simple') – Return convention:
"simple"for arithmetic returns or"log"for logarithmic returns.start (str | date | None, default=None) – Optional inclusive history start date.
end (str | date | None, default=None) – Optional exclusive or provider-defined history end date.
period (str | None, default='1y') – Provider history period label, such as
"1y", when explicit dates are not supplied.interval (str, default='1d') – Provider sampling interval label, such as
"1d".auto_adjust (bool, default=True) – Whether provider-adjusted price history is requested.
periods_per_year (int, default=252) – Number of observations interpreted as one year for annualization.
- Returns:
Tabular result with the index, column schema, units, and missing-value treatment defined by the module convention.
- Return type:
pandas.DataFrame
Notes
This is an analytical in-sample calculation. It does not by itself model transaction costs, execution effects, taxes, or future return uncertainty. The applied layer normalizes provider data but cannot guarantee provider completeness, timeliness, or accuracy.
- covariance(*, kind='simple', start=None, end=None, period='1y', interval='1d', auto_adjust=True, periods_per_year=252)¶
Compute an annualized covariance matrix from aligned returns.
- Parameters:
kind (ReturnKind, default='simple') – Return convention:
"simple"for arithmetic returns or"log"for logarithmic returns.start (str | date | None, default=None) – Optional inclusive history start date.
end (str | date | None, default=None) – Optional exclusive or provider-defined history end date.
period (str | None, default='1y') – Provider history period label, such as
"1y", when explicit dates are not supplied.interval (str, default='1d') – Provider sampling interval label, such as
"1d".auto_adjust (bool, default=True) – Whether provider-adjusted price history is requested.
periods_per_year (int, default=252) – Number of observations interpreted as one year for annualization.
- Returns:
Tabular result with the index, column schema, units, and missing-value treatment defined by the module convention.
- Return type:
pandas.DataFrame
Notes
This is an analytical in-sample calculation. It does not by itself model transaction costs, execution effects, taxes, or future return uncertainty. The applied layer normalizes provider data but cannot guarantee provider completeness, timeliness, or accuracy.
- expected_returns(*, kind='simple', start=None, end=None, period='1y', interval='1d', auto_adjust=True, periods_per_year=252)¶
Compute annualized arithmetic expected returns from aligned returns.
- Parameters:
kind (ReturnKind, default='simple') – Return convention:
"simple"for arithmetic returns or"log"for logarithmic returns.start (str | date | None, default=None) – Optional inclusive history start date.
end (str | date | None, default=None) – Optional exclusive or provider-defined history end date.
period (str | None, default='1y') – Provider history period label, such as
"1y", when explicit dates are not supplied.interval (str, default='1d') – Provider sampling interval label, such as
"1d".auto_adjust (bool, default=True) – Whether provider-adjusted price history is requested.
periods_per_year (int, default=252) – Number of observations interpreted as one year for annualization.
- Returns:
One-dimensional labeled result aligned to the documented input order.
- Return type:
pd.Series
Notes
This is an analytical in-sample calculation. It does not by itself model transaction costs, execution effects, taxes, or future return uncertainty. The applied layer normalizes provider data but cannot guarantee provider completeness, timeliness, or accuracy.
- abaquant.marketdata.universe_statistics.MarketUniverseStatistics¶
alias of
UniverseStatistics