pangeo-data / climpred

:earth_americas: Verification of weather and climate forecasts :earth_africa:
https://climpred.readthedocs.io
MIT License
230 stars 48 forks source link

HindcastEnsemble.remove_bias() experimental for NWP leads #605

Closed aaronspring closed 3 years ago

aaronspring commented 3 years ago

Describe the bug

became apparent in #603

Code Sample

requires #603 #529

with climpred.set_options(seasonality="dayofyear"):
        dayofyear_seasonality = hindcast.remove_bias(
            alignment=alignment, cross_validate=cross_validate
        )
with climpred.set_options(seasonality="weekofyear"):
        weekofyear_seasonality = hindcast.remove_bias(
            alignment=alignment, cross_validate=cross_validate
        )
assert not weekofyear_seasonality.get_initialized().identical(
        dayofyear_seasonality.get_initialized()

Expected behavior

How to approach

  1. Write down how bias reduction is supposed to work
  2. Implement code

Easier to implement once

575 is merged: bias is calculated in time but named init

aaronspring commented 3 years ago

Whats the standard in S2S to do bias correction? @judithberner I would appreciate papers well describing the technical part or even some code.

judithberner commented 3 years ago

So the model drifts away from the initialization (e.g. warm bias). So you have to compute the lead-time dependent bias and remove it. IMO - It really masks an important manifestation of model error.

judithberner commented 3 years ago

Here is some code based on Riley's and updated by Abby. My feeling is it's not the latest version .... https://github.com/judithberner/climpred_CESM1_S2S/blob/main/0.03_generate_member_anomalies_S2S.ipynb @abjaye

aaronspring commented 3 years ago

So groupby(init.groupby) - clim. I think that’s what currently remove_bias does

aaronspring commented 3 years ago

What about remove the diurnal cycle?

judithberner commented 3 years ago

So I have very rarely worked with sub-daily data and if so only with 6-hourly precip. Presumably people would want the daily cycle removed, but not always. Maybe something to ask Pauline or someone like her.

aaronspring commented 3 years ago

645 really improved bias reduction

aaronspring commented 3 years ago

Closed by #645