Skip to contents

Given a set of parameters, this function computes constraint violations, ensuring that all points remain inside the parallelogram.

Usage

constraints(params, x, y, y0, y1)

Arguments

params

Numeric vector of optimization parameters: x0, x1, slope.

x

Numeric vector of x-coordinates for data points.

y

Numeric vector of y-coordinates for data points.

y0

Numeric. The minimum y-value in the dataset.

y1

Numeric. The maximum y-value in the dataset.

Value

A numeric vector of constraint violations.