Learn R Programming

PortfolioAnalytics (version 2.1.0)

group_fail: Test if group constraints have been violated

Description

The function loops through each group and tests if cLO or cUP have been violated for the given group. This is a helper function for rp_transform.

Usage

group_fail(weights, groups, cLO, cUP, group_pos = NULL)

Value

logical vector: TRUE if group constraints are violated for a given group

Arguments

weights

weights vector to test

groups

list of vectors specifying the groups of the assets

cLO

numeric or vector specifying minimum weight group constraints

cUP

numeric or vector specifying minimum weight group constraints

group_pos

vector specifying the number of non-zero weights per group

Author

Ross Bennett