Learn R Programming

fPortfolio (version 280.73)

setSpec: Specification of Portfolios

Description

Functions to set specifications for a portfolio. The functions are: ll{ setType Sets type of portfolio optimization, setOptimize Sets what to optimize, min risk or max return, setEstimator Sets names of mean and covariance estimators, setParams Sets optional model parameters, setWeights Sets weights vector, setTargetReturn Sets target return value, setTargetRisk Sets target risk value, setTargetAlpha Sets CVaR target alpha value, setRiskFreeRate Sets risk-free rate value, setNFrontierPoints Sets number of frontier points, setStatus Sets status value, setSolver Sets the type of solver to be used, setObjective Sets objective function name to be used, setTrace Sets the logical trace flag. }

Usage

setType(spec) <- value
setOptimize(spec) <- value
setEstimator(spec) <- value
setTailRisk(spec) <- value
setParams(spec) <- value
setAlpha(spec) <- value

setWeights(spec) <- value setTargetReturn(spec) <- value setTargetRisk(spec) <- value setRiskFreeRate(spec) <- value setNFrontierPoints(spec) <- value setStatus(spec) <- value

setSolver(spec) <- value setObjective(spec) <- value setTrace(spec) <- value

Arguments

spec
an S4 object of class fPFOLIOSPEC, the specification to be modified, by default the default of the function portfolioSpec().
value
a value for that component of spec to be set.

Value

  • setType setOptimize setEstimator setParam Model Settings: just modify the model settings including the portfolio type, the mean/covariance estimator, and optional parameters of an existing portfolio structure. setWeights setTargetReturn setTargetRisk setTargetAlpha setRiskFreeRate setNFrontierPoints setStatus Portfolio Settings: just modify the portfolio settings including predefined weights, the target return, the risk free rate, the number of frontier points, and the return and risk range of an existing portfolio structure. setSolver setObjective setTrace Optim Settings: just modifies the solver setting, i.e. the type of solver to be used for portfolio optimization.

Details

The function portfolioSpec() allows to set the values for the specification structure from scratch. To modify individual settings one can use the set functions.

Examples

Run this code
## portfolioSpec -
   # Show Default Portfolio Specifications:
   Spec = portfolioSpec()
   
## setRiskFreeRate - 
   # Change Risk Free Rate
   setRiskFreeRate(Spec) = 3
   Spec

Run the code above in your browser using DataLab