Learn R Programming

fPortfolio (version 280.73)

weightsSlider: Portfolio Weights Slider

Description

Interactive portfolio weights plot.

Usage

weightsSlider(object, control = list(), ...)

Arguments

control
a list, defining the plotting parameters. The list modifies amongst others the color, e.g. minvariance.col, type of point, e.g. tangency.pch, or the dimension of the point, e.g. cml.cex, see
object
an S4 object of class fPORTFOLIO.
...
optional arguments to be passed.

Value

  • Creates interactive plots.

Details

The slider has illustrative objectives. The function expects an S4 object of class fPORTFOLIO. The weights slider gives an overview of the weights on the efficient frontier. Three weight plots weightsPlot, piePlot and the not stacked weights and a frontier plot with the single assets, the tangency portfolio and a legend are provided. In the two weights plots the vertical line indicates the current portfolio and a dotted one indicates the minimum variance portfolio. The number in the pie plot stands for the asset and the sign shows whether this asset is short or long. In all plots colors represent the same asset.

Examples

Run this code
## Load Data and Convert to timeSeries Object:
   data = as.timeSeries(data(smallcap.ts))
   data = data[, c("BKE", "GG", "GYMB", "KRON")]
   head(data)
    
## portfolioFrontier -
   frontier = portfolioFrontier(data)
   print(frontier)
    
## weightsSlider -
   # Try Frontier Slider:
   # weightsSlider(frontier)

Run the code above in your browser using DataLab