library(ggplot2)
# Invariants
x <- diff(log(EuStockMarkets))
prior <- rep(1 / nrow(x), nrow(x))
# asset in the first col will outperform the asset in the second col (DAX will
# outperform SMI).
views <- view_on_rank(x = x, rank = c(2, 1))
views
ep <- entropy_pooling(p = prior, A = views$A, b = views$b, solver = "nloptr")
autoplot(ep)
# Prior Returns (SMI > DAX)
colMeans(x)[1:2]
# Posterior Returns (DAX > SMI)
ffp_moments(x, ep)$mu[1:2]
Run the code above in your browser using DataLab