Helper to construct constraints on the entire distribution.
view_on_joint_distribution(x, simul, p)## Default S3 method:view_on_joint_distribution(x, simul, p)## S3 method for class 'matrix'view_on_joint_distribution(x, simul, p)## S3 method for class 'xts'view_on_joint_distribution(x, simul, p)## S3 method for class 'tbl_df'view_on_joint_distribution(x, simul, p)
Arguments
x: An univariate or a multivariate distribution.
simul: An univariate or multivariate simulated panel.
p: An object of the ffp class.
Returns
A list of the view class.
Details
simul must have the same number of columns than x
p should have the same number of rows that simul.
Examples
set.seed(1)library(ggplot2)# Invariantsret <- diff(log(EuStockMarkets))n <- nrow(ret)#' Prior probability distributionprior <- rep(1/ n, n)# Simulated marginalssimul <- bootstrap_scenarios(ret, as_ffp(prior), as.double(n))views <- view_on_joint_distribution(x = ret, simul = simul, p = prior)views
ep <- entropy_pooling(p = prior, Aeq = views$Aeq, beq = views$beq, solver ="nlminb")autoplot(ep)# location matchescolMeans(simul)ffp_moments(x = ret, p = ep)$mu
# dispersion matchescov(simul)ffp_moments(x = ret, p = ep)$sigma