mrghg / py12box_invert

MIT License
3 stars 0 forks source link

Initial conditions from emissions and sensitivity #1

Closed mrghg closed 3 years ago

mrghg commented 3 years ago

Added two methods:

run_spinup: spins up the model for some number of years, repeating the first model year

run_initial_conditions: re-scales the initial conditions to an estimate of what they should have been N years before the first observation. Does this by using the sensitivity matrix and prior emissions to predict the trend before the first obs.

I was thinking that we should just set some roughly sensible initial conditions, and infer fluxes for some number of years before the first observation (using ic_years keyword in Invert), which can then be discarded.

I've updated the example_notebook.

Note that, when you re-scale the initial conditions, the mf trend may still not be stable, even if it is well-spun up, because of differences in the overall burden (and therefore loss) between the spinup and adjusted initial conditions. Therefore, if we really care about making it stable, we should probably iterate between both of these methods (i.e. spin-up for a short time, adjust, spin-up again, adjust, etc.)

I haven't written any tests! Will try to do that next week.

lukewestern commented 3 years ago

Looks helpful – I will try to do something iterative with it. Question is whether this is inbuilt or we just do it manually at runtime. I was wondering the same with lifetime uncertainty – would be good to (1) estimate, (2) derive lifetime uncertainty on mf, (3) re-estimate.