last day (15 days later) » 

20:12
4
Q: Is there a way to approximate this sum in $O(n\log n)$

Conor OMalleyI am trying to approximate (or get the concrete expression) of a function which is expressed as this sum $$f(x) = \sum \limits_{i=0}^{100\,000} \frac{a_i x}{-b_i x + c_i}$$ Expanding this expression out results in a $100\,000$ degree rational function, which is computationally unrealistic to crea...

You do t need to say $<O(n\log n)$ because $O(\cdot)$ already implies $<$.
Should we think of the sequences $(a_i)_i$, $(b_i)_i$, and $(c_i)_i$ as fixed or rarely changing and $x$ as changing frequently? (I.e., is it acceptable to do some sort of precomputation on these sequences of coefficients, which precomputation can be used repeatedly for some set of $x$s?)
Yes, a, b, c are all known, but completely arbitrary, i.e. there is no pattern as i changes. x is the variable and yes this is what I want to change frequently, I want the output of the function for many different x.
@ThomasAndrews i wanted to explicitly say that I needed something faster than O(nlogn)
There is a risk that $-b_i x + c_i \approx 0$, causing out of range problems. How do you want to handle that?
replace $a,b$ with their approximate distribution, and integrate
20:12
@user619894 how does one integrate over a distribution?
What is your $n$, is it the number of terms? Then the $O(n)$ method is straightforward, why do you need $O(n\log n)$ methods?
@EricTowers you're right I guess there is really no way to avoid that, however I don't need answers for those x, so is there no way to see approximate/test if an x will result in something really big.
@Yimin i need to test multiple x values, specifically binary search over x as the function is strictly increasing (up to some point), hence the O(nlogn) i currently know of.
I see, so you have stored $O(n)$ evaluations for some $x$ values drawn from $[0, 1]$ and try to use that to evaluate another $x$. Then you do not need binary search if those $x$ values are not randomly chosen, if $x$ values are equally spaced, then you can access the nearest one in O(1) time instead of $\log n$.
No sorry for the confusion I don't have the evaluations already.
Assuming that the degeneracies that Eric Towers pointed out are avoided for the range of $a,b,c$ in question, it seems that these would be fairly smooth objects which could be uniformly approximated by polynomials on $[0,1]$ (or really, any reasonable family of Stone-Weierstrass basis functions). Then you don't get any combinatorial explosion when adding the 100000 approximants together. Seems like you would have some freedom to adjust the degree to trade accuracy vs cost, and you could use different degrees for each $i$ to account for higher variability depending on the coefficients.
20:12
@ThomasAndrews: I disagree: $O(n\log n)$ doesn't imply $<O(n\log n)$. That is what $o(n\log n)$ is for.
You can rewrite $\frac{a_i x}{-b_i x + c_i}$ as $-\frac{a_i}{b_i}+\frac{a_ib_i}{-b_ix+c_i}$, reducing $f(x)$ to an expression of the form $u+\sum_i\frac{1}{v_ix+w_i}$.
No, $o(n\log n)$ is a limit thing. $f(n)=O(g(n))$ iff there is a $C$ with $f(n)\leq Cg(n)$ for all $n.$ You can pick a bigger $C$ and make it strictly $<$. The whole point of $O(\cdot)$ is that it is an upper bound. @TonyK If OP meant something else, then big-O is,not the appropriate notation.'
Are the $a$s, $b$s, and $c$s real, complex, something else?
@ThomasAndrews: That is not what $<O(\cdot)$ means, in my opinion. $O(\cdot)$ is not a function, it's a shorthand, and $<O(\cdot)$ means precisely the same as $o(\cdot)$. In view of this disagreement, perhaps your edit was unwarranted.
And yet, there is no assigned meaning of $<O(),$ @TonyK. It is made up notation. What the OP meant is unclear. Correcting me, rather than OP, was a waste of your and my time.
@ThomasAndrews: Your very first comment implies that $<O(\cdot)$ does have an assigned meaning, surely? And you are not being forced to waste your time by responding :-)

last day (15 days later) »