qis.portfolio_returns_to_nav¶
- qis.portfolio_returns_to_nav(returns, init_period=1, init_value=None, freq=None)[source]¶
Aggregate portfolio returns across assets to single NAV.
NaN handling: uses
nansumacross columns — a NaN contribution on a given date is treated as 0 PnL, equivalent to “this asset held its notional but earned 0% that period”. A date on which every contribution is NaN has a NaN portfolio return, exactly as into_portfolio_returns: the NAV is carried flat through such a date inside the history and, asreturns_to_navdoes for any trailing missing returns, ends at the last date with an observed contribution. Seeto_portfolio_returnsdocstring for the full discussion.- Parameters:
returns (DataFrame) – Per-asset return contributions, with assets as columns
init_period (int | None) – 1 sets the first row’s aggregate return to zero, observed or not, so the NAV equals one on the first date and that row’s contribution is discarded; 0 sets the missing row before the first observed aggregate return to zero; None leaves the aggregate unchanged
freq (str | None) – Resampling frequency
- Returns:
Aggregate portfolio NAV series
- Return type: