Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

pos_limit_fail

function to check for violation of position limits constraints


Description

This is used as a helper function for rp_transform to check for violation of position limit constraints. The position limit constraints checked are max_pos, max_pos_long, and max_pos_short.

Usage

pos_limit_fail(weights, max_pos, max_pos_long, max_pos_short)

Arguments

weights

vector of weights to test

max_pos

maximum number of assets with non-zero weights

max_pos_long

maximum number of assets with long (i.e. buy) positions

max_pos_short

maximum number of assets with short (i.e. sell) positions

Value

TRUE if any position_limit is violated. FALSE if all position limits are satisfied


PortfolioAnalytics

Portfolio Analysis, Including Numerical Methods for Optimization of Portfolios

v1.1.0
GPL-2 | GPL-3
Authors
Brian G. Peterson [cre, aut, cph], Peter Carl [aut, cph], Kris Boudt [ctb, cph], Ross Bennett [ctb, cph], Hezky Varon [ctb], Guy Yollin [ctb], R. Douglas Martin [ctb]
Initial release
2018-05-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.