CEW: Clustered Equal Weights

View source: R/CEW.R

CEWR Documentation

Clustered Equal Weights

Description

Computes optimal CEW portfolio with full investment and weight constraints.

Usage

CEW(sigma, UB = NULL, LB = NULL, n_clusters = "auto", ...)

Arguments

sigma

a (N \times N) covariance matrix.

UB

scalar or (N\times 1) vector of upper bound weight constraint.

LB

scalar or (N\times 1) vector of lower bound weight constraint.

n_clusters

trade-off between naive (0) or cluster-based (1) tree-splitting (see Details).

...

arguments passed to cluster::agnes method.

Details

The argument sigma is a covariance matrix.

Hierarchical clustering is performed using the cluster-package. If cluster_method == 'DIANA', the function cluster::diana is used to compute a cluster dendrogram, otherwise the function cluster::agnes(., method = cluster_method) is used. Default is single-linkage agglomerative nesting. The number of clusters can be passed using the n_clusters argument, calculated automatically with n_clusters='auto' using the Silhouette criterion.

CEW calculates within cluster minimum variance portfolios coupled with between cluster equal-weights. Constraints are implemented using an iterative convergence algorithm. Between cluster weights can deviate from equal weights if the equally weighted solution does not satisfy the box constraints.

Value

A (N \times 1) vector of optimal portfolio weights.

Author(s)

Johann Pfitzinger

Examples

# Load returns of assets or portfolios
data("Industry_10")
rets <- Industry_10
sigma <- cov(rets)
CEW(sigma, UB = 0.15, n_clusters = 'auto')


jpfitzinger/ClusterPortfolios documentation built on Sept. 27, 2024, 11:18 p.m.