Multispectral AOT : Levenberg Marquardt optimization unconsistency
MAJA estimates multispectral AOT using the Levenberg Marquardt otpimizer. The equation to minimize (cost function) is defined in file vnsMultiSpectralAOTCostFunction.h and shows a square on the terms of the sum :
cost1 = Weq1 * \sum_{l,p} { [ Rsurf\_est (l,p,blue,AOT(D)) - Rsurf\_sim (l,p,blue,AOT(D))]^2 }
This is consistent with the definition that can be found on Wikipedia for example (https://en.wikipedia.org/wiki/Levenberg%E2%80%93Marquardt_algorithm).
However, the square is not present in the code of the cost function :
MultiSpectralAOTCostFunction<TInputImage, TInputDTM, TLUT>::EvaluateErrors, line 212-214 (missing * blueCost ?) (https://gitlab.orfeo-toolbox.org/maja/maja/-/blob/develop/Code/Algorithms/L2/AOTEstimation/vnsMultiSpectralAOTCostFunction.txx#L214)
// Cost function
const double blueCost = RsurfEstBlue - RsurfSimBlue;
pMSMeasure[pValueindex] = lWeqMS * blueCost;
Who is right ? The code or the given equation ?