SLIDE 1
Programming Derivatives of RBFs Robert Schaback - - PowerPoint PPT Presentation
Programming Derivatives of RBFs Robert Schaback - - PowerPoint PPT Presentation
Programming Derivatives of RBFs Robert Schaback Georg-August-Universitt Gttingen Akademie der Wissenschaften zu Gttingen ICERM August 2017 Overview Motivation Examples Theory Remarks on Implementation Summary and Outlook Motivation
SLIDE 2
SLIDE 3
Motivation
SLIDE 4
Motivation: Need for Derivatives
SLIDE 5
Motivation: Need for Derivatives
For unsymmetric collocation you have to take ∆
SLIDE 6
Motivation: Need for Derivatives
For unsymmetric collocation you have to take ∆ For symmetric collocation you have to take ∆ and ∆2
SLIDE 7
Motivation: Need for Derivatives
For unsymmetric collocation you have to take ∆ For symmetric collocation you have to take ∆ and ∆2 For divergence-free vector fields derived from kernels K you need (∇∇T − ∆ · Id)K
SLIDE 8
Motivation: Need for Derivatives
For unsymmetric collocation you have to take ∆ For symmetric collocation you have to take ∆ and ∆2 For divergence-free vector fields derived from kernels K you need (∇∇T − ∆ · Id)K Students never get derivatives right
SLIDE 9
Idea: Recursion
SLIDE 10
Idea: Recursion
Observation: Derivatives of RBFs often are (modified) RBFs
SLIDE 11
Idea: Recursion
Observation: Derivatives of RBFs often are (modified) RBFs Assume RBF family {φp(r)}p parametrized by p
SLIDE 12
Idea: Recursion
Observation: Derivatives of RBFs often are (modified) RBFs Assume RBF family {φp(r)}p parametrized by p Express derivatives via φp(r), φp−1(r) etc.
SLIDE 13
Idea: Recursion
Observation: Derivatives of RBFs often are (modified) RBFs Assume RBF family {φp(r)}p parametrized by p Express derivatives via φp(r), φp−1(r) etc. Observation: Strange pattern of derivative recursions
SLIDE 14
Idea: Recursion
Observation: Derivatives of RBFs often are (modified) RBFs Assume RBF family {φp(r)}p parametrized by p Express derivatives via φp(r), φp−1(r) etc. Observation: Strange pattern of derivative recursions Observation: The pattern comes from the f-form of RBFs
SLIDE 15
Idea: Recursion on f-form
SLIDE 16
Idea: Recursion on f-form
Write φp(r) = fp(r2/2) or φp( √ 2s) = fp(s), s = r2/2
SLIDE 17
Idea: Recursion on f-form
Write φp(r) = fp(r2/2) or φp( √ 2s) = fp(s), s = r2/2 Well-known from Bocher-Schoenberg theory
SLIDE 18
Idea: Recursion on f-form
Write φp(r) = fp(r2/2) or φp( √ 2s) = fp(s), s = r2/2 Well-known from Bocher-Schoenberg theory Goal: Express fp derivatives via fp−1, fp−2 etc.
SLIDE 19
Examples
SLIDE 20
Example: Gaussian
φ(r) = exp(−r2/2)
SLIDE 21
Example: Gaussian
φ(r) = exp(−r2/2) f(s) = exp(−s)
SLIDE 22
Example: Gaussian
φ(r) = exp(−r2/2) f(s) = exp(−s) f ′(s) = −f(s)
SLIDE 23
Example: Multiquadrics
φm(r) = (1 + r2/2)−m
SLIDE 24
Example: Multiquadrics
φm(r) = (1 + r2/2)−m fm(s) = (1 + s)−m
SLIDE 25
Example: Multiquadrics
φm(r) = (1 + r2/2)−m fm(s) = (1 + s)−m f ′
m(s) = −m fm+1(s)
SLIDE 26
Example: Powers
φm(r) = rm
SLIDE 27
Example: Powers
φm(r) = rm fm(s) = ( √ 2s)m
SLIDE 28
Example: Powers
φm(r) = rm fm(s) = ( √ 2s)m d ds √ 2s = 1/ √ 2s
SLIDE 29
Example: Powers
φm(r) = rm fm(s) = ( √ 2s)m d ds √ 2s = 1/ √ 2s f ′
m(s) = m (
√ 2s)m−1/ √ 2s = m fm−2(s)
SLIDE 30
Example: Thin-Plate Splines
φ2m(r) = r2m log r
SLIDE 31
Example: Thin-Plate Splines
φ2m(r) = r2m log r f2m(s) = ( √ 2s)2m log( √ 2s)
SLIDE 32
Example: Thin-Plate Splines
φ2m(r) = r2m log r f2m(s) = ( √ 2s)2m log( √ 2s) f ′
2m(s)
= 2m( √ 2s)2m−1 log( √ 2s)/ √ 2s + ( √ 2s)2m/(2s) = 2m f2m−2(s) + (2s)m−1
- = polynomial
SLIDE 33
Example: Thin-Plate Splines
φ2m(r) = r2m log r f2m(s) = ( √ 2s)2m log( √ 2s) f ′
2m(s)
= 2m( √ 2s)2m−1 log( √ 2s)/ √ 2s + ( √ 2s)2m/(2s) = 2m f2m−2(s) + (2s)m−1
- = polynomial
The polynomial part vanishes in the conditional positive definite setting
SLIDE 34
Example: Thin-Plate Splines
φ2m(r) = r2m log r f2m(s) = ( √ 2s)2m log( √ 2s) f ′
2m(s)
= 2m( √ 2s)2m−1 log( √ 2s)/ √ 2s + ( √ 2s)2m/(2s) = 2m f2m−2(s) + (2s)m−1
- = polynomial
The polynomial part vanishes in the conditional positive definite setting Dealing with powers is clear
SLIDE 35
Matérn-Sobolev Kernels
φν(r) = rνKν(r)
SLIDE 36
Matérn-Sobolev Kernels
φν(r) = rνKν(r) fν(s) = ( √ 2s)νKν( √ 2s)
SLIDE 37
Matérn-Sobolev Kernels
φν(r) = rνKν(r) fν(s) = ( √ 2s)νKν( √ 2s) d dz (zνKν(z)) = −zνKν−1(z)
SLIDE 38
Matérn-Sobolev Kernels
φν(r) = rνKν(r) fν(s) = ( √ 2s)νKν( √ 2s) d dz (zνKν(z)) = −zνKν−1(z) f ′
ν(s) = −(
√ 2s)νKν−1( √ 2s)/ √ 2s = −fν−1(s)
SLIDE 39
Matérn-Sobolev Kernels
φν(r) = rνKν(r) fν(s) = ( √ 2s)νKν( √ 2s) d dz (zνKν(z)) = −zνKν−1(z) f ′
ν(s) = −(
√ 2s)νKν−1( √ 2s)/ √ 2s = −fν−1(s) This would not work without s = r2/2
SLIDE 40
Matérn-Sobolev Kernels
φν(r) = rνKν(r) fν(s) = ( √ 2s)νKν( √ 2s) d dz (zνKν(z)) = −zνKν−1(z) f ′
ν(s) = −(
√ 2s)νKν−1( √ 2s)/ √ 2s = −fν−1(s) This would not work without s = r2/2 ν = m − d/2 ⇒ ν − 1 means m ⇒ m − 1 or d ⇒ d + 2
SLIDE 41
Wendland Kernels
φd,k in C2k, SPD on Rd, minimal degree ⌊d/2⌋ + 3k + 1 φℓ(r) := (1 − r)ℓ
+
(Iφ)(r) := ∞
r
tφ(t)dt φd,k(r) := Ikφ⌊d/2⌋+k+1(r) fd,k(s) := Ikφ⌊d/2⌋+k+1( √ 2s) (Iφ)′(r) = −rφ(r) f ′
d,k(s)
= − √ 2s Ik−1φ⌊d/2⌋+k+1( √ 2s)/ √ 2s = −Ik−1φ⌊(d+2)/2⌋+k−1+1( √ 2s) = −fd+2,k−1(s) This would not work without s = r2/2
SLIDE 42
Laplacian
∆φ(r) = φ′′(r) + (d − 1)φ′(r) r (singular!) φ(r) = f(r2/2) φ′(r) = r f ′(r2/2) φ′′(r) = r2 f ′′(r2/2) + f ′(r2/2) ∆φ = r2 f ′′(r2/2) + d f ′(r2/2) = 2sf ′′(s) + df ′(s) ∆2φ = 4s2f (4)(s) + 4sdf (3)(s) + d2f ′′(s) No visible singularities in f-form Other derivatives via e.g. d dx φ(r) = φ′(r)x r = r f ′(r2/2)x r = xf ′(s)
SLIDE 43
Theory
SLIDE 44
General Result
Theorem (Dimension walk) Radial Fourier transform Fd on Rd implies Fd+2f ′
p = −Fdfp
SLIDE 45
General Result
Theorem (Dimension walk) Radial Fourier transform Fd on Rd implies Fd+2f ′
p = −Fdfp
Closedness Assumption between {fp}p and {gq}q Fdfp = gA(d,p), Fdgq = fB(d,q)
SLIDE 46
General Result
Theorem (Dimension walk) Radial Fourier transform Fd on Rd implies Fd+2f ′
p = −Fdfp
Closedness Assumption between {fp}p and {gq}q Fdfp = gA(d,p), Fdgq = fB(d,q) Theorem: f ′
p = −Fd+2Fdfp = −fB(d+2,A(d,p))
SLIDE 47
General Result
Theorem (Dimension walk) Radial Fourier transform Fd on Rd implies Fd+2f ′
p = −Fdfp
Closedness Assumption between {fp}p and {gq}q Fdfp = gA(d,p), Fdgq = fB(d,q) Theorem: f ′
p = −Fd+2Fdfp = −fB(d+2,A(d,p))
No separate derivative program needed
SLIDE 48
General Result
Theorem (Dimension walk) Radial Fourier transform Fd on Rd implies Fd+2f ′
p = −Fdfp
Closedness Assumption between {fp}p and {gq}q Fdfp = gA(d,p), Fdgq = fB(d,q) Theorem: f ′
p = −Fd+2Fdfp = −fB(d+2,A(d,p))
No separate derivative program needed Derivatives and dimensions may be fractional
SLIDE 49
Proof of Dimension Walk
Radial Fourier transform Fν for ν = (d − 2)/2: (Fνfp)(t) = ∞ fp(s)sνHν(st)ds fp(s) = ∞ (Fνfp)(t)tνHν(ts)dt (z/2)−ν Jν(z) = Hν(−z2/4) = ∞
k=0 (−z2/4)k k!Γ(k+ν+1)
H′
ν
= −Hν+1, d ⇒ d + 2 f ′
p(s)
= ∞ (Fνfp)(t)tνtH′
ν(ts)dt
= − ∞ (Fνfp)(t)tν+1H′
ν+1(ts)dt
= −F −1
ν+1Fν(fp)(s)
Fν+1f ′
p
= −Fνfp
SLIDE 50
Remarks on Implementation
SLIDE 51
Matrix Formulation
Kernel matrix φ(xj − yk2) = f(xj − yk2
2/2)
function dsqh=distsqh(X, Y) % X and Y are matrices with points as rows nX=length(X(:,1));nY=length(Y(:,1)); Xsh=sum((X.*X)’)/2; Ysh=sum((Y.*Y)’)/2; dsqh=repmat(Xsh’,1,nY)+repmat(Ysh,nX,1)-X*Y’;
SLIDE 52
Matrix Formulation
Kernel matrix φ(xj − yk2) = f(xj − yk2
2/2)
Write f as program on a matrix S = (xj − yk2
2/2)
function dsqh=distsqh(X, Y) % X and Y are matrices with points as rows nX=length(X(:,1));nY=length(Y(:,1)); Xsh=sum((X.*X)’)/2; Ysh=sum((Y.*Y)’)/2; dsqh=repmat(Xsh’,1,nY)+repmat(Ysh,nX,1)-X*Y’;
SLIDE 53
Matrix Formulation
Kernel matrix φ(xj − yk2) = f(xj − yk2
2/2)
Write f as program on a matrix S = (xj − yk2
2/2)
Use xj − yk2
2/2 = xj2 2/2 + yk2/2 − (xj, yk)
function dsqh=distsqh(X, Y) % X and Y are matrices with points as rows nX=length(X(:,1));nY=length(Y(:,1)); Xsh=sum((X.*X)’)/2; Ysh=sum((Y.*Y)’)/2; dsqh=repmat(Xsh’,1,nY)+repmat(Ysh,nX,1)-X*Y’;
SLIDE 54
Matrix Formulation
Kernel matrix φ(xj − yk2) = f(xj − yk2
2/2)
Write f as program on a matrix S = (xj − yk2
2/2)
Use xj − yk2
2/2 = xj2 2/2 + yk2/2 − (xj, yk)
No square roots, no loops for this function dsqh=distsqh(X, Y) % X and Y are matrices with points as rows nX=length(X(:,1));nY=length(Y(:,1)); Xsh=sum((X.*X)’)/2; Ysh=sum((Y.*Y)’)/2; dsqh=repmat(Xsh’,1,nY)+repmat(Ysh,nX,1)-X*Y’;
SLIDE 55
Calculation of f-Form
S=distsqh(X,Y);
SLIDE 56
Calculation of f-Form
S=distsqh(X,Y); F=frbf(S,k) calculates f k(S) on matrix S
SLIDE 57
Calculation of f-Form
S=distsqh(X,Y); F=frbf(S,k) calculates f k(S) on matrix S RBF type, scale, parameters controlled by globals
SLIDE 58
Calculation of f-Form
S=distsqh(X,Y); F=frbf(S,k) calculates f k(S) on matrix S RBF type, scale, parameters controlled by globals E.g.: Laplacian is d*frbf(S,1)+2*S.*frbf(S,2)
SLIDE 59
Summary and Outlook
SLIDE 60
Summary
You don’t need to program derivatives, if you program a whole family of RBFs that is closed under double Fourier transforms
- wrt. different dimensions
SLIDE 61
Summary
You don’t need to program derivatives, if you program a whole family of RBFs that is closed under double Fourier transforms
- wrt. different dimensions
Available as Technical Report: http://num.math.uni-goettingen.de/schaback/ research/papers/MPfKBM.pdf
SLIDE 62
Summary
You don’t need to program derivatives, if you program a whole family of RBFs that is closed under double Fourier transforms
- wrt. different dimensions
Available as Technical Report: http://num.math.uni-goettingen.de/schaback/ research/papers/MPfKBM.pdf Version of 2011, dating back to 2008
SLIDE 63
Caveat
For low order Wendland functions:
SLIDE 64
Caveat
For low order Wendland functions: numerical problems at zero
SLIDE 65
Caveat
For low order Wendland functions: numerical problems at zero Calculating ∆ needs f ′
d,k = −fd+2,k−1, f ′′ d,k = fd+4,k−2
SLIDE 66
Caveat
For low order Wendland functions: numerical problems at zero Calculating ∆ needs f ′
d,k = −fd+2,k−1, f ′′ d,k = fd+4,k−2
For k = 1 the function fd,k is in C2 = C2k, but calculation goes down to fd+4,−1
SLIDE 67
Caveat
For low order Wendland functions: numerical problems at zero Calculating ∆ needs f ′
d,k = −fd+2,k−1, f ′′ d,k = fd+4,k−2
For k = 1 the function fd,k is in C2 = C2k, but calculation goes down to fd+4,−1 Example: d = 2, k = 1 φ6,−1(r) = I−1φ3(r) = −1 r d dr (1 − r)3
+ = 3(1 − r)2 +
r
SLIDE 68
Caveat
For low order Wendland functions: numerical problems at zero Calculating ∆ needs f ′
d,k = −fd+2,k−1, f ′′ d,k = fd+4,k−2
For k = 1 the function fd,k is in C2 = C2k, but calculation goes down to fd+4,−1 Example: d = 2, k = 1 φ6,−1(r) = I−1φ3(r) = −1 r d dr (1 − r)3
+ = 3(1 − r)2 +
r Theory is OK: Cancellation of singularities at zero
SLIDE 69
Caveat
For low order Wendland functions: numerical problems at zero Calculating ∆ needs f ′
d,k = −fd+2,k−1, f ′′ d,k = fd+4,k−2
For k = 1 the function fd,k is in C2 = C2k, but calculation goes down to fd+4,−1 Example: d = 2, k = 1 φ6,−1(r) = I−1φ3(r) = −1 r d dr (1 − r)3
+ = 3(1 − r)2 +
r Theory is OK: Cancellation of singularities at zero Laplacian needs f ′′
2,1 = r2φ6,−1(r)
SLIDE 70
Open Problems
Deal with Wendland case properly
SLIDE 71
Open Problems
Deal with Wendland case properly Make routines more efficient, e.g. Laplacian via d*frbf(S,1)+2*S.*frbf(S,2)
SLIDE 72
Open Problems
Deal with Wendland case properly Make routines more efficient, e.g. Laplacian via d*frbf(S,1)+2*S.*frbf(S,2) Dear with sparsity properly
SLIDE 73
Open Problems
Deal with Wendland case properly Make routines more efficient, e.g. Laplacian via d*frbf(S,1)+2*S.*frbf(S,2) Dear with sparsity properly Implement basis transformations
SLIDE 74
Open Problems
Deal with Wendland case properly Make routines more efficient, e.g. Laplacian via d*frbf(S,1)+2*S.*frbf(S,2) Dear with sparsity properly Implement basis transformations Extend to a general toolkit
SLIDE 75