Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
braverock
GitHub Repository: braverock/portfolioanalytics
Path: blob/master/man/check_constraints.Rd
1433 views
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/constraints.R
\name{check_constraints}
\alias{check_constraints}
\title{check if a set of weights satisfies the constraints}
\usage{
check_constraints(weights, portfolio)
}
\arguments{
\item{weights}{vector of weights}

\item{portfolio}{object of class 'portfolio'}
}
\value{
TRUE if all constraints are satisfied, FALSE if any constraint is violated
}
\description{
This function checks if a set of weights satisfies all constraints. This is
used as a helper function for random portfolios created with \code{rp_simplex}
and \code{rp_grid} to eliminate portfolios that do not satisfy the constraints.
}
\author{
Ross Bennett
}