On combining two different approximations of a function for two different limits together

179 Views Asked by At

I have an infinite sum (a function of $x$, say $f(x)$) which I can approximate by two different functions, say by $f_1(x)$ and by $f_2(x)$ for small and large values of $x$, respectively.

Is there a way to combine $f_1(x)$ and $f_2(x)$ together which could be a reasonably good approximation of $f(x)$ for the whole domain?

Any help is appreciated.

Thanks!

1

There are 1 best solutions below

0
On

There are many such ways; I'll suggest one but you may have to adapt it for your particular setting.

I take it that you have good approximations for $x\to0$ and for $x\to\infty$; for instance, asymptotic approximations such that

$$ \lim_{x\to0}\frac{f_1(x)}{f(x)}=1\;,\\ \lim_{x\to\infty}\frac{f_2(x)}{f(x)}=1\;. $$

Since we're dealing with scales here, I'd suggest using the logarithm of $x$ as a parameter. If you mix your functions like this:

$$ f_{12}(x)=w(x)f_1(x) + (1-w(x))f_2(x)\;, $$

you could choose the weight function $w(x)$ to be a sigmoid in $\ln x$:

$$ w(x)=\frac1{1+\mathrm e^{k(\ln x-\ln x_0)}}\;, $$

where $x_0$ is the midpoint of the transition and $k$ is a free parameter that controls the steepness of the transition (the limit $k\to\infty$ corresponds to an abrupt jump from $f_1$ to $f_2$ at $x_0$, and the smaller $k$, the smoother the transition). This can be rewritten as

$$ w(x)=\frac1{1+\left(\frac x{x_0}\right)^k}\;. $$

Let me know if you need help adapting this to your setting.