SERVING THE QUANTITATIVE FINANCE COMMUNITY

Cuchulainn
Posts: 60755
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Re: Calculate the derivative of exp(A) over A

You could try it in the 1d case and know soon enough if it works.
du/dx = u, u(0) = 1.
aka GO/NOGO
http://www.datasimfinancial.com
http://www.datasim.nl

Approach your problem from the right end and begin with the answers. Then one day, perhaps you will find the final question..
R. van Gulik

ISayMoo
Topic Author
Posts: 2246
Joined: September 30th, 2015, 8:30 pm

### Re: Calculate the derivative of exp(A) over A

I'd rather not go down the ODE solving route

Cuchulainn
Posts: 60755
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Re: Calculate the derivative of exp(A) over A

I'd rather not go down the ODE solving route
The reason being?
http://www.datasimfinancial.com
http://www.datasim.nl

Approach your problem from the right end and begin with the answers. Then one day, perhaps you will find the final question..
R. van Gulik

ISayMoo
Topic Author
Posts: 2246
Joined: September 30th, 2015, 8:30 pm

### Re: Calculate the derivative of exp(A) over A

Isn't it going to be slower than an approximant? I will be calculating these derivatives in an inner loop.

katastrofa
Posts: 8623
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

### Re: Calculate the derivative of exp(A) over A

No.
I thought so...
Take the Pade (0,1) (or was it (1,0) ?) $e^x$ approximate by $1+x$ on [-1,1]

1: Compute maximum error using 101 calculus
2. Compute derivative
3. GOTO 1

Gets worser and worser.

exp x = exp(x/2) / exp(-x/2) for Padé.

Cuchulainn
Posts: 60755
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Re: Calculate the derivative of exp(A) over A

I thought so...
Take the Pade (0,1) (or was it (1,0) ?) $e^x$ approximate by $1+x$ on [-1,1]

1: Compute maximum error using 101 calculus
2. Compute derivative
3. GOTO 1

Gets worser and worser.

exp x = exp(x/2) / exp(-x/2) for Padé.
Not sure what your above identity is telling me.
http://www.datasimfinancial.com
http://www.datasim.nl

Approach your problem from the right end and begin with the answers. Then one day, perhaps you will find the final question..
R. van Gulik

katastrofa
Posts: 8623
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

### Re: Calculate the derivative of exp(A) over A

There's no such a thing as Padé(.,0). It would kill the whole idea of the approximant. My identity was a hint how to calculate the Padé approximant of exp. Nevermind, I need to go and do something mathematically sound now.
Last edited by katastrofa on July 25th, 2018, 11:09 am, edited 1 time in total.

Cuchulainn
Posts: 60755
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Re: Calculate the derivative of exp(A) over A

The identity is cute but far away from rational approximation (IMO). But I might be wrong.Or you.

Feller was an ebullient man, who would rather be wrong than undecided.
http://www.datasimfinancial.com
http://www.datasim.nl

Approach your problem from the right end and begin with the answers. Then one day, perhaps you will find the final question..
R. van Gulik

katastrofa
Posts: 8623
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

### Re: Calculate the derivative of exp(A) over A

We essentially don't agree whether the Taylor series is a Padé approximant. I think the motivation for the latter is to achieve(/extend the radius of) or accelerate the convergence of the first, hence it has the form of a quotient of two Taylor series expansions:
$\sum_{i=0}^M a_i x^i / ( 1 + \sum_{j=1}^N a_j x^j )$

Thus the Pade approximant of exp x should be derived from exp(x/2) / exp(-x/2) = T(x/2) / T(-x/2).

I think ISayMoo's could use Padé approximant to calculate exp(A), but needs to assure that the norm of A is low (e.g. by applying the Gershgorin - a.k.a. some Belarusian guy who's name I forgot - circle theorem, which we have once intensely discussed in the forum with Lovenatalya).

BTW, why do you use the word "cute" so often when we talk?
Last edited by katastrofa on July 26th, 2018, 12:32 pm, edited 1 time in total.

Cuchulainn
Posts: 60755
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Re: Calculate the derivative of exp(A) over A

This is the first time I ever used that word Cute foto.

Thus the Pade approximant of exp x should be derived from exp(x/2) / exp(-x/2) = T(x/2) / T(-x/2).
What's 'T'?
Last edited by Cuchulainn on July 25th, 2018, 6:18 pm, edited 2 times in total.
http://www.datasimfinancial.com
http://www.datasim.nl

Approach your problem from the right end and begin with the answers. Then one day, perhaps you will find the final question..
R. van Gulik

katastrofa
Posts: 8623
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

### Re: Calculate the derivative of exp(A) over A

It's *relatively* often then.
T is for Taylor expansion.

Cuchulainn
Posts: 60755
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Re: Calculate the derivative of exp(A) over A

Simple question which stumps me: I  have a complex square matrix H. There are some nice methods for calculating exp(H). What about calculating the derivative of exp(H) over elements of H? To be precise: let M = exp(H). I want to calculate dM_{jk} / dH_{mn} numerically, accurately and (relatively) quickly.
What about somefing on the lines of BCH?

https://math.stackexchange.com/question ... -of-matrix

A successful implementation would improve the code (e.g. maintainability and readability) for backpropagation etc.
http://www.datasimfinancial.com
http://www.datasim.nl

Approach your problem from the right end and begin with the answers. Then one day, perhaps you will find the final question..
R. van Gulik

ISayMoo
Topic Author
Posts: 2246
Joined: September 30th, 2015, 8:30 pm

### Re: Calculate the derivative of exp(A) over A

How many terms would I have to keep? I suppose I can bound it myself, but I'm lazy.

Higham's method looks v. appealing to me now.

katastrofa
Posts: 8623
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

### Re: Calculate the derivative of exp(A) over A

Is what you call Higham's method simply a complex step derivative, which has been used by statisticians for sensitivity analysis since complex was added in the C99 standard? Who's Higham?

Cuchulainn
Posts: 60755
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Re: Calculate the derivative of exp(A) over A

https://www.genealogy.math.ndsu.nodak.e ... p?id=96012

complex step derivative, which has been used by statisticians for sensitivity analysis
Interesting. So, statisticians discovered it?

BTW Fortran has complex type forever. C99 is playing catch-up.
http://www.datasimfinancial.com
http://www.datasim.nl

Approach your problem from the right end and begin with the answers. Then one day, perhaps you will find the final question..
R. van Gulik