Closed JianghuiDu closed 4 years ago
You mean you want to know the final value of the different penalization terms for the final solution? I do not think we included that calculation yet.
Yes. That's what I mean. Would it be possible to divide the final H, R matrices into the components due to individual constrains? I thought the Hs and Rs were simply stacked but I'm not sure how to separate them.
H and R and not changed, they are fixed by yourself. What you could calculate at the end is the misfit estimate (H x - y)' inv(R) (H x - y). With the DIVAnd_residual you can do that calculation yourself if you want. DIVAnd_residualobs works with real observations and DIVAnd_residual with all constraints merged.
As far as I understand (also from the other discussion), what you would like is to have (H x - y)' inv(R) (H x - y) for real data and compare it to the misfit in the advection constraint.
DIVAnd_residualobs provides you with z= Hx-y for the real observations from where you easily have z'z/epsilon2.
In DIVAnd_residual , the first elements should be the same as in DIVAnd_residualobs (to check). So drop them and keep only the remaining values w. Since the advection constraint itself has no epsilon2 associated is implicitely is included in the residual. So simply calcule w'w and you should have the advection constraint misfit.
Untested on my side, so if it works out let us know.
Is there a function to calculate the costs due to individual constrains, misfit, norm and advection etc. I assume it's buried in
s
but how to separate these constrains from it?