Learn R Programming

fPortfolio (version 280.74)

portfolioFrontier: Efficient Portfolio Frontier

Description

Compoutes the efficient portfolio frontier.

Usage

portfolioFrontier(data, spec = portfolioSpec(), constraints = "LongOnly",
    include.mvl = TRUE, title = NULL, description = NULL)

Arguments

constraints
a character string vector, containing the constraints of the form "minW[asset]=percentage" for box constraints resp. "maxsumW[assets]=percentage" for sector constraints.
data
a multivariate time series described by an S4 object of class timeSeries. If your timeSerie is not a timeSeries object, consult the generic function as.timeSeries to convert your time series.
description
a character string which allows for a brief description.
include.mvl
a logical flag, should the minimum variance locus be added to the plot?
spec
an S4 object of class fPFOLIOSPEC as returned by the function portfolioSpec.
title
a character string which allows for a project title.

Value

  • portfolioFrontier function returns an S4 object of class "fPORTFOLIO".

Details

Portfolio Frontier: The function portfolioFrontier calculates the whole efficient frontier. The portfolio information consists of five arguments: data, specifications, constraints, title and description. The range of the frontier is determined from the range of the asset returns, and the number of equidistant points in the returns, is calculated from the number of frontier points hold in the specifrication structure. To extract or to modify the number of frontier points use the functions getNFrontierPoints and setNFrontierPoints. The frontierPortfolio function returns the properties of the the efficient frontier as an S4 object of class fPORTFOLIO.

Examples

Run this code
## portfolioFrontier -
   
   # Load Data and Convert to timeSeries Object:
   Data = as.timeSeries(data(smallcap.ts))
   Data = Data[, c("BKE", "GG", "GYMB", "KRON")]
   Data
   
   # Set Default Specifications:
   Spec = portfolioSpec()
   Spec
   setNFrontierPoints = 10
   
   # Allow for unlimited Short Selling:
   Constraints = "LongOnly"
   
   # Compute 10 points efficient frontier:
   portfolioFrontier(Data, Spec, Constraints)

Run the code above in your browser using DataLab