Skip to contents

Bind views for entropy programming.

Usage

bind_views(...)

Arguments

...

Objects of the class ffp_views to combine.

Value

A list of the view class.

Examples

library(ggplot2)

# Invariant
ret <- diff(log(EuStockMarkets))
n   <- nrow(ret)

# Prior probabilities (usually equal weight scheme)
prior <- rep(1 / n, n)

# Prior belief for expected returns (here is 0% for each asset)
view_mean <- view_on_mean(x = ret, mean = rep(0, 4))

#' view on volatility
vol <- apply(ret, 2, stats::sd) * 1.1 # volatility 10% higher than average
view_volatility <- view_on_volatility(x = ret, vol = vol)

views_comb <- bind_views(view_mean, view_volatility)
views_comb
#> # ffp view
#> Type:  Multiple Views
#> Aeq :  Dim 8 x 1859 
#> beq :  Dim 8 x 1 
#> A :  Dim 0 x 1 
#> b :  Dim 0 x 1 

ep <- entropy_pooling(p      = prior,
                      Aeq    = views_comb$Aeq,
                      beq    = views_comb$beq,
                      A      = views_comb$A,
                      b      = views_comb$b,
                      solver = "nlminb")
autoplot(ep)