I am working on an optimization problem with Tikhonov's regularization and by a function, I have the task to automatically update the value of a variable during the iterative process. However, from the initial guess, the related value is not being updated. Can someone please give me a hand?
The related parameter is [Alpha], that should be updated by the function CalculatealphaLcurve.
S = 10^10;
c = 1.; \[Epsilon] = 10.; \[Alpha] = 100; fcobjold = 0.;
AbsoluteTiming[
While[ S > eps && nit > n,
Pause[1];
fcobj[[n]] = fobj[Tsupexp, TsupEst, hEst, \[Alpha]];
S = fcobj[[n]] ;
Print[n | fcobj[[n]] | lkl | pri | g | \[Alpha] | TsupEst ];
If[fcobj[[n]] < (fcobjold/c), g = g/\[Epsilon],
g = g *\[Epsilon]];
J = calcCoefMatrix[hEst, TsupEst];
A = J\[Transpose] . W . J + \[Alpha] *
IdentityMatrix[Length[J\[Transpose] . W . J]];
\[CapitalDelta]h = (Inverse[A] ) . (J\[Transpose] . W . res);
hEst = hEst + \[CapitalDelta]h;
Print[hEst];
Export[NotebookDirectory[] <> "hc.dat", hEst, "Table"];
Run["main.exe"];
Pause[1];
TsupEst =
ArrayReshape[
Import[NotebookDirectory[] <> "TsupPD.dat", "Table"], npi];
fcobjold = fcobj[[n]];
\[Alpha] = CalculatealphaLcurve[Tsupexp, TsupEst, J, W, hEst];
n = n + 1];]