API¶
entroport.entroport¶
-
class
entroport.entroport.
EntroPort
(df, estlength, step=1)¶ Portfolio allocation with relative entropy minimization
Estimates portfolio weights on a rolling out of sample basis by projecting past returns on an estimated stochastic discount factor.
Parameters: df : DataFrame
Portfolio time series, net log (excess) returns
estlength : int
Length of the moving estimation window
step : int
The number of observations in the out of sample estimation window (default is 1) - a step size of for ex. 10 would be the same as a 10 period rebalancing.
Notes
In detail: for each estimation window of size T, estimate
\[\boldsymbol{\hat \theta} = \arg\min_{\boldsymbol{\theta}} \sum_{t=1}^{T}\mathrm{kernel}(\boldsymbol{\theta}, \mathbf{R}_t)\]where
\[\mathrm{kernel}(\boldsymbol{\theta}, \mathbf{R}_t) = e^{\boldsymbol{\theta'} \mathbf{R}_t}\]The estimated portfolio weights are the coefficients (normalized) obtained from regressing the returns in the estimation window on the kernel evaluated at \(\boldsymbol{\hat \theta}\)
The out of sample information portfolio is these weights multiplied by the out of sample returns.
The out of sample stochastic discount factor is the estimated kernel evaluated at the out of sample returns.
References
[R1] Ghosh, Julliard, and Taylor A, “One Factor Benchmark Model for Asset Pricing”, (2015 wp) Attributes
theta_ (DataFrame) Estimated thetas weights_ (DataFrame) Estimated weights pfs_ (DataFrame) The time series of the estimated stochastic discount factor (sdf) and information portfolio (ip) -
fit
()¶ Fit this model.
Returns: self : object
Returns the instance itself.
-