Documentation
A python package to adjust the bias of probabilistic forecasts/hindcasts using "Mean and Variance Adjustment" method.
Read documentation at https://github.com/gouthamnaveen/mva
References:
[1] Torralba, V., Doblas-Reyes, F. J., MacLeod, D., Christel, I. & Davis, M. Seasonal Climate Prediction: A New Source of Information for the Management of Wind Energy Resources. Journal of Applied Meteorology and Climatology 56, 1231–1247 (2017).
[2] Manzanas, R. et al. Bias adjustment and ensemble recalibration methods for seasonal forecasting: a comprehensive intercomparison using the C3S dataset. Clim Dyn 53, 1287–1305 (2019).
Installation:
pip install mva
Parameters:
hindcast: numpy.ndarray
The hindcast (or training) data. Kindly maintain the shape of the array as (years/samples,time,ensemble-members,grid-points).
observation: numpy.ndarray
The truth or observations corresponding to the hindcast. Kindly maintain the shape of the array as (years/samples,time,grid-points).
forecast: numpy.ndarray, optional
The forecast (or test) data. Kindly maintain the shape of the array as (time,ensemble-members,grid-points).
Note: Kindly respect the array shapes even if the computation is done for one time/grid point/ensemble member.
Methods:
adjust_hindcast():
This method corrects the bias of the hindcast using hindcast of the remaining years in the set (i.e., leave-one-out approach) and the corresponding observations.
Returns:
bias_adjusted_hindcast (Note: It has the same shape as the hindcast)
adjust_forecast():
This method corrects the bias of the forecast using hindcast and the corresponding observations. This method works only when the forecast parameter is given.
Returns:
bias_adjusted_forecast (Note: It has the same shape as the forecast)
Demonstration:
import numpy as np
import mva.mva as mva
Let's imagine that we have loaded the data of hindcast, forecast, and observation.
Example - 1
In [1]: hcast.shape
Out[1]: (20,46,10,6)
In [2]: fcast.shape
Out[2]: (46,50,6)
In [3]: obs.shape
Out[3]: (20,46,6)
In [4]: bc = mva(hcast,obs,fcast)
In [5]: ad_hcast = bc.adjust_hindcast()
In [6]: ad_hcast.shape
Out[6]: (20,46,10,6)
In [7]: ad_fcast = bc.adjust_forecast()
In [8]: ad_fcast.shape
Out[8]: (46,50,6)
Example - 2
In [1]: hcast.shape
Out[1]: (20,46,10,6)
In [2]: fcast.shape
Out[2]: (48,50,6)
In [3]: obs.shape
Out[3]: (20,46,6)
In [4]: ad_hcast = mva(hcast,obs,fcast).adjust_hindcast()
In [5]: ad_hcast.shape
Out[5]: (20,46,10,6)
In [6]: ad_fcast = mva(hcast,obs,fcast).adjust_forecast()
Out[6]: Please respect the array shapes and try again!
Release files for mva 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mva-0.0.2.tar.gz | 7.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mva-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.7 kB
Release files / mva-0.0.2.tar.gz
| Download URL | mva-0.0.2.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8eebaf921716b6018da5097df07941f8210a5bddd9d764319c208ea401c81ead
|
|
BLAKE2b-256 checksum How to use checksums |
e688ab62b1980d5b27614ab44da28b8efc071c171e71b1f161d4fad62bde3ac5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.7.13
|
Release files / mva-0.0.2-py3-none-any.whl
| Download URL | mva-0.0.2-py3-none-any.whl |
|---|---|
| Size | 7.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
16502a56658820efaef5d60648c7ecd26ead93222d8ba85771422d7c033ce4a9
|
|
BLAKE2b-256 checksum How to use checksums |
28659a66e480891d454abbd1e08648f9deaed75f6fac8942fcea08e20fd80cc0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.7.13
|