SERVING THE QUANTITATIVE FINANCE COMMUNITY

 
User avatar
Cuchulainn
Posts: 60256
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

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

July 24th, 2018, 11:00 am

You could try it in the 1d case and know soon enough if it works.
du/dx = u, u(0) = 1.
aka GO/NOGO
 
User avatar
ISayMoo
Topic Author
Posts: 2143
Joined: September 30th, 2015, 8:30 pm

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

July 24th, 2018, 1:17 pm

I'd rather not go down the ODE solving route :)
 
User avatar
Cuchulainn
Posts: 60256
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

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

July 24th, 2018, 5:16 pm

I'd rather not go down the ODE solving route :)
The reason being?
What about a home-grown solver?
 
User avatar
ISayMoo
Topic Author
Posts: 2143
Joined: September 30th, 2015, 8:30 pm

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

July 24th, 2018, 10:33 pm

Isn't it going to be slower than an approximant? I will be calculating these derivatives in an inner loop.
 
User avatar
katastrofa
Posts: 8382
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

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

July 24th, 2018, 10:51 pm

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.
It's not a Padé approximant.

exp x = exp(x/2) / exp(-x/2) for Padé.
 
User avatar
Cuchulainn
Posts: 60256
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

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

July 25th, 2018, 9:13 am

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.
It's not a Padé approximant.

exp x = exp(x/2) / exp(-x/2) for Padé.
It is Pade table (1,0)
https://en.wikipedia.org/wiki/Pad%C3%A9_table
Not sure what your above identity is telling me.
 
User avatar
katastrofa
Posts: 8382
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

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

July 25th, 2018, 10:54 am

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.
 
User avatar
Cuchulainn
Posts: 60256
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

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

July 25th, 2018, 11:06 am

Read the Wiki link.
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. 
 
User avatar
katastrofa
Posts: 8382
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

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

July 25th, 2018, 5:47 pm

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.
 
User avatar
Cuchulainn
Posts: 60256
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

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

July 25th, 2018, 6:12 pm

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.
 
User avatar
katastrofa
Posts: 8382
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

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

July 25th, 2018, 6:13 pm

It's *relatively* often then.
T is for Taylor expansion.
 
User avatar
Cuchulainn
Posts: 60256
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

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

July 26th, 2018, 11:51 am

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.
 
User avatar
ISayMoo
Topic Author
Posts: 2143
Joined: September 30th, 2015, 8:30 pm

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

July 26th, 2018, 6:15 pm

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.
 
User avatar
katastrofa
Posts: 8382
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

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

July 26th, 2018, 11:36 pm

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?
 
User avatar
Cuchulainn
Posts: 60256
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

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

July 27th, 2018, 9:19 am

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.
ABOUT WILMOTT

PW by JB

Wilmott.com has been "Serving the Quantitative Finance Community" since 2001. Continued...


Twitter LinkedIn Instagram

JOBS BOARD

JOBS BOARD

Looking for a quant job, risk, algo trading,...? Browse jobs here...


GZIP: On