# Determining whether function is logarithmic or logarithmic with addition of variable

Suppose that I have a function:

$f(x,U) = x + \log(U)$

where $x$ and $U$ can be complex numbers. I take $f(x,U)$ and evaluate it a number of times for different $x$ and $U$.

Since $U$ can be complex, I take $\log(U)$ as the complex logarithm (Wikipedia Link). For example, $\log(-1) = 3.1416i$.

Now suppose that for all of my function evaluations, $x = 0$ so:

$f(x=0,U) =\log(U)$

But given only $f(x,U)$, and not knowing $x$ and $U$, is there a way to use curve-fitting or some other method to determine that $f(x,U) = \log(U)$ and $x = 0$?

Can numerical methods be used to distinguish between $f(x,U) = x + \log(U)$ and $f(x=0,U) =\log(U)$, and how would I deal with the real and complex parts?

I assume that $\log(U) \neq 0$ for all function evaluations, and that $x \neq \log(P)$, where $P$ is some complex number.

I've found a similar question on Stack Overflow (link), but I am uncertain as to whether something from that question can be used to solve this problem.

Is this problem less of an issue when considered with the complex set of numbers in lieu of the reals?

-

If you have a function evaluation where $f(x,U)=0$, then $x \neq 0$ since $log(U) \neq 0$ for all function evaluations.

Otherwise, you'll have to rely on statistical methods, and assume $U$ is randomly distributed. You can represent $U$ as $a+bi$, where $a$ and $b$ are normally distributed, if you have some idea what the means and variances of $a$ and $b$ could be.

But since that involves four parameters you might have to fudge (I'm assuming you know as little as possible about the distribution of $U$), representing $U$ in polar form ($r e^{i\theta}$) could be easier: assume $\theta$ is uniformly distributed between $0$ and $2\pi$, and $r$ follows an exponential distribution. Then you'll just need to come up with a guess for what the mean of $r$ could be (the $\lambda$ parameter).

Regardless of how you generate your $U$s, evaluate $f$ on them assuming $x=0$. Create a histogram of the results, and compare this to a histogram of the function evaluations for the unknown $U$s and $x$s.

-
(1) Yes, psuedo-random should be good enough for this purpose; specifically, you can generate exponential random numbers with mean $\lambda$ by taking the log of a uniform random variable between $0$ and $e^{1-\lambda}$. (2) You could vary $r$ and go by whichever produces the closest histogram, but other than that, I can't think of anything. (3, 5) Use a chi square test; note, the histogram will be 2-dimensional because the values are complex. (4) Don't know. –  valtron Aug 2 '12 at 18:13
For the second comment, yes to both parts. –  valtron Aug 2 '12 at 18:14
The uniform and exponential distributions are the maximum entropy distributions for their support: $\theta$ is bounded by $0$ and $2\pi$ since it's an angle, and $r$ is positive, as per polar form. So in the absence of any information other than their support, those are the distributions that have least amount of structure. –  valtron Aug 2 '12 at 21:07
As for assuming the mean to be the same as $f(x,U)$s, that'll most likely be wrong. Other than being a complex number, when $r$ must be a positive real, applying an arbitrary function to a random variable doesn't preserve the mean. For example, take $x \in [0,1]$. $x$ has a mean of $0.5$, but $log(x)$ has a mean of $1$. –  valtron Aug 2 '12 at 21:12
There is no single $r$ or $\theta$ that you would choose. They're two numbers used in the polar representation of a particular $U$, not the entire distribution. You need only estimate $\lambda$ from a set of experimentally-determined $U_1,U_2,...$, which you can do by converting the $U$s to polar form, $r_{1}e^{\theta_1 i}, r_{2}e^{\theta_2 i},...$, and averaging $r_{1},r_{2},...$. –  valtron Aug 2 '12 at 23:30
show 8 more comments

Let's first deal with the reals. The range of $\log U$ as $U$ goes through the positive reals is the entire real line. The range of $x+\log U$ for real $x$ and positive real $U$ is the entire real line. It follows that if you are given the outputs and no information about the inputs you can't tell $\log U$ from $x+\log U$.

Now if $U$ can be a complex number, then first you have to tell me what you mean by $\log U$.

EDIT: I take it from your update that you are using the principal branch of the complex logarithm, so the imaginary part of $\log U$ lies between $-\pi$ (exclusive) and $\pi$ (inclusive). That means that if you get an output with an imaginary part outside those bounds, then you know you're getting $x+\log U$ for some $x\ne0$, and you even have some bounds on the imaginary part of $x$. The more outputs you get (with different imaginary parts), the tighter the bounds you get on the imaginary part of $x$.

On the other hand, if every output has imaginary part consistent with being $\log U$ for some $U$ and the principal branch, then you can make no conclusion as to whether or not $x=0$. All you can do is bound the imaginary part of any possible $x$, and you can't say anything about the real part.

-
Thank you very much for pointing me in the right direction. I've now updated my question above to indicate what I mean by the complex logarithm. –  Nicholas Kinar Aug 2 '12 at 14:20
It's interesting to look at the function as bounded on the imaginary part of $x$. Thanks for the edit, Gerry. –  Nicholas Kinar Aug 3 '12 at 1:12