Skip to content

Commit f118cb4

Browse files
committed
update PiecewisePolynomialKernel
1 parent a2d2b7d commit f118cb4

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

docs/src/kernels.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,19 @@ where $r$ has the same dimension as $x$ and $r_i > 0$.
155155

156156
The [`PiecewisePolynomialKernel`](@ref) is defined for $x\in \mathbb{R}^D$ and $V \in \{0,1,2,3\}$ as
157157
```math
158-
k(x,x'; P, V) &= \max(1 - r, 0)^{j + V} f(r, j),
158+
k(x,x'; P, V) = \max(1 - r, 0)^{j + V} f_V(r, j),
159+
```
160+
where $r = x^\top P x'$ (with $P$ a positive-definite matrix) and $j = \lfloor \frac{D}{2}\rfloor + V + 1$.
161+
162+
The polynomials $f_V$ are defined as follows:
163+
````math
164+
\begin{aligned}
165+
f_0(r, j) &= 1, \\
166+
f_1(r, j) &= 1 + (j + 1) r, \\
167+
f_2(r, j) &= 1 + (j + 2) r + ((j^2 + 4j + 3) / 3) r^2, \\
168+
f_3(r, j) &= 1 + (j + 3) r + ((6 j^2 + 36j + 45) / 15) r^2 + ((j^3 + 9 j^2 + 23j + 15) / 15) r^3.
169+
\end{aligned}
159170
```
160-
where $r = x^\top P x'$ (with $P$ a positive-definite matrix),
161-
$j = \lfloor \frac{D}{2}\rfloor + V + 1$, and
162-
$f$ is a piecewise polynomial (see source code).
163171
164172
## Polynomial Kernels
165173

src/basekernels/piecewisepolynomial.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
PiecewisePolynomialKernel{V}(maha::AbstractMatrix)
33
44
Piecewise Polynomial covariance function with compact support, V = 0,1,2,3.
5-
The kernel functions are 2v times continuously differentiable and the corresponding
6-
processes are hence v times mean-square differentiable. The kernel function is:
5+
The kernel functions are 2V times continuously differentiable and the corresponding
6+
processes are hence V times mean-square differentiable. The kernel function is:
77
```math
88
κ(x, y) = max(1 - r, 0)^(j + V) * f(r, j) with j = floor(D / 2) + V + 1
99
```
1010
where `r` is the Mahalanobis distance mahalanobis(x,y) with `maha` as the metric.
11-
1211
"""
1312
struct PiecewisePolynomialKernel{V, A<:AbstractMatrix{<:Real}} <: SimpleKernel
1413
maha::A

0 commit comments

Comments
 (0)