Papers
Topics
Authors
Recent
2000 character limit reached

SUGAR Matlab Toolbox Overview

Updated 31 October 2025
  • SUGAR Matlab Toolbox is a dual-purpose toolkit offering SURE-based multi-parameter optimization for inverse problems and user-friendly symbolic geometric algebra routines.
  • It employs finite-difference and Monte Carlo methods to efficiently estimate gradients and handle non-smooth regularizers in high-dimensional settings.
  • The toolbox integrates seamlessly with Matlab, supporting symbolic and numeric operations, operator overloading, and practical applications in robotics, imaging, and control.

The SUGAR Matlab Toolbox refers to two distinct toolboxes presented in separate research papers. The first, "Stein Unbiased GrAdient estimator of the Risk (SUGAR) for multiple parameter selection" (Deledalle et al., 2014), targets multi-parameter optimization in inverse problems using SURE/SUGAR theory. The second, "Symbolic and User-friendly Geometric Algebra Routines (SUGAR) for Computations in Matlab" (Velasco et al., 25 Mar 2024), delivers a geometric algebra (GA) computation environment for Matlab, emphasizing symbolic and high-dimensional algebraic operations. Each toolbox is covered below, respecting the specific mathematical and practical details in its canonical source.

1. Mathematical Framework

The SUGAR (Stein Unbiased GrAdient estimator of the Risk) Matlab Toolbox provides an algorithmic implementation for automatic multi-parameter selection in variational regularization of ill-posed inverse problems. Given observations Y=μ0+WY = \mu_0 + W (μ0=Φx0\mu_0 = \Phi x_0, WN(0,σ2I)W \sim \mathcal{N}(0, \sigma^2 I)), regularized solutions x(y,θ)=argminxH(y,Φx)+R(x,θ)x(y,\theta) = \arg\min_x H(y, \Phi x) + R(x, \theta) are computed, where θ\theta is a vector of continuous hyperparameters, often of dimensionality much higher than two.

The relevant risk is

Risk(μ0,θ)=EWμ(Y,θ)μ02\mathrm{Risk}(\mu_0, \theta) = \mathbb{E}_W \|\mu(Y, \theta) - \mu_0\|^2

with μ(y,θ)=Φx(y,θ)\mu(y, \theta) = \Phi x(y, \theta).

Stein’s Unbiased Risk Estimator (SURE), when applicable (i.e., for weakly differentiable estimators), enables unbiased estimation of the prediction risk: SURE(y,θ)=A(μ(y,θ)y)2σ2tr(AA)+2σ2df^(y,θ)\mathrm{SURE}(y, \theta) = \|A (\mu(y, \theta) - y)\|^2 - \sigma^2 \mathrm{tr}(A^*A) + 2 \sigma^2 \widehat{\mathrm{df}}(y, \theta) where the degrees of freedom are approximated by tr(AJμ(1)(y,θ)A)\mathrm{tr}(A J^{(1)}_\mu(y, \theta) A^*).

2. The SUGAR Estimator

For non-smooth regularizers (e.g., 1\ell_1 norm, total variation, nuclear norm), the classical SURE is discontinuous or non-differentiable in θ\theta, invalidating standard optimization techniques. SUGAR utilizes a finite-difference approximation for degrees of freedom: df^FD(y,θ,ϵ)=1ϵi=1P[AA(μ(y+ϵei,θ)μ(y,θ))]i\widehat{\mathrm{df}}_{\mathrm{FD}}(y, \theta, \epsilon) = \frac{1}{\epsilon} \sum_{i=1}^P [A^*A (\mu(y+\epsilon e_i, \theta) - \mu(y, \theta))]_i yielding a differentiable FD-SURE for any ϵ>0\epsilon > 0.

SUGAR then provides the gradient: SUGAR(y,θ,ϵ)=2Jμ(2)(y,θ)AA(μ(y,θ)y)+2σ2θdf^FD(y,θ,ϵ)\mathrm{SUGAR}(y, \theta, \epsilon) = 2 J^{(2)}_\mu(y, \theta)^* A^*A (\mu(y, \theta) - y) + 2 \sigma^2 \nabla_\theta \widehat{\mathrm{df}}_{\mathrm{FD}}(y, \theta, \epsilon) specifically enabling gradient-based optimization of θ\theta. For large-scale settings, a Monte Carlo version using random directions is provided: df^FD,MC(y,θ,δ,ϵ)=1ϵμ(y+ϵδ,θ)μ(y,θ),AAδ\widehat{\mathrm{df}}_{\mathrm{FD,MC}}(y, \theta, \delta, \epsilon) = \frac{1}{\epsilon} \langle \mu(y+\epsilon \delta, \theta) - \mu(y, \theta), A^*A \delta \rangle

3. Supported Algorithms and Practical Use

The toolbox targets estimators computed by iterative proximal splitting schemes (including Forward-Backward, Douglas-Rachford, Chambolle-Pock primal-dual, and Generalized Forward-Backward). SUGAR computes the appropriate chain-rule derivatives for all iterates via forward-mode algorithmic differentiation. Empirically optimal finite-difference step sizes are provided (see formula for ϵ(P)\epsilon^\star(P)).

Usage workflow: - Define the estimator function μ(y,θ)\mu(y, \theta) - Compute FD-SURE and SUGAR for data yy and parameter θ\theta - Minimize SURE using gradient-based solvers (e.g., BFGS)

The toolbox provides implementations for: - Matrix completion using nuclear norm (R(x,θ)R(x,\theta) = weighted nuclear norm) - Image restoration (deblurring, denoising) with TV or multi-scale wavelet regularization - Compressed sensing with multi-scale parameter optimization

Implementation details: - Handles weakly-differentiable proximal mappings (explicit formulas for common operators, e.g., soft-thresholding) - Offers Monte Carlo and batch finite-difference gradient modes - Efficient for high-dimensional θ\theta (multi-parameter regularization)

4. Handling of Non-Smooth Regularizers

SUGAR is both asymptotically unbiased and consistent for the weak gradient of the prediction risk (see proofs in special cases, notably soft-thresholding). This enables multidimensional parameter selection for non-smooth penalties previously tractable only via expensive grid search.

5. Advantages and Comparative Table

Feature Traditional SURE/Grid Search SUGAR Toolbox
Non-Smooth Regularizers Not differentiable, discontinuous Weakly differentiable, finite-diff SURE
Multi-Param Optimization Intractable at large dimension Efficient via gradient-based methods
Risk Gradient Access Unavailable SUGAR formula available
Supported Methods Closed-form, low-dim General proximal splitting, iterative
Applications Denoising, basic inverse problems Restoration, matrix completion, CS, etc.

A plausible implication is that SUGAR unlocks direct optimization of parameter vectors for a wide range of regularized inverse problems, moving beyond what was feasible in standard frameworks.

1. Geometric Algebra Framework and Toolbox Overview

SUGAR (Symbolic and User-friendly Geometric Algebra Routines) introduces a comprehensive open-source Matlab toolbox for geometric algebra computation supporting symbolic and numeric operations in arbitrary dimensions and signatures [p,q,r][p,q,r]. It provides Matlab-centric, operator-overloaded interfaces for standard geometric algebra (GA), projective geometric algebra (PGA), and conformal geometric algebra (CGA).

Core features:

  • Algebra construction for arbitrary signatures
  • Symbolic/numeric representation of blades and multivectors
  • Operator overloads for common GA products; supports arrays/matrices of multivectors
  • Verbose, user-friendly object-oriented design

2. Supported Algebras, Entities, and Transformations

SUGAR supports: - GA: Clifford algebra Rp,q,r\mathbb{R}^{p,q,r} - PGA: Adds null basis vectors (e2=0e^2=0), enabling translation and rotation - CGA: Adds basis vectors (e2=+1,e2=1e^2=+1, \overline{e}^2=-1), yielding conformal transformations

Geometric primitives handled include: - Points, lines, planes (GA, PGA, CGA) - Circles, spheres (CGA) - Rotors for rotations and translations (in all forms) - Arbitrary multivectors (blades of any grade)

Embedding and extraction methods follow standard formulas (e.g., Hestenes embedding for CGA: x=12x2n+n0+x\bm{x} = \frac{1}{2}x^2 n_\infty + n_0 + x).

3. Matlab Integration and User Interface

SUGAR is structured for natural Matlab workflow: - Installation by amending Matlab’s search path - Multivectors implemented as class objects (MV), supporting Matlab-style indexing, slicing, and operator overloads (+, -, *, ^, ./, etc.) - Verbose algebra creation listing basis elements - Manipulation of single multivectors, arrays, and matrices (unique in GA software) - Symbolic algebra support leverages Matlab’s symbolic toolbox

Code example:

1
2
GA([2,0,1]); % PGA
A = e1 + 5*e2 + 4*e12 - 7*e123;
Arrays of multivectors:
1
M = [e1 e2; e3 e123];

4. Multivector Functions and Advanced Operations

SUGAR provides overloaded arithmetic and extraction, as well as functions for advanced analysis: - Arithmetic/geometric/inner/outer product, inverse, power - Grade extraction, slicing, duality, reverse, normalization - Advanced functions: exp\exp, log\log, sin\sin, cos\cos, Laplace/inverse Laplace on coefficients - Visualization: plotting CGA geometric objects - Matrix operations for arrays/matrices of multivectors (det\det, pinv\text{pinv}, ctranspose\text{ctranspose}) - Conversion to LaTeX code

Typical workflow:

1
A = MV.rand([2 0 0]); exp(A); log(exp(A));

5. Application Examples

Validation covers four domains, with explicit code in the publication: - Forward kinematics (3R planar robot, PGA): Symbolic derivation using rotor products; matches classical results. - Inverse kinematics (6R serial robot, CGA): Symbolic creation/solution extraction for points on spheres and planes. - 2D rigid body dynamics (PGA): Symbolic simulation using geometric products and duality; matches advanced PGADYN results. - Power systems (GA matrices): Circuit equations solved via matrix inversion and symbolic Laplace transforms.

A plausible implication is that SUGAR enables symbolic closed-form derivations for kinematics, dynamics, and control problems previously limited to low dimensions or numerics.

6. Comparative Feature Table

Feature SUGAR Matlab Toolbox
Algebra support GA, PGA, CGA, arbitrary dimension/signature
Operations Arithmetic, geometric, inner, outer, exp, log, trig
Entities Points, lines, planes, circles, spheres, rotors
Arrays & matrices Multivector arrays and matrices
Symbolic capabilities Full integration with Matlab symbolic toolbox
Visualization CGA object plotting
Applications Robotics, control, dynamics, power electronics

A plausible implication is that the toolbox closes a gap in Matlab’s geometric algebra support for both symbolic and matrix algebraic structures, especially valuable in engineering research.

3. Concluding Remarks

The SUGAR Matlab Toolboxes, as presented in (Deledalle et al., 2014) and (Velasco et al., 25 Mar 2024), introduce robust, rigorously engineered platforms for (i) efficient variational parameter selection in noisy inverse problems via gradient-based SURE minimization and (ii) symbolic and numeric geometric algebra computations in research and engineering applications. Both are freely available and designed to integrate with Matlab workflows. Researchers and practitioners in inverse problems, model regularization, robotics, control, and power electronics are equipped with tools enabling new classes of analytic and algorithmic solutions previously restricted by available software or mathematical tractability.

Slide Deck Streamline Icon: https://streamlinehq.com

Whiteboard

Forward Email Streamline Icon: https://streamlinehq.com

Follow Topic

Get notified by email when new papers are published related to SUGAR Matlab Toolbox.