Covariance matrix of estimates using lsqnonneg

2 views (last 30 days)
Michael
Michael on 10 May 2017
Commented: Matt J on 10 May 2017
Hello,
I want to solve the equation Ax=b for x>=0. How can I derive the covariance matrix of the estimates x. Using ordinary least-squares technique, the covariance matrix is given by
Q = inv(A)
x = Q*b
but how can I get the covariance matrix by using lsqnonneg?
xpos = lsqnonneg(A,b)
/Micha
  3 Comments
John D'Errico
John D'Errico on 10 May 2017
That is not true for a lsqnonneg problem, IF any of the constraints are active!
Matt J
Matt J on 10 May 2017
Sure. I meant in the unconstrained case...

Sign in to comment.

Answers (1)

Matt J
Matt J on 10 May 2017
Rewrite the problem with a change of variables
min. f(z) = || A*z.^2-b||^2
This is now an unconstrained problem, so you can compute the covariance of z in the usual way from the Hessian of f(z) at z=sqrt(abs(xpos)). Then you can map covariance in z to covariance in x.
  3 Comments
Matt J
Matt J on 10 May 2017
Edited: Matt J on 10 May 2017
I'm not sure why it would be so hard to extrapolate a meaningful confidence interval from z. I can see that x=sqrt(|z|) will not be normally distributed. But if we're saying that z itself can still be modeled as normally distributed, then we can still deduce from standard confidence intervals that for example | z |<3*sigma with 99.8% probability. From there, we can deduce that 0<x<sqrt(3*sigma) with the same probability. So yes, it's a non-standard confidence interval in x, but does that mean it's not a useful one?
Matt J
Matt J on 10 May 2017
Michael commented:
Thank you for your suggestions. I found a related question here (lsqnonneg function was not named). The bootstrap method is suggested as an approximation of the uncertainties of the estimates. John reports about reliable results.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!