densityPlots {BLCOP}R Documentation

Density plots of prior and posterior distributions

Description

This generic function generates density plots of the marginal posterior and prior distributions of a set of assets in an object of class BLResult or COPResult for comparative purposes.

Usage

densityPlots(result, assetsSel = NULL, numSimulations = BLCOPOptions("numSimulations"), 
             ...)

Arguments

result

Object of class

assetsSel

A numeric vector of assets to plot

numSimulations

For COPResult class objects, the number of simulations to use for the market posterior distribution

...

Additional arguments passed to plot

Details

For COPResults objects, density kernel estimates from the samples are used

Value

None

Author(s)

Francisco Gochez, <fgochez@mango-solutions>

Examples

    ## Not run: 
        dispersion <- c(.376,.253,.360,.333,.360,.600,.397,.396,.578,.775) / 1000
        sigma <- BLCOP:::.symmetricMatrix(dispersion, dim = 4)
        caps <- rep(1/4, 4)
        mu <- 2.5 * sigma 
        dim(mu) <- NULL
        marketDistribution <- mvdistribution("mt", mean = mu, S = sigma, df = 5 )
        pick <- matrix(0, ncol = 4, nrow = 1, dimnames = list(NULL, c("SP", "FTSE", "CAC", "DAX")))
        pick[1,4] <- 1
        vdist <- list(distribution("unif", min = -0.02, max = 0))
    
        views <- COPViews(pick, vdist, 0.2, c("SP", "FTSE", "CAC", "DAX"))
        posterior <- COPPosterior(marketDistribution, views)
        densityPlots(posterior, 4)
        
## End(Not run)

[Package BLCOP version 0.3.3 Index]