A python package to adjust the bias of probabilistic forecasts/hindcasts using "Mean and Variance Adjustment" method.

Related tags

Miscellaneousmva
Overview

Documentation

A python package to adjust the bias of probabilistic forecasts/hindcasts using "Mean and Variance Adjustment" method.

Read documentation at https://github.com/garovent/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!
Anti VirusTotal written in Python.

How it works Most of the anti-viruses on VirusToal uses sandboxes or vms to scan and detect malicious activity. The code checks to see if the devices

cliphd 3 Dec 26, 2021
A parallel branch-and-bound engine for Python.

pybnb A parallel branch-and-bound engine for Python. This software is copyright (c) by Gabriel A. Hackebeil (gabe.hacke

Gabriel Hackebeil 52 Nov 12, 2022
A Notifier Program that Notifies you to relax your eyes Every 15 MinutesπŸ‘€

Every 15 Minutes is an application that is used to Notify you to Relax your eyes Every 15 Minutes, This is fully made with Python and also with the us

FSP Gang s' YT 2 Nov 11, 2021
The Open edX platform, the software that powers edX!

This is the core repository of the Open edX software. It includes the LMS (student-facing, delivering courseware), and Studio (course authoring) compo

edX 6.2k Jan 01, 2023
Python module used to generate random facts

Randfacts is a python library that generates random facts. You can use randfacts.get_fact() to return a random fun fact. Disclaimer: Facts are not gua

Tabulate 14 Dec 14, 2022
A way to write regex with objects instead of strings.

Py Idiomatic Regex (AKA iregex) Documentation Available Here An easier way to write regex in Python using OOP instead of strings. Makes the code much

Ryan Peach 18 Nov 15, 2021
Gunakan Dengan Bijak!!

YMBF Made with ❀️ by ikiwzXD_ menu Results notice me: if you get cp results, save 3/7 days then log in. Install script on Termux $ pkg update && pkg u

Ikiwz 0 Jul 11, 2022
Hypothesis strategies for generating Python programs, something like CSmith

hypothesmith Hypothesis strategies for generating Python programs, something like CSmith. This is definitely pre-alpha, but if you want to play with i

Zac Hatfield-Dodds 73 Dec 14, 2022
Python 100daysofcode

#python #100daysofcode Python is a simple, general purpose ,high level & object-oriented programming language even it's is interpreted scripting langu

Tara 1 Feb 10, 2022
Poetry workspace plugin for Python monorepos.

poetry-workspace-plugin Poetry workspace plugin for Python monorepos. Inspired by Yarn Workspaces. Adds a new subcommand group, poetry workspace, whic

Jack Smith 74 Jan 01, 2023
【AIεˆ›ι€ θ₯γ€‘ε‚θ΅›δ½œε“

-AI-emmmm 【AIεˆ›ι€ θ₯γ€‘ε‚θ΅›δ½œε“ ι¬Όη•œε°θ§†ι’‘ AiStuidoεœ°ε€οΌšhttps://aistudio.baidu.com/aistudio/projectdetail/1647685 BiliBiliθ§†ι’‘εœ°ε€οΌšhttps://www.bilibili.com/video/BV1Zv411b

107 Nov 09, 2022
This is an implementation of PEP 557, Data Classes.

This is an implementation of PEP 557, Data Classes. It is a backport for Python 3.6. Because dataclasses will be included in Python 3.7, any discussio

Eric V. Smith 561 Dec 06, 2022
Print 'text color' and 'text format' on Term with Python

term-printer Print 'text color' and 'text format' on Term with Python β€» It may not work depending on the OS and shell used. PIP $ pip install term-pri

γͺγͺとい぀ 10 Nov 12, 2022
Python interface to ISLEX, an English IPA pronunciation dictionary with syllable and stress marking.

pysle Questions? Comments? Feedback? Pronounced like 'p' + 'isle'. An interface to a pronunciation dictionary with stress markings (ISLEX - the intern

Tim 38 Dec 14, 2022
List of Linux Tools I put on almost every linux / Debian host

Linux-Tools List of Linux Tools I put on almost every Linux / Debian host Installed: geany -- GUI editor/ notepad++ like chkservice -- TUI Linux ser

Stew Alexander 20 Jan 02, 2023
A test repository to build a python package and publish the package to Artifact Registry using GCB

A test repository to build a python package and publish the package to Artifact Registry using GCB. Then have the package be a dependency in a GCF function.

1 Feb 09, 2022
simple password manager.

simple password manager.

1 Nov 18, 2021
A simple python project which control paint brush in microsoft paint app

Paint Buddy In Python A simple python project which control paint brush in micro

Ordinary Pythoneer 1 Dec 27, 2021
A functional standard library for Python.

Toolz A set of utility functions for iterators, functions, and dictionaries. See the PyToolz documentation at https://toolz.readthedocs.io LICENSE New

4.1k Jan 04, 2023
A C-like hardware description language (HDL) adding high level synthesis(HLS)-like automatic pipelining as a language construct/compiler feature.

β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆ

Julian Kemmerer 391 Jan 01, 2023