geoschem / integrated_methane_inversion

Integrated Methane Inversion workflow repository.
https://imi.readthedocs.org
MIT License
25 stars 19 forks source link

Feature: Lognormal error specification #175

Closed laestrada closed 2 months ago

laestrada commented 8 months ago

Name and Institution (Required)

Name: Lucas Estrada Institution: Harvard ACMG

Describe the update

Implementation of lognormal prior error variance specification for iterative calculation of the nonlinear optimization problem through the Levenberg–Marquardt method (Rodgers, 2000). This adds two new config variables: LognormalErrors, a boolean for whether to use lognormal errors for the inversion, and PriorErrorBufferElements, which specifies the prior error in relative percentage for buffer elements. The latter is necessary because we only impose lognormal errors for the domain of interest. Buffer elements and optimized boundary condition elements continue to use normal error specification.

The implementation provides a separate script from lognormal_invert.py script to calculate xhat. Notably, rather than reading in the jacobian piece by piece and performing the inversion (like in invert.py), we read in the full jacobian. This significantly eases the implementation due to the iteration needed to solve for xhat.

Additionally, when using lognormal errors we add in a new "background" jacobian simulation with no emissions specified. This allows us to get a clean background and simply do F(xhat) = ybkg+ K(xhat) rather than needing to recalculate F(xhat) for each iteration of xhat.

TODOs:

laestrada commented 2 months ago

After fairly extensive testing of interaction with lognormal errors on OH, BC optimization, and global inversions from @eastjames and myself, we are merging this branch to dev