Source-linked AI summary

Segmented Continuous Optimization

Teymur Aghayev

arXiv:2602.20857v2eess.SPcs.LG

TL;DR

Traditional regression methods are limited mainly to linear and polynomial functions, motivating a more general approach for oscillatory and transcendental signals. SCO performs segmented continuous fitting with user-defined nonlinear models and C1 continuity. Across tests and demonstrations, it supports analysis of local and global patterns, parameters, derivatives, and integrals, while stability techniques address error propagation under strict continuity constraints.

  • Problem

    Traditional regression algorithms mainly focus on polynomial or linear functions, which can be insufficient for analyzing signals with oscillatory or transcendental behavior.

  • Method

    SCO fits user-defined nonlinear functions in segments with C1 continuity, using bounded optimization and stability techniques to analyze non-stationary signals.

  • Results

    SCO demonstrated practical signal analysis across models and datasets, including optimized parameters, derivatives, integrals, and reported local SRMSE values of 0.553 and 0.552.

  • Takeaways & Limitations

    The framework provides a user-defined segmented representation for examining local and global signal patterns across datasets with different structure, scale, and volatility.

Abstract

from arXiv · show

Segmented curve fitting remains an essential approach for the comprehensive analysis of local patterns in non-stationary time-series data. However, traditional regression algorithms primarily focus on linear or polynomial functions, which can be insufficient for analyzing raw signals with oscillatory or transcendental behavior. In this paper, we propose Segmented Continuous Optimization (SCO), a framework that performs piecewise continuous curve fitting on various non-linear models, including trigonometric, polynomial, and exponential. SCO presents a novel signal representation by optimizing a user-defined model in segments with $C^1$ continuity to properly analyze the data's local and global trends. The framework is tested for accuracy and efficiency across all included models. Finally, we provide examples using velocity and EEG datasets to demonstrate the algorithm's practical usage in examining signal patterns, optimized parameters, derivatives, and integrals of the final fit.

I. INTRODUCTION

Traditional segmented regression emphasizes linear and polynomial functions, limiting analysis of oscillatory or transcendental signals. SCO addresses this gap by fitting user-defined functions across locally normalized, translated segments.

  • Traditional regression algorithms mainly focus on linear or polynomial functions, which can be insufficient for oscillatory or transcendental signals.
  • The framework is motivated by broad applications of piecewise analytical representations across biology, medicine, climatology, engineering, and econometrics.
  • SCO optimizes a differentiable, numerically stable user-defined function separately on K signal segments with bounded local parameters.
  • Standard scaling uses each dataset’s mean and standard deviation to improve optimization stability and speed.
  • Each segment is locally translated so parameter estimates are less influenced by the global magnitude of x.

B. Levenberg-Marquardt Optimization

SCO uses bounded Levenberg-Marquardt optimization for nonlinear least-squares fitting. Its transformed, damped, regularized, and step-limited updates are designed to improve stability and execution speed.

  • The arctanh transformation constrains parameters to user-defined lower and upper bounds during optimization.
  • JAX compiles the optimization into machine code through XLA, providing the stated speed advantage.
  • The Jacobian is converted to unconstrained space through the chain rule of the arctanh transformation.
  • Levenberg-Marquardt optimization fits the nonlinear least-squares problem, selected for fast execution and high stability.
  • Damping and ridge regularization stabilize the update, while clipping and norm scaling prevent excessively large parameter steps.

C. Continuity Enforcement

SCO enforces continuity between adjacent fitted segments by deriving boundary parameters from value and derivative matching equations. C1 continuity requires a model with a linear term, while offset-only models support C0 continuity.

  • The framework enforces C0 value continuity and C1 derivative continuity at transitions between adjacent segments.
  • For segments k > 1, two continuity parameters are excluded from LM optimization and derived during residual calculation.
  • Continuity equations match the current segment’s value and slope to those of the preceding segment at each transition.
  • C1 continuity is possible only when the model includes a linear term, whereas an offset-only model can achieve C0 continuity.
  • SCO provides presets spanning linear, polynomial, trigonometric, Gaussian, logistic, exponential, rational, and Fourier wave models.

D. Stability problems

Strict C0 and C1 continuity constraints can make nonlinear segmented fitting unstable, with errors propagating across later segments. SCO addresses this through batched optimization and Forward Fit.

  • D. Stability problems: Strict continuity constraints introduce significant nonconvexity into nonlinear optimization and can make error propagate forward across segments.An irrelevant continuity constraint caused catastrophic error propagation after the third boundary in one cubic-model example.
  • E. Stability Techniques: Batched optimization jointly optimizes q segments so an initial segment can be altered to accommodate unfavorable continuity constraints.The default batch size is q = 5.
  • E. Stability Techniques: Forward Fit optimizes q + 1 segments, discards the last fitted segment, and passes it as the next batch’s initial guess.The discarded segment is re-optimized in the next batch while retaining relevant continuity constraints.

F. Parameter Unscaling

SCO unscales optimized segment parameters after normalized and locally translated fitting so the final model retains physical meaning and units.

  • F. Parameter Unscaling: Optimized parameters are unscaled by substituting the x- and y-scaling equations back into the general function for each segment.The resulting parameters retain physical meaning and units.
  • F. Parameter Unscaling: The unscaling derivation uses locally translated x-values and the absolute x-value at each segment boundary.The local coordinate is formed relative to the segment boundary.
  • F. Parameter Unscaling: For the 5-parameter sine model, SCO substitutes the normalized sine expression before simplifying equations for each unscaled parameter.The example uses the sin5 model with amplitude, frequency, phase, slope, and intercept parameters.
  • F. Parameter Unscaling: Algorithm 1 summarizes the workflow, including normalization, local translation, continuity-parameter derivation, and batched initialization.Its inputs include the signal, user-defined function, changepoints, initial guesses, and parameter bounds.

III. EXPERIMENTS AND TESTS

The experiments evaluate SCO’s accuracy and speed on non-stationary Bitcoin, velocity, and EEG signals, demonstrating its practical usage across multiple signal types.

  • III. EXPERIMENTS AND TESTS: SCO was tested on non-stationary Bitcoin, velocity, and EEG time-series data to evaluate accuracy, speed, and practical usage.The experiments were run on an Intel i7-12700 computer with 16 GB RAM and an NVIDIA RTX 3050 GPU.

A. Algorithm Demonstration

SCO analyzes non-stationary Bitcoin data with a five-parameter sinusoidal model across six resolutions. Its final parameters support frequency, volatility, and trend analysis while achieving low local error.

  • A. Algorithm Demonstration: SCO applies a 5-parameter sinusoidal model with uniform segmentation to daily Bitcoin data across 6 resolutions.The resolutions expose short-term and long-term signal patterns.
  • A. Algorithm Demonstration: Final fitted parameters estimate local and global frequency, volatility, and trend.These quantities are associated with b0, A, and c1, respectively.

B. Accuracy and Speed Tests

SCO was evaluated across diverse datasets and models for accuracy, stability, and computational efficiency. Results show that model complexity and segmentation resolution shape both fit quality and runtime.

  • Accuracy: 30 datasets spanning different volatility, structure, scales, cryptocurrency markets, sampling intervals, extreme scales, and zero volatility were used for evaluation.Accuracy was measured primarily with local SRMSE, with global SRMSE also split into high-K and low-K metrics.
  • Accuracy: Flat segments below 1% of the dataset deviation receive a local SRMSE of 1.0 to avoid unstable error inflation.This marks nearly flat segments as neutral fits.
  • Accuracy: sin5, Gaussian, and logistic models achieved the most accurate local and global SRMSE results, while cubic, decay, and rational models had higher error.Average stability was roughly equivalent across models.
  • Accuracy: Higher segmentation mainly produced overfitting, whereas global resolutions produced higher error; Fourier had the lowest error for global patterns.Fourier optimization nevertheless failed on short and flat segments because of its instability and complexity.
  • Speed: Rational, Gaussian, and decay models were fastest, while complex models required more optimization time.Runtime depended primarily on model complexity, input length N, segment count K, initial guesses, and parameter bounds.
  • Speed: The first run was generally slower because of JAX Just-In-Time compilation, while subsequent runs reflected SCO execution speed after compilation.A warmup configuration can compile the framework initially.

C. Velocity Experiment

SCO was applied to GPS velocity data using a cubic model with 12 segments to represent local velocity patterns and derive acceleration. The fit followed the raw signals and achieved an average local SRMSE of 0.629 in 1.84 seconds.

  • Dataset and model: A cubic model with 12 segments represented local patterns in UAH-DriveSet GPS velocity data and produced analytical acceleration from the optimized fit.The experiment used a 1-lane secondary route with normal driving behavior.
  • Fit and interpretation: SCO accurately followed raw velocity and acceleration while extracting optimized parameters for examining signal dynamics.Non-uniform segmentation was selected according to changes in signal volatility.
  • Continuity: C1-continuous velocity fitting yielded a C0-continuous acceleration fit.The derivative preserves value continuity under the stated continuity relationship.
  • Performance: 0.629 average local SRMSE was achieved in 1.84 seconds.Acceleration was visualized with normalized colors because its absolute scale depends on segment length.

D. EEG Analysis

SCO applies a 5-parameter sine model across 13 EEG segments and analytically integrates the optimized curve to examine signal behavior during mental arithmetic. The framework reports local fit accuracy and execution time while supporting analysis of frequency, amplitude, and trend.

  • SCO modeled the EEG recordings in 13 segments using a 5-parameter sine model.The recordings came from subjects performing a serial-subtraction mental arithmetic task.
  • The optimized EEG curve was analytically integrated to represent total accumulated voltage during the arithmetic task.The integral was calculated as an additional signal-analysis measure.
  • Optimized parameters characterize the signal’s local and global frequency, amplitude, and trend.
  • SCO maintained an average local SRMSE of 0.552 with an execution time of 1.59 seconds.
Loading 2602.20857v2…