3
$\begingroup$

I asked this question in math.SE before. One answer so far, and we were unable to reach a conclusion. It is more related to statistics, so I wanted to post this here.

I have a Gaussian likelihood function, $$p(y|x) = \mathcal{N}(y; Ax, (x^\top V x + \lambda) \otimes I)$$ where $A,V,\lambda$ is known, and $\otimes$ is the Kronecker product. (the notation indicates that covariance is a scalar times identity matrix -- scalar is: $x^\top V x + \lambda$). Note that $A$ is a rectangular matrix, say $m\times k$ with $m>k$, hence $V$ is a $k\times k$ matrix. $\lambda > 0$. $x$ is $k\times 1$ and y is $m\times 1$.

I would like to maximise this with respect to $x$, in other words, solve the following problem, $$x^* = \arg \max_x p(y|x) = \arg \max_x \mathcal{N}(y;Ax,(x^\top V x + \lambda) \otimes I)$$ I tried to take derivative of the log-likelihood and set it to zero, however I was unable to leave out $x$ and obtain an exact solution.

I wonder if there is an exact solution, and if not: what the best numerical scheme (one suggests) is to overcome this problem.

Any help is greatly appreciated. Thanks!

PS: Pseudoinverse is not the solution, according to 2D numerical simulations! And another empirical observation from 2D simulations: As $\lambda \to \infty$ (for very large values), pseudoinverse solution becomes more and more accurate, so this hints about structure of the solution a bit.

$\endgroup$
4
  • $\begingroup$ Is it not true that when $\lambda=0$ then $x^*=A^+y$? I.e. for very small rather than very large values of $\lambda$. $\endgroup$
    – Hunaphu
    Commented Aug 13, 2015 at 13:43
  • $\begingroup$ if $\lambda = 0$, then the covariance is $x^\top V x \otimes I$, so I don't know if it is still pseudoinverse... $\endgroup$
    – user16776
    Commented Aug 13, 2015 at 14:05
  • $\begingroup$ Out of curiosity, why do you need to solve this problem? What is the use case? $\endgroup$
    – Placidia
    Commented Aug 13, 2015 at 18:31
  • $\begingroup$ thanks for the answer! yes it seems I have to resort to some numerical methods for this. -- this monster appeared in a nice machine learning problem I tried to solve, I will send you, if I post that to arxiv eventually (hopefully in this month!). $\endgroup$
    – user16776
    Commented Aug 13, 2015 at 21:36

2 Answers 2

2
$\begingroup$

This is basically a regression problem, only with a constraint on the variance. If we didn't have $\sigma^2 = x^TVx + \lambda$, the solution would be $(A^TA)^{-1}A^TY$, but that solution almost undoubtedly won't satisfy $s^2=\hat{x}^TV\hat{x} + \lambda$, where $s^2$ is the mean square error from the regression.

There must be some way to iterate towards a solution that starts with OLS and moves towards something that satisfies, or is close to, the variance condition. Would a Lagrange multiplier work?

Minimize $$ \sum_{i=1}^N (y_i - A_ix)^2 + \alpha(s^2 - x^TVx + \lambda) $$

where $\alpha$ is the Lagrange multiplier. Taking the derivative of $s^2$ would be painful, but you might hold that constant at each iteration, updating it as you update $x$.

$\endgroup$
0
$\begingroup$

In the plots below the result from the code is plotted. The first plot show loglikelihood, the second shows the x-estimate and the third shows the error compared to x. I used logmvnpdf found here: http://www.mathworks.com/matlabcentral/fileexchange/34064-log-multivariate-normal-distribution-function/content/logmvnpdf.m

Log-likelihood, x-estimate, x-error

%% Get initial guess
clc
mm = mean(y);
x = (A\mm');
mu = A*x;
x0 = x;
RR = x'*V*x + lambda;
sigma = kron(RR, eye(m));
p_old = sum(logmvnpdf(y, mu', sigma));
%% Estimate
s = 1e-1;
p_old = -1e190;
counter = 0;
p_save = 0;
x_save = x0;
while counter < 4*1e3
    if mod(counter, 1e3) == 0
        s = s/10
    end
    counter = counter + 1;
    x = x0 + randn(k, 1)*s;
    mu = A*x;
    RR = x'*V*x + lambda;
    sigma = kron(RR, eye(m));
    try % fails if sigma is not posdef
        p_ = sum(logmvnpdf(y, mu', sigma));
    catch
        p_ = -1;
        counter = max(1, counter - 1);
    end
    if rand*0 < (p_ - p_old)
        p_old = p_;
        x0 = x;
    end
    p_save(counter) = p_old;
    x_save(:, counter) = x0;

end

rr = zeros(counter, 1);
for c = 1:counter
    rr(c, :) = norm(x_save(:, c) - x_true);
end
$\endgroup$
4
  • $\begingroup$ which method is this? $\endgroup$
    – user16776
    Commented Aug 14, 2015 at 16:07
  • $\begingroup$ This is just random hillclimbing. Replace if rand*0 < (p_ - p_old) with if rand < exp(p_ - p_old) and it becomes Metropolis-Hastings. $\endgroup$
    – Hunaphu
    Commented Aug 14, 2015 at 16:27
  • $\begingroup$ Thank you! But this problem arises in an "inner loop" so I have to find a fast numerical algorithm (may be BFGS etc). Thanks for all. $\endgroup$
    – user16776
    Commented Aug 14, 2015 at 16:34
  • $\begingroup$ If you set the counters max to 1e2 the runtime is not terrible :) Might require adjustment of the s-adaption but I got ok results. However I do agree that BFGS will likely be faster... $\endgroup$
    – Hunaphu
    Commented Aug 14, 2015 at 19:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.