return_constraint: constructor for return_constraint

Description Usage Arguments Value Author(s) See Also Examples

Description

The return constraint specifes a target mean return value. This function is called by add.constraint when type="return" is specified, add.constraint

Usage

1
2
return_constraint(type = "return", return_target, enabled = TRUE,
  message = FALSE, ...)

Arguments

type

character type of the constraint

return_target

return target value

enabled

TRUE/FALSE

message

TRUE/FALSE. The default is message=FALSE. Display messages if TRUE.

...

any other passthru parameters

Value

an object of class 'return_constraint'

Author(s)

Ross Bennett

See Also

add.constraint

Examples

1
2
3
4
5
6
data(edhec)
ret <- edhec[, 1:4]

pspec <- portfolio.spec(assets=colnames(ret))

pspec <- add.constraint(portfolio=pspec, type="return", return_target=mean(colMeans(ret)))

Example output

Loading required package: zoo

Attaching package:zooThe following objects are masked frompackage:base:

    as.Date, as.Date.numeric

Loading required package: xts
Loading required package: foreach
Loading required package: PerformanceAnalytics

Attaching package:PerformanceAnalyticsThe following object is masked frompackage:graphics:

    legend

PortfolioAnalytics documentation built on May 1, 2019, 10:56 p.m.