Last data update: 2014.03.03

R: Extract various fields of view or posterior objects
ExtractorsR Documentation

Extract various fields of view or posterior objects

Description

A collection of functions to extract several fields of BLViews, COPViews, COPPosterior and BLPosterior objects.

Usage

assetSet(views)
viewMatrix(views, dropZeroColumns = TRUE)
PMatrix(views)
confidences(views)
posteriorMeanCov(posterior)
posteriorSimulations(posterior)
numSimulations(posterior)
priorViews(posterior)

Arguments

views

An object of class BLViews or COPViews

posterior

An object of class BLPosterior (posteriorMeanCov) or COPPosterior (posteriorSimulations, priorViews) , as appropriate

dropZeroColumns

Logical flag. If TRUE, columns of "view matrix" which only have zeros are dropped

Value

assetSet

The names of the assets in the view object's universe

confidences

The set of confidences in each view.

PMatrix

The 'pick' matrix

viewMatrix

The pick matrix augmented with the q vector of the BL model

posteriorMeanCov

The posterior mean and covariance (in a list) of a BLPosterior object

posteriorSimulations

Matrix of posterior distribution simulations held in a COPPosterior object

numSimulations

Number of simulations in posterior COP distribution

Author(s)

Francisco Gochez <fgochez@mango-solutions.com>

Examples

    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"))
    assetSet(views)
    confidences(views)
    PMatrix(views)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BLCOP)
Error in library(BLCOP) : there is no package called 'BLCOP'
Execution halted