portfolioConstraints
Checks portfolio constraints for consistency. }portfolioConstraints(data, spec = portfolioSpec(), constraints = NULL)
fPFOLIOSPEC
, containing slots call, model,
portfolio, title, description.constraints=NULL
,
constraints="Short"
, and constraints="LongOnly"
. Note,
that these three constraint settings are not allowed to be combined
with more general constraint definitions.
NULL
: This selection defines the default value and is equivalent
to the "LongOnly"
case, see below.
"Short"
: This selection defines the case of unlimited short selling.
i.e. each weight may range between -Inf
and Inf
.
Consequently, there are no group constraints. Risk budget constraints
are not included in the portfolio optimization.
"LongOnly"
: This selection is the same as the default setting.
Each weight may range between 0
ans 1
. No group
constraints and risk budget constraints will be included in the
portfolio optimization.
Tailored Weight Constrained Portfolios:
Weight constrained portfolios may be specified by a vector of
character strings which describe executable code, setting values to
to vectors minW
, maxW
, minsumW
, and maxsumW
.
The individual string elements of the vector have the following form:
[object Object],[object Object]
Asset(s)
is an index of one or more assets, and value
a numeric value or vector assigning the desired value. Note, if the
values
range between zero and one, then we have a long only
portfolio allowing for box and group constraints of the weights. If
the values are set to negative values, and values larger than one,
then (constrained) short selling will be allowed.
Tailored Risk Budget Constrained Portfolios:
By default, risk budgets are not included in the portfolio optimization.
Covariance risk budgets have to be added explicitely, and have the
following form:
[object Object]
Again, Asset(s)
is an index of one or more assets, and value
a numeric value or vector with numbers ranging between zero and one,
assigning the desired risk budgets.PortfolioData
,
PortfolioSpec
,
fPORTFOLIO
,
PortfolioPlots
.## portfolioConstraints -
# Load Data, i.e. a List of Returns:
Data = as.timeSeries(data(smallcap.ts))
Data = Data[, c("BKE", "GG", "GYMB", "KRON")]
Data
# Specification:
Spec = portfolioSpec()
# Portfolio Constraints:
Constraints = "minW[1:4]"
portfolioConstraints(Data, Spec, Constraints)
Run the code above in your browser using DataLab