abaquant.portfolio.data¶
Import path: abaquant.portfolio.data
Domain: Portfolio construction, optimization, backtesting, risk metrics, and stress testing.
Purpose¶
Pure data transformations for portfolio analysis.
When to use it¶
Provides reference data or normalized data containers; inspect units and labels before reuse. Use this package to transform return histories and covariance estimates into weights, then evaluate those weights out of sample and under explicit scenarios.
Public objects¶
function:
get_returns— Compute the result defined by ‘’get_returns’’ under this module’s documented convention.function:
validate_tickers— Compute the result defined by ‘’validate_tickers’’ under this module’s documented convention.
Detailed reference¶
Pure data transformations for portfolio analysis.
Purpose¶
The module normalizes ticker labels and converts already-loaded price panels into simple return matrices without downloading market data.
Conventions¶
Prices are arranged with dates on the index and assets on columns. Missing observations are preserved until the return-cleaning step described by each function.
References
[ 1 ] Markowitz, H. (1952), “Portfolio Selection”.
- abaquant.portfolio.data.get_returns(prices)¶
Compute the result defined by
get_returnsunder this module’s documented convention.- Parameters:
prices (pd.DataFrame) – Price observations with dates on the index and assets on columns where applicable.
- Returns:
Tabular result with schema defined by the module-level convention.
- Return type:
pd.DataFrame
Notes
This is an analytical in-sample calculation. It does not by itself model transaction costs, execution effects, taxes, or future return uncertainty.
- abaquant.portfolio.data.validate_tickers(tickers)¶
Compute the result defined by
validate_tickersunder this module’s documented convention.- Parameters:
tickers (Iterable[str]) – Ticker labels or an iterable of raw ticker strings.
- Returns:
Ordered collection produced by the validate tickers calculation.
- Return type:
list[str]