Learn R Programming

fPortfolio (version 251.70)

AssetsPlots: Plots of Multivariate Asset Sets

Description

A collection and description of functions which display several different kind of views on multivariate data sets of assets. The functions are: ll{ assetsPlot Plots an overview of single assets, assetsSeriesPlot Displays time series of individual assets, assetsHistPlot Displays histograms of individual assets, assetsDensityPlot Displays density plots of individual assets, assetsQQNormPlot Displays normal qq-plots of individual assets, assetsBoxPlot Producess standard box plots, assetsBoxPercentilePlot roducess side-by-side box-percentile plots, assetsPairsPlot Displays pairs of scatterplots of individual assets, assetsCorTestPlot Displays and tests pairwise correlations, assetsCorgramPlot Displays correlations between assets, assetsCorEigenPlot Displays ratio of the largest two eigenvalues, assetsTreePlot Displays minimum spanning tree of assets, assetsDendogramPlot Displays hierarchical clustering dendogram. }

Usage

assetsPlot(x, title = NULL, ...)
assetsSeriesPlot(x, which = 1:dim(x)[2], ...)
assetsHistPlot(x, method = c("cov", "mve", "mcd", "nnve", "shrink", "bagged"), 
    which = 1:dim(x)[2], xlim = NULL, ...) 
assetsDensityPlot(x, method = c("cov", "mve", "mcd", "nnve", "shrink", "bagged"), 
    which = 1:dim(x)[2], ...)
assetsQQNormPlot(x, which = 1:dim(x)[2], ...)

assetsBoxPlot(x, col = "bisque", ...) assetsBoxPercentilePlot(x, col = "bisque", ...)

assetsPairsPlot(x, labels = TRUE, ...) assetsCorTestPlot(x, labels = TRUE, ...) assetsCorgramPlot(x, labels = TRUE, method = c("pie", "shade"), ...)

assetsCorEigenPlot(x, method = c("pearson", "kendall", "spearman"), ...) assetsTreePlot(x, method = "euclidian", seed = NULL) assetsDendogramPlot(x, method = c(dist = "euclidian", clust = "complete"))

Arguments

col
a character string, defining the color to fill the boxes.
labels
a logical flag, if TRUE then default labels will be used, otherwise the plots will be displayed without labels and the user can add his own labels.
method
[assetsHistPlot, assetsDensityPlot] - a character string, mean-covariance estimator used for the robust gaussian distribution fit. [assetsCorgramPlot] - a character string, the type of graph used in the lower panel. [assetsCorEigenPlot] - a ch
seed
[assetsTreePlot] - an integer value setting the seed in the computation of the sample ranks.
title
a character string, the plot title.
which
an integer value, defining which plot in a series of plots should be displayed.
x
any rectangular time series object which can be converted by the function as.matrix() into a matrix object, e.g. like an object of class timeSeries, data.frame, or mts.
xlim
a numeric vector with two elements defining the range of the plot. If the value of cxlim=NULL, the default setting, then the range will be automatically selected.
...
optional arguments to be passed.

See Also

MultivariateDistribution.

Examples

Run this code
## berndtInvest -
   data(berndtInvest)
   # Select "CONTIL" "DATGEN" "TANDY" and "DEC" Stocks:
   select = c("CONTIL", "DATGEN", "TANDY", "DEC")
   # Convert into a timeSeries object:
   berndtAssets.tS = as.timeSeries(berndtInvest)[, select]
   head(berndtAssets.tS)
   
## assetsSeriesPlot - 
   # Display time series of individual assets
   par(mfrow = c(2, 2), cex = 0.7)
   assetsSeriesPlot(berndtAssets.tS)
       
## assetsHistPlot -       
   # Display histograms of individual assets 
   assetsHistPlot(berndtAssets.tS)
   
## assetsQQNormPlot -       
   # Display normal qq-plots of individual assets
   assetsQQNormPlot(berndtAssets.tS)

## assetsPairsPlot -        
   # Display pairs of scatterplots of individual assets
   assetsPairsPlot(berndtAssets.tS)
   
## assetsCorTestPlot -      
   # Display and tests pairwise correlations of assets
   assetsCorTestPlot(berndtAssets.tS)

Run the code above in your browser using DataLab