Online Gradient Computation for Warping Gaussian Process Transformations
Abstract
Warped Gaussian processes (GPs) handle non-Gaussian observations by mapping them into a latent standard GP via a parametric transformation called warping. Existing streaming variants, however, either optimize the warping parameters periodically or sacrifice analytical tractability for a higher model capacity. To bridge this gap, we show that the gradient of the instantaneous negative log-likelihood of a warped GP admits an exact recursive computation. Based on this result, we propose a novel online method for warped GPs that jointly updates the latent GP moments and optimizes the warping parameters.
Index Terms:
Gaussian process, warping transformation, online learning1 Introduction
Gaussian processes (GPs) provide a non-parametric Bayesian framework for probabilistic function approximation [16], proving especially useful when the true underlying function is analytically unknown or expensive to query [22, 19]. By placing a prior directly over the space of functions of interest, GPs offer a principled approach to uncertainty quantification, making them particularly attractive for applications where predictive confidence is as critical as point accuracy; for instance, in robotics [5] or geostatistics [7, 6]. Crucially, the mathematical tractability of GPs allows for exact Bayesian inference, yielding closed-form predictive distributions when paired with Gaussian function observation likelihoods.
Despite their widespread success, standard GPs are fundamentally limited by their core assumption that the function observations are adequately modeled by a joint Gaussian distribution. Indeed, this assumption often breaks down in practice, as real-world observations may exhibit heavy tails, distinct skewness, or physical constraints (such as strict positivity). Consequently, applying standard GPs to such non-Gaussian observations can produce highly inaccurate predictions and poorly calibrated uncertainty bounds.
Motivated by these limitations, warped GPs [21] extend standard GPs by applying a parametric transformation—termed warping—to non-Gaussian observations, mapping them into latent targets where standard GP assumptions hold. By jointly estimating latent GP moments and warping parameters, warped GPs accommodate complex observation likelihoods while retaining the analytical tractability of standard GPs.
However, the implementation of warped GPs in memory-constrained or real-time tasks remains a significant challenge. This is because, to the best of our knowledge, there is no online method to jointly update the latent GP moments and optimize the warping parameters of warped GPs. The methods arguably closest to this work in the literature either optimize the warping parameters periodically [12] or trade analytical tractability for higher model capacity [2].
In this paper, we show that the gradient of the negative log-likelihood (NLL) of a warped GP can be computed recursively in a exact manner. Based on this, we propose a novel online method for warped GPs that jointly updates the latent GP moments and optimizes the warping parameters.
2 Background
Consider the problem of inferring an unknown, real-valued function over an arbitrary -dimensional input space , based on prior beliefs about its function space and a set of (possibly corrupted) function observations at corresponding input locations .
Such a problem can be addressed analytically, provided certain assumptions hold, as we detail next.
2.1 Gaussian processes
A GP model typically assumes the function is a realization of a zero-mean GP prior and the function observations are corrupted by white Gaussian noise. That is,
| (1a) | ||||
| (1b) | ||||
where the kernel is the covariance function of the GP prior, and each is an observation noise term with standard deviation .
Thanks to Gaussianity and the closure properties of GPs [16], the posterior distribution over functions conditioned on a set of observations collected in the observation vector is also Gaussian. Specifically,
| (2) |
with closed-form posterior mean and variance
| (3a) | ||||
| (3b) | ||||
respectively, where
| (4a) | ||||
| (4b) | ||||
with and constructed as and , for all .
To aid conceptual understanding, an illustration of the prior (1a) and posterior (2) of a GP is provided in Fig. 1.
2.1.1 Recursive Gaussian process updates
Direct computation of the terms and for the posterior moments in (3) scales poorly with the number of observations , mostly due to the matrix inversion on the right-hand side of (4b). Fortunately, one can still compute these terms exactly, but at a reduced computational load, by exploiting the following recursive structure
| (5a) | ||||
| (5b) | ||||
where , and . Thus, the GP posterior (2) can be updated recursively as each new observation and associated input location become available, simply by maintaining and as state variables.
2.1.2 Sparse Gaussian process updates
Indeed, the recursive updates in Sec. 2.1.1 effectively avoid the computational complexity bottleneck of an matrix inversion. However, computing the posterior moments in (3) still requires evaluating an vector dot product for the mean and an quadratic form for the variance. That is, the computational and memory requirements scale as for the mean, and for the variance.
This unbounded growth with the number of observations , is known in the literature as the “curse of kernelization” [23, 3] and is typically addressed via kernel approximation methods such as Nyström [24] and random Fourier features [15, 13], or via dictionary-based sparsification methods including forgetting mechanisms [20] and the approximate linear dependency (ALD) technique [8, 9].
2.2 Warped Gaussian processes
Warped GP models assume that observations follow a GP model only after applying a monotonic, parametric, and differentiable transformation referred to as warping [21]. Specifically, given a warping transformation of parameters , the observation model in (1b) becomes
| (6) |
where each serves as a latent target. Accordingly, the term , defined in (4a), becomes , with .
Warped GPs can be seen as a generalization of GPs. In fact, they are typically non-Gaussian and even asymmetric in the observation space.
By invoking the change of variables formula [4, Ch. 2], the joint probability density of any observations can be expressed in terms of the corresponding density of latent targets , and the warping transformation and warping parameters . Specifically,
| (7) |
where applies the warping transformation elementwise, and the joint probability of latent targets follows
| (8) |
by construction from (6).
One of the greatest strengths of warped GPs is that the warping parameters can be estimated directly from the observations without requiring explicit knowledge of their joint probability density . As long as the latent density and the warping transformation are defined, (7) provides a tractable likelihood that can be optimized.
3 Recursive gradient computation
The -observation joint NLL
| (9) |
measures the discrepancy between the observations and the joint probability density (implicitly) described by the warping parameters . Using the multiplication rule of probability [17], one can readily get that
| (10) |
where the instantaneous NLL
| (11) |
quantifies how unexpected the last observation was given the previous observations .
In many applications, the set of observations is too large to fit in memory, or is streamed, rendering standard batch processing intractable. As a result, estimating the warping parameters by directly minimizing the NLL in (9) with respect to may not be possible in practice. On the other hand, by exploiting the additive decomposition of the NLL in (10), one can naturally transition from a batch to an online estimation framework. Specifically, the warping parameter estimate can be iteratively refined utilizing the gradient of the instantaneous NLL, e.g., by a first-order method [1].
Although evaluating every instantaneous NLL depends on the previous observations , Theorem 3.1 demonstrates that its gradient can be computed recursively.
Theorem 3.1 (Recursive gradient computation).
The gradient of the instantaneous NLL in (11) with respect to the warping parameters can be computed as
| (12) |
where the terms and correspond to
| (13a) | ||||
| (13b) | ||||
with , and the term acts as a state variable updated according to
| (14) |
Proof.
See the supplementary material S1. ∎
As a result, the gradient of the instantaneous NLL can be updated recursively as each new observation and associated input location become available by maintaining , (as in Sec. 2.1.1), and as state variables.
4 Proposed online method
Algorithm 1 outlines the proposed online method for warped GPs, which jointly updates the latent GP moments and optimizes the warping parameters. It integrates the recursive GP updates from Sec. 2.1.1, the recursive gradient computation of the instantaneous NLL from Sec. 3, and the ALD sparsification technique introduced in Sec. 2.1.2. As a result, the update rule (12) yields an approximate gradient.
5 Revisiting the 1D regression task
To evaluate our proposed method, we adapt the simple 1D regression task introduced in [21, Sec. 4] to an online setting. This task is specifically designed to generate non-Gaussian observations with sharp transitions, causing standard GPs to fail; therefore, relying entirely on the modeling capabilities of the warped GP.
Experimental setup. The input domain is the real subset . The observational data are generated from a sinusoidal signal corrupted by white Gaussian noise followed by a cubic root transformation. That is, every th observation is generated as with . Then, we generate realizations of uniformly spaced observations each. That is, a total of observations, input location pairs that are fed sequentially to the warped GP model.
Model configuration. The choice of warping transformation follows that of the revisited task. That is, , where , and , to ensure monotonicity. We use terms, which leads to a total of warping parameters. Similarly, the choice of the covariance function remains the same, i.e., , with , and . Lastly, the noise standard deviation of the latent observation model is set to .
Implementation details. We use the Adam11 1 Pytorch [14] default configuration. optimizer [11], followed by a projection onto the feasible set . We set the ALD threshold to .
Results. The results of the experiment are summarized in Fig. 2. Fig. 2a shows that the predictions of the warped GP closely align with the true generating distribution. On the other hand, Fig. 2b shows that the learned warped transformation closely resembles the true generating cubic transformations in the region of interest where most observations lie, i.e., . It also shows that its inversion is numerically stable. The (ALD sparsification) dictionary ends up with atoms. Finally, the warped GP achieves an empirical NLL of nats per observation. This is a nat improvement over a standard GP under an identical model configuration except for a well-calibrated noise variance.
6 Conclusion and future work
We presented a recursive gradient evaluation for the instantaneous NLL of warped GPs, requiring only one extra state variable over standard recursive implementations. Building on this result, we introduced an online algorithm for jointly updating latent GP moments and optimizing warping parameters, demonstrating its performance on a warped GP benchmark. Future work includes online learning of the kernel parameters (or directly a suitable kernel [18]) and the observation model noise variance; evaluations on broader benchmarks are underway.
References
- [1] (2017) First-order methods in optimization. SIAM. Cited by: §3.
- [2] (2016) Deep gaussian processes for regression using approximate expectation propagation. In International conference on machine learning, pp. 1472–1481. Cited by: §1.
- [3] (2017) Efficient second-order online kernel learning with adaptive embedding. Advances in Neural Information Processing Systems 30. Cited by: §2.1.2.
- [4] (2024) Statistical inference. CRC press. Cited by: §2.2.
- [5] (2011) PILCO: a model-based and data-efficient approach to policy search. In Proceedings of the 28th International Conference on machine learning (ICML-11), pp. 465–472. Cited by: §1.
- [6] (2026) Deep-aerogp: deep kernel learning for projecting the regional climate response to anthropogenic aerosol emission changes. Technical report Copernicus Meetings. Cited by: §1.
- [7] (1998) Model-based geostatistics. Journal of the Royal Statistical Society Series C: Applied Statistics 47 (3), pp. 299–350. Cited by: §1.
- [8] (2004) The kernel recursive least-squares algorithm. IEEE Transactions on signal processing 52 (8), pp. 2275–2285. Cited by: §2.1.2.
- [9] (2005) Algorithms and representations for reinforcement learning. Hebrew University of Jerusalem Jerusalem. Cited by: §2.1.2.
- [10] (2012) Matrix analysis. Cambridge university press. Cited by: §S3.1, §S3.2, §S3.2.
- [11] (2014) Adam: a method for stochastic optimization. arXiv preprint arXiv:1412.6980. Cited by: §5.
- [12] (2013) Sparse online warped gaussian process for wind power probabilistic forecasting. Applied energy 108, pp. 410–428. Cited by: §1.
- [13] (2023) Sparse online learning with kernels using random features for estimating nonlinear dynamic graphs. IEEE Transactions on Signal Processing 71, pp. 2027–2042. Cited by: §2.1.2.
- [14] (2019) Pytorch: an imperative style, high-performance deep learning library. Advances in neural information processing systems 32. Cited by: footnote 1.
- [15] (2007) Random features for large-scale kernel machines. Advances in neural information processing systems 20. Cited by: §2.1.2.
- [16] (2003) Gaussian processes in machine learning. In Summer school on machine learning, pp. 63–71. Cited by: §1, Figure 1, §2.1.
- [17] (2014) A first course in probability. Vol. 8, Pearson London. Cited by: §3.
- [18] (2023) An online multiple kernel parallelizable learning scheme. IEEE Signal Processing Letters 31, pp. 121–125. Cited by: §6.
- [19] (2025) Doubly truncated mode kriging. In 2025 IEEE Statistical Signal Processing Workshop (SSP), pp. 306–310. Cited by: §1.
- [20] (2014) Online learning in reproducing kernel hilbert spaces. In Academic Press Library in Signal Processing, Vol. 1, pp. 883–987. Cited by: §2.1.2.
- [21] (2003) Warped gaussian processes. Advances in neural information processing systems 16. Cited by: §1, §2.2, §5.
- [22] (2020) A survey of constrained gaussian process regression: approaches and implementation challenges. Journal of Machine Learning for Modeling and Computing 1 (2). Cited by: §1.
- [23] (2012) Breaking the curse of kernelization: budgeted stochastic gradient descent for large-scale svm training. The Journal of Machine Learning Research 13 (1), pp. 3103–3131. Cited by: §2.1.2.
- [24] (2000) Using the nyström method to speed up kernel machines. Advances in neural information processing systems 13. Cited by: §2.1.2.
Supplementary material for “Online Gradient Computation for Warping Gaussian Process Transformations”
Proof of Theorem 3.1
The NLL in (9) corresponds to
| (s1a) | ||||
| (s1b) | ||||
| (s1c) | ||||
Its gradient with respect to the warping parameters is thus,
| (s2a) | ||||
| (s2b) | ||||
where
| (s3a) | ||||
| (s3b) | ||||
| (s3c) | ||||
The first term in (s2b) can be expanded by using the recursive representation of described in (5b) as
| (s4a) | ||||
| (s4b) | ||||
| (s4c) | ||||
where
| (s5a) | ||||
| (s5b) | ||||
Note that already admits a recursive update rule since it is expressed in terms of the current latent target and its corresponding location , and the previous state terms and . Explicitly,
| (s6a) | ||||
| (s6b) | ||||
| (s6c) | ||||
Regarding , we maintain an additional state term to enable recursive updates. Specifically,
| (s7a) | ||||
| (s7b) | ||||
| (s7c) | ||||
and accordingly,
| (s8a) | ||||
| (s8b) | ||||
ALD sparsification
Consider a feature mapping such that for all , an ongoing trajectory of input locations , and a dictionary (sparse set) of representative input locations collected across that trajectory.
Every time a new input location is presented, we check whether its feature representation is approximately linearly dependent on the feature representation of the previously collected input locations in where . That is, we check whether the squared distance between and is less than or equal to a user-defined threshold . If it is, the dictionary remains the same, i.e., . If not, we update the dictionary to include the new input location, i.e., .
Explicitly,
| (s11a) | ||||
| (s11b) | ||||
| (s11c) | ||||
| (s11d) | ||||
| (s11e) | ||||
where and are constructed as and for all and . Thus, finding consists of solving a convex quadratic optimization problem with a closed-form solution
| (s12a) | ||||
| (s12b) | ||||
From here, if is included in (meaning that ), we set the approximation coefficients as since can be exactly represented by itself. If not (meaning that ), we set with as in (s12b).
Let us construct the matrix of size . By the sparsification procedure, we know that every th feature is approximately linearly dependent on the features of the input locations in , i.e., . Based on this, we can approximate where is a matrix of size , and is a matrix of size for which each th row is constructed by padding zeros to until dimension . On the other hand, we know that by construction. As a result, we can approximate
| (s13a) | ||||
| (s13b) | ||||
| (s13c) | ||||
Similarly,
| (s14a) | ||||
| (s14b) | ||||
| (s14c) | ||||
ALD sparse and recursive Gaussian process updates
The goal is updating the approximated posterior moments in (s15) from the current observation , input location , and the previous state variables and . Recall from Sec. S2 that every th input location may either be left out of the dictionary, in which case , or added to it, in which case . Depending on the case, the recursive update will vary accordingly.
S3.1 Case (meaning that )
Since the dictionary remains unchanged
| (s17a) | ||||
| (s17b) | ||||
| (s17c) | ||||
Then,
| (s18a) | ||||
| (s18b) | ||||
| (s18c) | ||||
Notice that,
| (s19a) | ||||
| (s19b) | ||||
| (s19c) | ||||
| (s19d) | ||||
Therefore,
| (s20) |
and applying the partitioned (symmetric and positive semi-definite) matrix inverse formula [10, Ch. 0.7] we get
| (s21) |
where
| (s22a) | ||||
| (s22b) | ||||
Now,
| (s23a) | ||||
| (s23b) | ||||
| (s23c) | ||||
where
| (s24) |
In the same way,
| (s25a) | ||||
| (s25b) | ||||
| (s25c) | ||||
where
| (s26) |
Finally,
| (s27a) | ||||
| (s27b) | ||||
| (s27c) | ||||
| (s27d) | ||||
| (s27e) | ||||
| (s27f) | ||||
S3.2 Case (meaning that )
In this case,
| (s28a) | ||||
| (s28b) | ||||
| (s28c) | ||||
Then,
| (s29a) | ||||
| (s29b) | ||||
| (s29c) | ||||
| (s29d) | ||||
and applying the partitioned (symmetric and positive semi-definite) matrix inverse formula [10, Ch. 0.7] we get
| (s30) |
where
| (s31a) | ||||
| (s31b) | ||||
From here, we are able to expand
| (s32a) | ||||
| (s32b) | ||||
| (s32c) | ||||
where
| (s33) |
Similarly,
| (s34a) | ||||
| (s34b) | ||||
| (s34c) | ||||
where
| (s35) |
Finally,
| (s36a) | ||||
| (s36b) | ||||
| (s36c) | ||||
| (s36d) | ||||
| (s36e) | ||||
| (s36f) | ||||
S3.3 Comments on the computational and memory complexity
The per-step computational and memory complexity of Algorithm 1 is , where is the ALD sparsification dictionary size, and is the number of warping parameters.
The following operations dominate this complexity:
- •
Evaluating the kernel vector is , since it evaluates the kernel between and each of the dictionary elements.
- •
Computing the ALD projection coefficients is since is updated via a rank-1 block inversion.
- •
Evaluating the warping transformation used in Sec. 5 (and its gradient) is due to basic arithmetic and operations.
- •
Computing the matrix-vector products and is and , respectively, due to the matrix and vector dimensions.
- •
Finally, updating and is and , respectively, due to the rank-1 outer products and in their update rules.