densityPlots: Density plots of prior and posterior distributions

Description Usage Arguments Details Value Author(s) Examples

View source: R/densityPlots.r

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

1
2
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
    ## 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)

BLCOP documentation built on Jan. 26, 2021, 1:05 a.m.