Programming Derivatives of RBFs Robert Schaback - - PowerPoint PPT Presentation

programming derivatives of rbfs
SMART_READER_LITE
LIVE PREVIEW

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-1
SLIDE 1

Programming Derivatives of RBFs

Robert Schaback

Georg-August-Universität Göttingen Akademie der Wissenschaften zu Göttingen

ICERM August 2017

slide-2
SLIDE 2

Overview

Motivation Examples Theory Remarks on Implementation Summary and Outlook

slide-3
SLIDE 3

Motivation

slide-4
SLIDE 4

Motivation: Need for Derivatives

slide-5
SLIDE 5

Motivation: Need for Derivatives

For unsymmetric collocation you have to take ∆

slide-6
SLIDE 6

Motivation: Need for Derivatives

For unsymmetric collocation you have to take ∆ For symmetric collocation you have to take ∆ and ∆2

slide-7
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
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
SLIDE 9

Idea: Recursion

slide-10
SLIDE 10

Idea: Recursion

Observation: Derivatives of RBFs often are (modified) RBFs

slide-11
SLIDE 11

Idea: Recursion

Observation: Derivatives of RBFs often are (modified) RBFs Assume RBF family {φp(r)}p parametrized by p

slide-12
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
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
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
SLIDE 15

Idea: Recursion on f-form

slide-16
SLIDE 16

Idea: Recursion on f-form

Write φp(r) = fp(r2/2) or φp( √ 2s) = fp(s), s = r2/2

slide-17
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
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
SLIDE 19

Examples

slide-20
SLIDE 20

Example: Gaussian

φ(r) = exp(−r2/2)

slide-21
SLIDE 21

Example: Gaussian

φ(r) = exp(−r2/2) f(s) = exp(−s)

slide-22
SLIDE 22

Example: Gaussian

φ(r) = exp(−r2/2) f(s) = exp(−s) f ′(s) = −f(s)

slide-23
SLIDE 23

Example: Multiquadrics

φm(r) = (1 + r2/2)−m

slide-24
SLIDE 24

Example: Multiquadrics

φm(r) = (1 + r2/2)−m fm(s) = (1 + s)−m

slide-25
SLIDE 25

Example: Multiquadrics

φm(r) = (1 + r2/2)−m fm(s) = (1 + s)−m f ′

m(s) = −m fm+1(s)

slide-26
SLIDE 26

Example: Powers

φm(r) = rm

slide-27
SLIDE 27

Example: Powers

φm(r) = rm fm(s) = ( √ 2s)m

slide-28
SLIDE 28

Example: Powers

φm(r) = rm fm(s) = ( √ 2s)m d ds √ 2s = 1/ √ 2s

slide-29
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
SLIDE 30

Example: Thin-Plate Splines

φ2m(r) = r2m log r

slide-31
SLIDE 31

Example: Thin-Plate Splines

φ2m(r) = r2m log r f2m(s) = ( √ 2s)2m log( √ 2s)

slide-32
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
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
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
SLIDE 35

Matérn-Sobolev Kernels

φν(r) = rνKν(r)

slide-36
SLIDE 36

Matérn-Sobolev Kernels

φν(r) = rνKν(r) fν(s) = ( √ 2s)νKν( √ 2s)

slide-37
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
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
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
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
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
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
SLIDE 43

Theory

slide-44
SLIDE 44

General Result

Theorem (Dimension walk) Radial Fourier transform Fd on Rd implies Fd+2f ′

p = −Fdfp

slide-45
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
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
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
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
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
SLIDE 50

Remarks on Implementation

slide-51
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
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
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
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
SLIDE 55

Calculation of f-Form

S=distsqh(X,Y);

slide-56
SLIDE 56

Calculation of f-Form

S=distsqh(X,Y); F=frbf(S,k) calculates f k(S) on matrix S

slide-57
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
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
SLIDE 59

Summary and Outlook

slide-60
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
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
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
SLIDE 63

Caveat

For low order Wendland functions:

slide-64
SLIDE 64

Caveat

For low order Wendland functions: numerical problems at zero

slide-65
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
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
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
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
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
SLIDE 70

Open Problems

Deal with Wendland case properly

slide-71
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
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
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
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
SLIDE 75

Thank You!

For references, see

http://www.num.math.uni-goettingen.de/schaback/research.html