Next: kronecker() Up: Mathematical Macros Help File Previous: invchebcoefs()   Contents

# invertseries()

Usage:
 ```invertseries(a), REAL vector a with non-MISSING elements ```

Keywords: expansions, power series
```Suppose A(x) is a function with A(0) = 0 and with Taylor series a1*x +
a2*x^2 + a3^x^3 + ..., where a1 != 0.  Then in a neighborhood of 0
there is an inverse function B(y) is defined such that B(A(x)) = x for
y near 0.  Let b1*y + b2*y^2 + b3*y^3 ... be the Taylor series for
B(y).  The coefficients bj are unique functions of a1, a2, ..., aj; in
particular, b1 = 1/a1.

b <- invertseries(a), where a = vector(a1,a2,...,an) is a REAL vector,
computes the coefficients b = vector(b1,b2,...,bn) of the Taylor series
for B(y).

Because of numerical instability, higher order coefficients in b may
not be accurate.

Example:
Let A(x) = log(1-x) = -x - x^2/2 - x^3/3 - ... . Then B(y) = 1 - exp(y)
= -y - y^2/2 - y^3/6 - y^4/24 - y^5/120 - ... satisfies B(A(x)) = 1 -
exp(log(1 - x)) = 1 - (1 - x) = x.

Cmd> a <- -1/run(10); a # coefficients of -log(1-x)
(1)          -1        -0.5    -0.33333       -0.25        -0.2
(6)    -0.16667    -0.14286      -0.125    -0.11111        -0.1

Cmd> b <- invertseries(a); b # coefficients of 1 - exp(y)
(1)          -1        -0.5    -0.16667   -0.041667  -0.0083333
(6)  -0.0013889 -0.00019841 -2.4802e-05 -2.7557e-06 -2.7557e-07
```

Gary Oehlert 2003-01-15