plot-binning: Bivariate Histogram Plots of Assets

Description Usage Arguments Author(s) References Examples

Description

Displays bivariate histogram plots of assets returns.

Usage

1
assetsHistPairsPlot(x, bins = 30, method = c("square", "hex"), ...) 

Arguments

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.

bins

an integer value, the number of bins used for the biariate histogram.

method

a character string denoting whic h type of binning should be used, either "squared" or "hexagonal".

...

optional arguments to be passed.

Author(s)

Diethelm Wuertz for the Rmetrics port.

References

Wuertz, D., Chalabi, Y., Chen W., Ellis A. (2009); Portfolio Optimization with R/Rmetrics, Rmetrics eBook, Rmetrics Association and Finance Online, Zurich.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## LPP2005REC -
   # Load Swiss Pension Fund Data:
   LPP <- LPP2005REC
   head(LPP)
     
## assetsHistPairsPlot - 
   # Create a bivariate Binning Plot: assetsHistPairsPlot -
   assetsHistPairsPlot(LPP[, c("LMI", "ALT")])
   
## assetsHistPairsPlot -
   # Now with hexagonal Bins:
   assetsHistPairsPlot(LPP[, c("LMI", "ALT")], method = "hex")
   grid(col="red")

Example output

Loading required package: timeDate
Loading required package: timeSeries
Loading required package: fBasics


Rmetrics Package fBasics
Analysing Markets and calculating Basic Statistics
Copyright (C) 2005-2014 Rmetrics Association Zurich
Educational Software for Financial Engineering and Computational Science
Rmetrics is free software and comes with ABSOLUTELY NO WARRANTY.
https://www.rmetrics.org --- Mail to: info@rmetrics.org


Rmetrics Package fAssets
Analysing and Modeling Financial Assets
Copyright (C) 2005-2014 Rmetrics Association Zurich
Educational Software for Financial Engineering and Computational Science
Rmetrics is free software and comes with ABSOLUTELY NO WARRANTY.
https://www.rmetrics.org --- Mail to: info@rmetrics.org
GMT
                    SBI          SPI          SII          LMI         MPI
2005-11-01 -0.000612745  0.008414595 -0.003190926 -0.001108882 0.001548062
2005-11-02 -0.002762009  0.002519342 -0.004117638 -0.001175939 0.000342876
2005-11-03 -0.001153092  0.012707292 -0.005209409 -0.000992456 0.010502959
2005-11-04 -0.003235750 -0.000702757 -0.001127165 -0.001198528 0.011679558
2005-11-07  0.001310970  0.006205226 -0.001795839  0.000360366 0.002709618
2005-11-08  0.000539312  0.000329260  0.002103374  0.002327040 0.000346843
                    ALT        LPP25        LPP40        LPP60
2005-11-01 -0.002572971 -0.000130008  0.000199980  0.000809672
2005-11-02 -0.001141604 -0.001561421 -0.001120404 -0.000469730
2005-11-03  0.005007442  0.001541418  0.003317548  0.005731589
2005-11-04  0.009482677  0.000439969  0.002421248  0.004838735
2005-11-07  0.004723952  0.001638182  0.002246611  0.003012363
2005-11-08  0.000853619  0.001087309  0.000962708  0.000828043
Warning message:
In rug(x$data[, 2], ticksize = 0.01, side = 4) :
  some values will be clipped

fAssets documentation built on Nov. 17, 2017, 2:12 p.m.