factor_exposure_constraint: Constructor for factor exposure constraint

View source: R/constraints.R

factor_exposure_constraintR Documentation

Constructor for factor exposure constraint

Description

The factor exposure constraint sets upper and lower bounds on exposures to risk factors. This function is called by add.constraint when type="factor_exposure" is specified, see add.constraint

Usage

factor_exposure_constraint(
  type = "factor_exposure",
  assets,
  B,
  lower,
  upper,
  enabled = TRUE,
  message = FALSE,
  ...
)

Arguments

type

character type of the constraint

assets

named vector of assets specifying initial weights

B

vector or matrix of risk factor exposures

lower

vector of lower bounds of constraints for risk factor exposures

upper

vector of upper bounds of constraints for risk factor exposures

enabled

TRUE/FALSE

message

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

...

any other passthru parameters to specify risk factor exposure constraints

Details

B can be either a vector or matrix of risk factor exposures (i.e. betas). If B is a vector, the length of B must be equal to the number of assets and lower and upper must be scalars. If B is passed in as a vector, it will be converted to a matrix with one column.

If B is a matrix, the number of rows must be equal to the number of assets and the number of columns represent the number of factors. The length of lower and upper must be equal to the number of factors. The B matrix should have column names specifying the factors and row names specifying the assets. Default column names and row names will be assigned if the user passes in a B matrix without column names or row names.

Value

an object of class 'factor_exposure_constraint'

Author(s)

Ross Bennett

See Also

add.constraint


braverock/PortfolioAnalytics documentation built on April 18, 2024, 4:09 a.m.