Skip to contents

Computes the optimal portfolio allocation using the EPO method.

Usage

epo(
  x,
  signal,
  lambda,
  method = c("simple", "anchored"),
  w,
  anchor = NULL,
  normalize = TRUE,
  endogenous = TRUE
)

# S3 method for default
epo(
  x,
  signal,
  lambda,
  method = c("simple", "anchored"),
  w,
  anchor = NULL,
  normalize = TRUE,
  endogenous = TRUE
)

# S3 method for tbl
epo(
  x,
  signal,
  lambda,
  method = c("simple", "anchored"),
  w,
  anchor = NULL,
  normalize = TRUE,
  endogenous = TRUE
)

# S3 method for xts
epo(
  x,
  signal,
  lambda,
  method = c("simple", "anchored"),
  w,
  anchor = NULL,
  normalize = TRUE,
  endogenous = TRUE
)

# S3 method for matrix
epo(
  x,
  signal,
  lambda,
  method = c("simple", "anchored"),
  w,
  anchor = NULL,
  normalize = TRUE,
  endogenous = TRUE
)

Arguments

x

A data-set with asset returns. It should be a tibble, a xts or a matrix.

signal

A double vector with the investor's belief's (signals, forecasts).

lambda

A double with the investor's risk-aversion preference.

method

A character. One of: "simple" or "anchored".

w

A double between 0 and 1. The shrinkage level increases from 0 to 1.

anchor

A double vector with the anchor (benchmark) in which the allocation should not deviate too much from. Only used when method = "anchored".

normalize

A boolean indicating whether the allocation should be normalized to sum 1 (full-investment constraint). The default is normalize = TRUE.

endogenous

A boolean indicating whether the risk-aversion parameter should be considered endogenous (only used when method = "anchored"). The default is endogenous = TRUE.

Value

The optimal allocation vector.

Examples

x <- diff(log(EuStockMarkets)) # stock returns
s <- colMeans(x) # it could be any signal

##################
### Simple EPO ###
##################

# Traditional Mean-Variance Analysis
epo(x = x, signal = s, lambda = 10, method = "simple", w = 0)
#> [1]  0.1914569  0.9894828 -0.3681779  0.1872382

# 100% Shrinkage
epo(x = x, signal = s, lambda = 10, method = "simple", w = 1)
#> [1] 0.2352863 0.3659986 0.1375249 0.2611902

# 50% Classical MVO and 50% Shrinkage
epo(x = x, signal = s, lambda = 10, method = "simple", w = 0.5)
#> [1]  0.223281853  0.564005906 -0.009868083  0.222580324

####################
### Anchored EPO ###
####################

benchmark <- rep(0.25, 4) # 1/N Portfolio

# Traditional Mean-Variance Analysis
epo(x = x, signal = s, lambda = 10, method = "anchored", w = 0.0, anchor = benchmark)
#> [1]  0.1914569  0.9894828 -0.3681779  0.1872382

# 100% on the Anchor portfolio
epo(x = x, signal = s, lambda = 10, method = "anchored", w = 1.0, anchor = benchmark)
#> [1] 0.25 0.25 0.25 0.25

# Somewhere between the two worlds
epo(x = x, signal = s, lambda = 10, method = "anchored", w = 0.5, anchor = benchmark)
#> [1] 0.2374674 0.4557503 0.1004711 0.2063111