1
$\begingroup$

I have a function of the form

$$ f(k)=\frac{1}{a_1-a_{2}k^2e^{-(a_{3}-a_{4}k^2)}};\quad k=0...n$$

I approximated it with Taylor series expansion around $k=\frac{n}{2}$, but the results is not very precise (transformation of the function in order to obtain different intervals on the argument, e.g. $[0,1]$ did not work well either).

Are there other general-purpose polynomial expansions in place that yield sharper bounds?

  • 0
    What is the purpose of the expansion? This formula is not expensive to calculate, so why not use it? As Robert Israel said, the Chebyshev polynomials are based over the whole interval, so should give a better fit. As the $(k-n/2)$ multiplier in the Taylor series goes up to $n/2$, if your coefficients aren't decreasing by this much per order, you haven't even started to converge.2011-08-03

2 Answers 2

3

Your problem is probably caused by the fact that the denominator can go to zero and polynomials do not fit poles well. Even if your $a$'s are such that the denominator cannot go to zero, nearby poles in the complex plane can ruin your day. You might be interested in a rational function (a ratio of polynomials) instead. There should be any information in any numerical analysis book. Section 3.2 of Numerical Recipes discusses this and the obsolete versions are free.

  • 0
    the denominator goes to $a_1$ as $n \to \infty$ , but I got your point.2011-08-02
  • 0
    But the $a$'s could be such that there is a pole at $k=7.5$, for example. Even if it is at $k=7.5+i$ you will have trouble. The book discusses trying to fit $\frac{1}{1+x^2}$, where the pole at $i$ makes the fit terrible. The exponential tail is another thing polynomials don't do well-they want to go to $\pm \infty.$2011-08-02
  • 0
    mu uni's library seems to have the book. I plotted $f$ for various $a_m$, it is always convex and strictly increasing, no poles or discontinuities. The problem with Taylor series is that as $k$ gets close to $n \ f$ increases very fast and $P(k)$ does not capture this well unless I have 9 or 10 terms in it, but then the expression becomes unworkable.2011-08-03
  • 0
    Why does it increase so rapidly? The denominator must be going to zero or close to. As $k$ gets very large the denominator gets even larger and negative (unless $a_4 \lt 0$)-the exponent is positive.2011-08-03
  • 1
    "I plotted $f$ for various $a_m$, it is always convex and strictly increasing, no poles" - in the *real line*, yes. You didn't check the behavior in the *complex plane*, did you? A function that has poles, even complex ones, will *never* be well-approximated by a polynomial.2011-08-03
  • 1
    Note, @sigma, that in your current formulation, that $a_2$ and $a_3$ are *redundant*. You can define a new parameter $w=a_2 e^{a_3}$ so that your new function is $(a_1-wk^2 e^{-a_4 k^2})^{-1}$, and now you only have three parameters to tangle with.2011-08-03
  • 0
    ... or four parameters if you include $n$. But you can apply scaling ($k = n x$, $w = W/n^2$, $a_4 = A_4/n^2$) so you're back to three parameters with variable $x \in [0,1]$. And then a scaling of $f$ gets rid of another parameter, so you're down to two.2011-08-03
  • 0
    @J.M.: can you suggest how to check the behavior in complex plane?2011-08-03
  • 0
    My point, @sigma, is that just because some function looks "nice" on the real line doesn't necessarily imply that it can be easily approximated by a polynomial. Any function whose construction involves reciprocating some other function is (usually) poorly approximated by a polynomial, for that matter. Robert's suggestion of further reducing the number of parameters is a good one.2011-08-04
  • 0
    @J.M.: 'reciprocating another function' - can you explain this point? Also the function in question does not seem to have poles in the complex plane.2011-08-05
  • 1
    @sigma.z.1980: reciprcocating another function refers to the fact that you are dividing by $a_1-a_{2}k^2e^{-(a_{3}-a_{4}k^2)}$ I think we can guarantee this has zeros, which means your function has poles. It matters a lot whether they are close or far away, and without the $a$'s we can't tell. If they are within the circle centered on n/2 with radius n/2 the Taylor series won't converge at all. If they are close it will converge slowly. Robert Israel gives an example where the rational approximation is much better. I would expect that to be normal.2011-08-05
2

Taylor series provide a very good approximation for a function near a particular point, but are often poor approximations farther away. If you want to approximate a continuous function on an interval, you might try Chebyshev series. If you want the best possible approximation (in infinity norm) by polynomials of a given degree, you can try the Remez algorithm.

  • 0
    Emphasis on "try"; Remes can be very finicky, especially if you don't have good starting values.2011-08-03
  • 0
    For example, I used Maple's minimax command on the function $f(x) = 1/(1 - 2 x^2 e^{-0.8 x^2})$ for $x \in [0,1]$. The best degree-8 polynomial approximation is $.995210326+.688929220 x-14.2591542 x^2+146.2326158 x^3-643.8283393 x^4$ $+1551.894001 x^5-2063.567641 x^6+1431.564022 x^7-399.8472835 x^8$, with a maximum error of about .00479 on this interval.2011-08-03
  • 0
    On the other hand, asking for a rational approximation with numerator and denominator of degree 4 I get ${\frac { 1.836509916- 0.9917795120\,x+ 1.471185234\,{x}^{2}- 0.5637244264\,{x}^{3}+ 0.3097614226\,{x}^{4}}{ 1.836507496- 0.9914826398\,x- 2.207962497\,{x}^{2}+ 1.469524317\,{x}^{3}+ 0.1023759036\,{x}^{4}}}$ with maximum error of about 0.00000132.2011-08-03