Learn R Programming

fPortfolio (version 280.73)

frontierPoints: Get Frontier Points

Description

Extracts the risk and return coordinates of the efficient frontier.

Usage

frontierPoints(object, frontier = c("both", "lower", "upper"), 
    return = c("mean", "mu"), risk = c("Cov", "Sigma", "CVaR", "VaR"),
    auto = TRUE)

Arguments

object
an object of class fPORTFOLIO.
frontier
a character string denoting which part of the efficient portfolio should be extractacted.
return
character strings denoting which return measure should be plotted. Allowed values for the return are either "mean", or "mu".
risk
character strings denoting which risk measure should be plotted. Allowed values for the risk measure are either "cov", "sigma", "VaR", or "CVaR".
auto
a logical flag. If auto is TRUE, the default setting, then the risk willbe identified automatically from the object.

Details

The automated risk detection, auto=TRUE takes the following decision:

if (auto) { Type = getType(object) Estimator = getEstimator(object) if (Type == "MV") risk = "cov" if (Type == "MV" & Estimator != "covEstimator") risk = "sigma" if (Type == "QLPM") risk = "sigma" if (Type == "CVaR") risk = "CVaR" }

Examples

Run this code
## data -
   # Load Data and Convert to timeSeries Object:
   Data = as.timeSeries(data(smallcap.ts))
   Data = Data[, c("BKE", "GG", "GYMB", "KRON")]

## portfolioFrontier -  
   # Compute Efficient Frontier:
   Frontier = portfolioFrontier(Data) 
   
## frontierPoints:
   # Extract Points and Plot:
   x = frontierPoints(Frontier, risk = "VaR", auto = FALSE)
   x = frontierPoints(Frontier, risk = "CVaR", auto = FALSE)

Run the code above in your browser using DataLab