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

check_constraints

check if a set of weights satisfies the constraints


Description

This function checks if a set of weights satisfies all constraints. This is used as a helper function for random portfolios created with rp_simplex and rp_grid to eliminate portfolios that do not satisfy the constraints.

Usage

check_constraints(weights, portfolio)

Arguments

weights

vector of weights

portfolio

object of class 'portfolio'

Value

TRUE if all constraints are satisfied, FALSE if any constraint is violated

Author(s)

Ross Bennett


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.