check_constraints: check if a set of weights satisfies the constraints

View source: R/constraints.R

check_constraintsR Documentation

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 documentation built on July 4, 2024, 1:06 a.m.