Title: | Dynamic Optimal Shrinkage Portfolio |
---|---|
Description: | Constructs dynamic optimal shrinkage estimators for the weights of the global minimum variance portfolio which are reconstructed at given reallocation points as derived in Bodnar, Parolya, and Thorsén (2021) (<arXiv:2106.02131>). Two dynamic shrinkage estimators are available in this package. One using overlapping samples while the other use nonoverlapping samples. |
Authors: | Taras Bodnar [aut] |
Maintainer: | Erik Thorsén <[email protected]> |
License: | GPL-3 |
Version: | 0.1.0 |
Built: | 2025-03-12 05:14:57 UTC |
Source: | https://github.com/statistics-in-portfolio-theory/dosportfolio |
The DOSPortfolio package consists of two shrinkage estimators for the Global
Minimum Variance (GMV) portfolio. These are implemented in the packages main
interface: DOSPortfolio
. The shrinkage is performed at fixed
reallocation points in a dynamic manner where the sample estimator of the
GMV weights is shrunk towards the holding portfolio. The reallocation points
are specified by a deterministic sequence given a priori. The estimation is
performed such that the shrinkage coefficients are optimal for large
portfolios, e.g. there are many assets in comparison to observations. The
main interface validates the main assumptions of the theory used to derive
these methods.
DOSPortfolio: (Bodnar et al. 2021)
Bodnar T, Parolya N, Thorsén E (2021). “Dynamic Shrinkage Estimation of the High-Dimensional Minimum-Variance Portfolio.” arXiv preprint arXiv:2106.02131. https://arxiv.org/abs/2106.02131.
This is the main function to compute the weights of the global minimum variance portfolio by using the dynamic optimal shrinkage estimators presented in Eq. (2.11) and Eq. (2.23) of Bodnar et al. (2021). It implements two different estimators for the shrinkage coefficients, one using overlapping samples (see, Eq. (2.23) of Bodnar et al. (2021)) and one using non-overlapping samples (see, Eq. (2.11) of Bodnar et al. (2021)).
DOSPortfolio( data, reallocation_points, relative_loss = NULL, target_portfolio = rep(1, ncol(data))/ncol(data), shrinkage_type = "non-overlapping" )
DOSPortfolio( data, reallocation_points, relative_loss = NULL, target_portfolio = rep(1, ncol(data))/ncol(data), shrinkage_type = "non-overlapping" )
data |
an n by p matrix of asset returns. Columns represent different assets rows are observations, where n>p, containing, for instance, log-returns. |
reallocation_points |
a vector of reallocation points. The reallocation points determine when the holding portfolio should be reconstructed and its weights should be recomputed. |
relative_loss |
possibly a numeric or NULL. The initial value of the
relative loss in the variance of the target portfolio. If its NULL, then it
will be initialized with the first subsample and the function
|
target_portfolio |
a vector which determines the weights of the target portfolio used when the shrinkage estimator of the global minimum variance portfolio is constructed for the first time. |
shrinkage_type |
the type of shrinkage estimator to use. The two implemented approaches are "non-overlapping" and "overlapping". |
An S3 class which contains the matrix of the constructed weights of the dynamic shrinkage estimator of the global minimum variance portfolio and the type of the shrinkage estimator (i.e., "overlapping" or "non-overlapping") that was used in its construction. Each row of the weight matrix corresponds to the reallocation point and the column corresponds to the asset.
Bodnar T, Parolya N, Thorsén E (2021). “Dynamic Shrinkage Estimation of the High-Dimensional Minimum-Variance Portfolio.” arXiv preprint arXiv:2106.02131. https://arxiv.org/abs/2106.02131.
Section 2.1 and 2.2 of (Bodnar et al. 2021)
n <- 250*2 p <- 80 c <- p/n reallocation_points <- c(120, 240) data <- sqrt(5/3) * matrix(rt(n*p, df=5) , ncol=p, nrow=n) weights <- DOSPortfolio(data, reallocation_points, 1)
n <- 250*2 p <- 80 c <- p/n reallocation_points <- c(120, 240) data <- sqrt(5/3) * matrix(rt(n*p, df=5) , ncol=p, nrow=n) weights <- DOSPortfolio(data, reallocation_points, 1)
Constructor for the DOSPortfolio class
new_DOSPortfolio( data, reallocation_points, target_portfolio, relative_loss, shrinkage_type )
new_DOSPortfolio( data, reallocation_points, target_portfolio, relative_loss, shrinkage_type )
data |
an n by p matrix of asset returns. Columns represent different assets rows are observations, where n>p, containing, for instance, log-returns. |
reallocation_points |
a vector of reallocation points. The reallocation points determine when the holding portfolio should be reconstructed and its weights should be recomputed. |
target_portfolio |
a vector which determines the weights of the target portfolio used when the shrinkage estimator of the global minimum variance portfolio is constructed for the first time. |
relative_loss |
possibly a numeric or NULL. The initial value of the
relative loss in the variance of the target portfolio. If its NULL, then it
will be initialized with the first subsample and the function
|
shrinkage_type |
the type of shrinkage estimator to use. The two implemented approaches are "non-overlapping" and "overlapping". |
a DOSPortfolio class.
The function computes the initial value of the relative loss in the variance of the target portfolio as given in Eq. (2.10) of Bodnar et al. (2021).
r0Strategy(data, target_portfolio, c)
r0Strategy(data, target_portfolio, c)
data |
an n by p matrix of asset returns. Columns represent different assets rows are observations, where n>p, containing, for instance, log-returns. |
target_portfolio |
a vector which determines the weights of the target portfolio used when the shrinkage estimator of the global minimum variance portfolio is constructed for the first time. |
c |
a numeric which is the concentration ratio. |
vector
Bodnar T, Parolya N, Thorsén E (2021). “Dynamic Shrinkage Estimation of the High-Dimensional Minimum-Variance Portfolio.” arXiv preprint arXiv:2106.02131. https://arxiv.org/abs/2106.02131.
n <- 200*2 p <- 80 data <- 5/3 * matrix(rt(n*p, df=5), ncol=p, nrow=n) # set a target portfolio, such as equally weighted b <- rep(1,p)/p r0Strategy(data, b, p/n)
n <- 200*2 p <- 80 data <- 5/3 * matrix(rt(n*p, df=5), ncol=p, nrow=n) # set a target portfolio, such as equally weighted b <- rep(1,p)/p r0Strategy(data, b, p/n)
This function validates the assumptions made to derive the analytic formulas implemented in the different functions of the package. It is called for its side-effects.
validate_input( data, reallocation_points, target_portfolio, relative_loss, shrinkage_type )
validate_input( data, reallocation_points, target_portfolio, relative_loss, shrinkage_type )
data |
an n by p matrix of asset returns. Columns represent different assets rows are observations, where n>p, containing, for instance, log-returns. |
reallocation_points |
a vector of reallocation points. The reallocation points determine when the holding portfolio should be reconstructed and its weights should be recomputed. |
target_portfolio |
a vector which determines the weights of the target portfolio used when the shrinkage estimator of the global minimum variance portfolio is constructed for the first time. |
relative_loss |
possibly a numeric or NULL. The initial value of the
relative loss in the variance of the target portfolio. If its NULL, then it
will be initialized with the first subsample and the function
|
shrinkage_type |
the type of shrinkage estimator to use. The two implemented approaches are "non-overlapping" and "overlapping". |
NULL, only called for its side effects
The functions computes the sample estimate of the weights of the global minimum variance portfolio (see, e.g., Eq. (1.4) of Bodnar et al. (2021))).
wGMV(data)
wGMV(data)
data |
an n by p matrix of asset returns. Columns represent different assets rows are observations, where n>p, containing, for instance, log-returns. |
a vector, which is the Global Minimum Variance Portfolio.
n <- 200 p <- 80 data <- 3/5 * matrix(rt(n*p, df=5), ncol=p, nrow=n) weights <- wGMV(data) # since the covariance matrix is the identity-matrix the estimated weights # should be close to the equally weighted portfolio. mean(abs(wGMV(data) - 1/p))
n <- 200 p <- 80 data <- 3/5 * matrix(rt(n*p, df=5), ncol=p, nrow=n) weights <- wGMV(data) # since the covariance matrix is the identity-matrix the estimated weights # should be close to the equally weighted portfolio. mean(abs(wGMV(data) - 1/p))
The function implements the dynamic shrinkage estimator of the weights of the global minimum-variance portfolio when the overlapping samples are used as given in Eq. (2.11) of Bodnar et al. (2021) .
wGMVNonOverlapping(data, reallocation_points, target_portfolio, relative_loss)
wGMVNonOverlapping(data, reallocation_points, target_portfolio, relative_loss)
data |
an n by p matrix of asset returns. Columns represent different assets rows are observations, where n>p, containing, for instance, log-returns. |
reallocation_points |
a vector of reallocation points. The reallocation points determine when the holding portfolio should be reconstructed and it is weights should be recomputed. |
target_portfolio |
a vector which determines the weights of the target portfolio used when the shrinkage estimator of the global minimum variance portfolio is constructed for the first time. |
relative_loss |
possibly a numeric or NULL. The initial value of the
relative loss in the variance of the target portfolio. If it is NULL, then it
will be initialized with the first subsample and the function
|
a matrix of the constructed weights at each reallocation point of the dynamic shrinkage estimator of the global minimum variance portfolio when non-overlapping samples are used.
Bodnar T, Parolya N, Thorsén E (2021). “Dynamic Shrinkage Estimation of the High-Dimensional Minimum-Variance Portfolio.” arXiv preprint arXiv:2106.02131. https://arxiv.org/abs/2106.02131.
section 2.1 (Bodnar et al. 2021)
n <- 200*2 p <- 80 reallocation_point <- c(199) data <- 3/5 * matrix(rt(n*p, df=5), ncol=p, nrow=n) target_portfolio <- as.vector(rep(1,p))/p wGMVNonOverlapping(data, reallocation_point, target_portfolio, 1)
n <- 200*2 p <- 80 reallocation_point <- c(199) data <- 3/5 * matrix(rt(n*p, df=5), ncol=p, nrow=n) target_portfolio <- as.vector(rep(1,p))/p wGMVNonOverlapping(data, reallocation_point, target_portfolio, 1)
The function implements the dynamic shrinkage estimator of the weights of the global minimum-variance portfolio when the overlapping samples are used as given in Eq. (2.23) of Bodnar et al. (2021).
wGMVOverlapping(data, reallocation_points, target_portfolio, relative_loss)
wGMVOverlapping(data, reallocation_points, target_portfolio, relative_loss)
data |
an n by p matrix of asset returns. Columns represent different assets rows are observations, where n>p, containing, for instance, log-returns. |
reallocation_points |
a vector of reallocation points. The reallocation points determine when the holding portfolio should be reconstructed and it is weights should be recomputed. |
target_portfolio |
a vector which determines the weights of the target portfolio used when the shrinkage estimator of the global minimum variance portfolio is constructed for the first time. |
relative_loss |
possibly a numeric or NULL. The initial value of the
relative loss in the variance of the target portfolio. If it is NULL, then it
will be initialized with the first subsample and the function
|
a matrix of the constructed weights at each reallocation point of the dynamic shrinkage estimator of the global minimum variance portfolio when overlapping samples are used.
Bodnar T, Parolya N, Thorsén E (2021). “Dynamic Shrinkage Estimation of the High-Dimensional Minimum-Variance Portfolio.” arXiv preprint arXiv:2106.02131. https://arxiv.org/abs/2106.02131.
n <- 200*2 p <- 80 reallocation_points <- c(199) data <- matrix(rt(n*p, df=5), ncol=p, nrow=n) target_portfolio <- as.vector(rep(1,p))/p wGMVOverlapping(data, reallocation_points, target_portfolio, 1)
n <- 200*2 p <- 80 reallocation_points <- c(199) data <- matrix(rt(n*p, df=5), ncol=p, nrow=n) target_portfolio <- as.vector(rep(1,p))/p wGMVOverlapping(data, reallocation_points, target_portfolio, 1)