Hostname: page-component-89b8bd64d-rbxfs Total loading time: 0 Render date: 2026-05-07T13:22:50.381Z Has data issue: false hasContentIssue false

Template-based piecewise affine regression

Published online by Cambridge University Press:  06 November 2024

A response to the following question: How to ensure safety of learning-enabled cyber-physical systems?

Guillaume O. Berger*
Affiliation:
UCLouvain, Louvain-la-Neuve, Belgium
Sriram Sankaranarayanan
Affiliation:
University of Colorado, Boulder, CO, USA
*
Corresponding author: Guillaume O. Berger; Email: guillaume.berger@uclouvain.be
Rights & Permissions [Opens in a new window]

Abstract

We study the problem of fitting a piecewise affine (PWA) function to input–output data. Our algorithm divides the input domain into finitely many regions whose shapes are specified by a user-provided template and such that the input–output data in each region are fit by an affine function within a user-provided error tolerance. We first prove that this problem is NP-hard. Then, we present a top-down algorithmic approach for solving the problem. The algorithm considers subsets of the data points in a systematic manner, trying to fit an affine function for each subset using linear regression. If regression fails on a subset, the algorithm extracts a minimal set of points from the subset (an unsatisfiable core) that is responsible for the failure. The identified core is then used to split the current subset into smaller ones. By combining this top-down scheme with a set-covering algorithm, we derive an overall approach that provides optimal PWA models for a given error tolerance, where optimality refers to minimizing the number of pieces of the PWA model. We demonstrate our approach on three numerical examples that include PWA approximations of a widely used nonlinear insulin–glucose regulation model and a double inverted pendulum with soft contacts.

Information

Type
Results
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited.
Copyright
© The Author(s), 2024. Published by Cambridge University Press
Figure 0

Figure 1. PWA regression of a set of input–output data points with rectangular template.

Figure 1

Figure 2. Left. Illustration of our algorithm on a simple data set with 11 data points $\left( {{x_k},{y_k}} \right) \in \mathbb{R} \times \mathbb{R}$. Right. the index sets explored by our algorithm.

Figure 2

Algorithm 1. Top-down algorithm to compute maximal compatible index sets

Figure 3

Algorithm 2. An implementation of FindSubsets using infeasibility certificates

Figure 4

Figure 3. FindSubsets implemented by Algo. 2 with rectangular regions. The red dots represent the infeasibility certificate $C$. Each ${I_s}$ excludes at least one point from $C$ by moving one face of the box but keeping the others unchanged.

Figure 5

Figure 4. Illustration of FindSubsets with a spatially concentrated certificate. The green and orange hatched rectangles illustrate two possible cases for $H\left( {{c_s}} \right)$ output by FindSubsets.

Figure 6

Algorithm 3. Extra step at the beginning of each iteration of Algo. 1

Figure 7

Algorithm 4. Top-down algorithm for Prob. 2.

Figure 8

Figure 5. Glucose–insulin system. (a) $100$ sampled points (black dots) on the graph of ${U_{{\rm{id}}}}$ (surface). (b,c,d) Optimal TPWA regression for various error tolerances $\varepsilon $. (e) Simulations using the nonlinear model versus the PWA approximations. (f) Error between nonlinear and PWA models averaged over $50$ simulations with different initial conditions.

Figure 9

Figure 6. Clusters of data points from SA regression.

Figure 10

Figure 7. Inverted double pendulum with soft contacts. (a): Elastic contact forces apply when $\theta $ is outside gray region, (b): optimal TPWA regression of the data with rectangular domains.

Figure 11

Figure 8. (a): Comparison with MILP approach for SA regression. Time limit is set to $1000$ secs. (b) Partition of the input space by the PWA function computed using the state-of-the-art tool PARC (Bemporad 2023).

Figure 12

Figure 9. Carts with springs. (a): Elastic contact forces apply when the springs are compressed. (b): Example of rectangular–octagonal region. (c): Optimal TPWA regression of the data with rectangular–octagonal domains. (d): Optimal TPWA regression of the data with rectangular domains.

Author Comment: Template-Based Piecewise Affine Regression — R0/PR1

Comments

No accompanying comment.

Recommendation: Template-Based Piecewise Affine Regression — R0/PR2

Comments

No accompanying comment.

Author Comment: Template-Based Piecewise Affine Regression — R1/PR4

Comments

No accompanying comment.

Decision: Template-Based Piecewise Affine Regression — R1/PR4

Comments

No accompanying comment.