spIndexTrack: Sparse Index Tracking

View source: R/spIndexTrack.R

spIndexTrackR Documentation

Sparse Index Tracking

Description

Computes the weights of assets (relative capital allocation) for a sparse approximation of a financial index.

Usage

spIndexTrack(
  X,
  r,
  lambda,
  u = 1,
  measure = c("ete", "dr", "hete", "hdr"),
  hub = NULL,
  w0 = NULL,
  p_neg_exp = 7,
  max_iter = 1000,
  thres = 1e-09
)

Arguments

X

m-by-n matrix of net returns (m samples, n assets).

r

m dimensional vector of the net returns of the index.

lambda

sparsity weight factor. Any nonnegative number (suggested range [10^{-8},10^{-6}]).

u

upper bound of the weights.Default value u <- 1, i.e., no effective upper bound.

measure

performance measure. Possible values 'ete' (empirical tracking error - default), 'dr' (downside risk), 'hete' (Huber empirical tracking error), and 'hdr' (Huber downside risk).

hub

Huber parameter. Required if measure = 'hete' or measure = 'hdr'.

w0

initial point. If NULL a uniform allocation is used, i.e., w0 <- rep(1/N, N).

p_neg_exp

final negative exponent of p, so p = exp(-p_neg_exp) (default is 7).

max_iter

maximum number of iterations (default is 1000).

thres

threshold value. All the weights less or equal to thres are set to 0. The default value is 1e-9.

Value

An n-dimensional vector with allocation weights on the assets.

Author(s)

Konstantinos Benidis and Daniel P. Palomar

References

K. Benidis, Y. Feng, D. P. Palomar, "Sparse Portfolios for High-Dimensional Financial Index Tracking," IEEE Transactions on Signal Processing, vol. 66, no. 1, pp. 155-170, Jan. 2018.

Examples

library(sparseIndexTracking)
library(xts)

# load data
data(INDEX_2010)

# fit portfolio under error measure ETE (Empirical Tracking Error)
w_ete <- spIndexTrack(INDEX_2010$X, INDEX_2010$SP500, lambda = 1e-7, u = 0.5, measure = 'ete')

# show cardinality achieved
cat("Number of assets used:", sum(w_ete > 1e-6))


dppalomar/sparseIndexTracking documentation built on June 29, 2023, 8:42 p.m.