From: Dushyant Kumar on
I am struck for quite a while. Any help would be appreciated.

I am first explaining in term of single voxel; but, ultimately, I have to do it for 10 thousand or 1 mil voxels at a time
Here is what I am doing (single voxel):
===========
My problem is ill-posed. 100 variables, 50 experimental data.

Y = A X
Y is (50,1), A is (50, 100), X (100,1)

I use lsqnonneg to solve for no regularization case. Then take it as x0 (initial guess).

Now, I add regularization and since I have now more equations than unknown, I can use lsqlin as well.

Now, I can use either lsqlin or lsqnonneg.
===========

I believe that if I can change resnorm of lsqlin by changing TolFun, it would give me similar result as lsqnonneg. However, changing TolFun does not change resnorm.

Once I starts doing many voxels at a time, the sparicity pattern becomes like:
http://docs.google.com/fileview?id=0B0Ah9soYnrlIOWRlMGE1M2MtYjNkNy00NWI0LTlhNWQtMDkwMThiMWE1MzNj&hl=en
From: Mark Shore on
"Dushyant Kumar" <duk(a)med.cornell.edu> wrote in message <htm165$5pn$1(a)fred.mathworks.com>...
> I am struck for quite a while. Any help would be appreciated.
>
> I am first explaining in term of single voxel; but, ultimately, I have to do it for 10 thousand or 1 mil voxels at a time
> Here is what I am doing (single voxel):
> ===========
> My problem is ill-posed. 100 variables, 50 experimental data.
>
> Y = A X
> Y is (50,1), A is (50, 100), X (100,1)
>
> I use lsqnonneg to solve for no regularization case. Then take it as x0 (initial guess).
>
> Now, I add regularization and since I have now more equations than unknown, I can use lsqlin as well.
>
> Now, I can use either lsqlin or lsqnonneg.
> ===========
>
> I believe that if I can change resnorm of lsqlin by changing TolFun, it would give me similar result as lsqnonneg. However, changing TolFun does not change resnorm.
>
> Once I starts doing many voxels at a time, the sparicity pattern becomes like:
> http://docs.google.com/fileview?id=0B0Ah9soYnrlIOWRlMGE1M2MtYjNkNy00NWI0LTlhNWQtMDkwMThiMWE1MzNj&hl=en

I hope it's just your wording that is unclear. Surely you're not expecting to derive 100 independent parameters from 50 data points?
From: Dushyant Kumar on
"Mark Shore" <mshore(a)magmageosciences.ca> wrote in message
> I hope it's just your wording that is unclear. Surely you're not expecting to derive 100 independent parameters from 50 data points?

Hi Mark,

Wording is fine. The problem is ill-posed.

Original equation is:
Y(TE) = sum over i (C_i * exp(-TE/ T2_i))

I want to extract histogram of
T2_i vs C_i;

Also T2_i > 0
and T2_i are logarithmically spaced point between 5 ms to 600 ms.
T2_Scale = logspace(log10(5e-3), log10(600e-3), 100);

For most of T2_i, C_i is zero. I can solve it using lsqnonlin active set.

Then I add regularization and that makes
# of unknowns < no of equation. I can solve it using lsqlin or lsqnonneg.

Histogram returned by lsqlin is not as satisfactor as that return by lsqnonneg.

However, lsqnonneg is very slow. Even for 36 voxels, it took 510.5874 sec vs 9 sec if I use lsqlin.

I believe that the issue is with resnorm which I can not force to be very small.

Discussed in next post...
From: Dushyant Kumar on
"Mark Shore" <mshore(a)magmageosciences.ca> wrote in message
>
> I hope it's just your wording that is unclear. Surely you're not expecting to derive 100 independent parameters from 50 data points?

lsqlin vs lsqnonneg
---------------------------
lsqnonneg works fine and returns resnorm of 9 10^-8

while lsqlin returns peaky solution and the resnorm of 1.12 10^-5.

The returned solution in this case is barely ok, not as good as in the case of lsqnonneg. Please have a look at the last page of

http://docs.google.com/fileview?id=0B0Ah9soYnrlIOWRlMGE1M2MtYjNkNy00NWI0LTlhNWQtMDkwMThiMWE1MzNj&hl=en

First figure on last page is solution using lsqnonneg (red) vs simulated (blue).

Last figure is solution using lsqlin (red) vs simulated (blue).
From: Dushyant Kumar on
so, I want help regarding this part of my code:

===================================================
if strcmp(Solver, 'lsqlin')
ub =[];
lb = zeros(length(x2_1D_NoRegul),1);
A = []; b = [];
options = optimset('MaxIter', 10000, 'TolFun',1*eps,'TolX',1e-6, 'MaxFunEvals',1800);
[x2_1D_SimultReg,resnorm,residual,exitflag,output] = lsqlin(AComp, y_exp_1D_Reg,A,b,[ ],[ ],lb,ub,x2_1D_NoRegul,options);
figure(2)
end
===================================================

I need help to adjust tolx, tolfun etc so that it runs till resnorm is comparable to that returned using lsqnonneg (resnorm = 9 10^-8). Currently using lsqlin, the resnorm
is 1.12 10^-5.

The code is at:
http://docs.google.com/leaf?id=0B0Ah9soYnrlINjJlOTcwMDktNjQzNi00MTFiLTg0YjQtN2UwZTZmNjY4ZmNk&hl=en