Exact numeric nth derivatives
jliszka.github.io
Exact numeric nth derivatives
1–10 of 55 posts
Re: Exact numeric nth derivatives
#2Re: Exact numeric nth derivatives
#3Re: Exact numeric nth derivatives
#4Re: Exact numeric nth derivatives
#5Re: Exact numeric nth derivatives
#6Nice analysis. Hope you don't mind me adding that by omitting terms of the Taylor series you do have some loss of precision, however small. Also, solving linear equation systems may even introduce instability as the following must be preserved: http://en.wikipedia.org/wiki/Diagonally_dominant_matrix
Re: Exact numeric nth derivatives
#7[deleted]
Re: Exact numeric nth derivatives
#8Nice analysis. Hope you don't mind me adding that by omitting terms of the Taylor series you do have some loss of precision, however small. Also, solving linear equation systems may even introduce instability as the following must be preserved: http://en.wikipedia.org/wiki/Diagonally_dominant_matrix
f(a + be) = f(a) + f'(a)be + 0.5 * f''(a) b^2 e^2 + O(e^3)
= f(a) + f'(a)be
because e^n=0 for all n>1. This isn't an approximation - it's an exact relationship for dual numbers!You will lose some precision by using floating point numbers instead of an arbitrary-precision real number type, but this is a limitation of the machine you're working on. The method is exact.
Re: Exact numeric nth derivatives
#9Very neat. Presumably there is a more efficient method for implementing Nth order automatic differentiation than encoding the dual numbers as NxN matrices, though? To multiply the matrices takes O(N^3) time, whereas by exploiting their known structure I think you should be able to do it in O(N^2) time. Am I wrong?
Re: Exact numeric nth derivatives
#10Encoding power series as matrices is sometimes convenient for theoretical analysis (or, as here, educational purposes), but it's not very efficient. The space and time complexities with matrices are O(n^2) and O(n^3), versus O(n) and O(n^2) (or even O(n log n) using FFT) using the straightforward polynomial representation (in which working with hundreds of thousands of derivatives is feasible). In fact some of my current research focuses on doing this efficiently with huge-precision numbers, and with transcendental functions involved.