Skip to content

documentation of constraints in isotonic_regression #16329

@allefeld

Description

@allefeld

The docstring of isotonic_regression says

subject to y_min = y_[1] <= y_[2] ... <= y_[n] = y_max

Notice the equalities with respect to min and max.

However, the function does not actually force the smallest estimate to be y_min and the largest to be y_max. I believe that is the correct behavior; the estimates should be constrained, not fixed.

The docstring should therefore read

        subject to y_min <= y_[1] <= y_[2] ... <= y_[n] <= y_max

If this is changed,

and min(y_) = y_min, max(y_) = y_max

should be changed as well.

What the function does is to apply np.clip, i.e. first unconstrained estimates are produced and then everything outside of [y_min, y_max] is forced to these values.

np.clip(y, y_min, y_max, y)

I am not sure that is the correct approach for constrained quadratic optimization (but also don't know positively it to be incorrect).
Tagging @bnaul and @agramfort since they seem to have introduced this line.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions