Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarified difference between stochastic and non-stochastic climate variables in doc and readme #36

Merged
merged 5 commits into from
Apr 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,14 @@ All methods except the `adjust_3d` function requires that the input data sets on
Except for the variance scaling, all methods can be applied on stochastic and non-stochastic
climate variables. Variance scaling can only be applied on non-stochastic climate variables.

- Stochastic climate variables are those that are subject to random fluctuations
and are not predictable. They have no predictable trend or pattern. Examples of
stochastic climate variables include precipitation, air temperature, and humidity.

- Non-stochastic climate variables, on the other hand, have clear trend and pattern histories
and can be readily predicted. They are often referred to as climate elements and include
variables such as water temperature and air pressure.
- Non-stochastic climate variables are those that can be predicted with relative certainty based
on factors such as location, elevation, and season. Examples of non-stochastic climate variables
include air temperature, air pressure, and solar radiation.

- Stochastic climate variables, on the other hand, are those that exhibit a high degree of
variability and unpredictability, making them difficult to forecast accurately.
Precipitation is an example of a stochastic climate variable because it can vary greatly in timing,
intensity, and location due to complex atmospheric and meteorological processes.

---

Expand Down
59 changes: 30 additions & 29 deletions cmethods/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,30 +47,31 @@ def __init__(self, method: str, available_methods: list):

class CMethods:
"""
The CMethods class serves a collection of bias correction procedures to adjust
time-series of climate data.

The following bias correction techniques are available:
Scaling-based techniques:
* Linear Scaling :func:`cmethods.CMethods.linear_scaling`
* Variance Scaling :func:`cmethods.CMethods.variance_scaling`
* Delta (change) Method :func:`cmethods.CMethods.delta_method`

Distribution-based techniques:
* Quantile Mapping :func:`cmethods.CMethods.quantile_mapping`
* Detrended Quantile Mapping :func:`cmethods.CMethods.detrended_quantile_mapping`
* Quantile Delta Mapping :func:`cmethods.CMethods.quantile_delta_mapping`

Except for the Variance Scaling all methods can be applied on both, stochastic and non-stochastic
variables. The Variance Scaling can only be applied on stochastic climate variables.

Stochastic climate variables are those that are subject to random fluctuations
and are not predictable. They have no predictable trend or pattern. Examples of
stochastic climate variables include precipitation, air temperature, and humidity.

Non-stochastic climate variables, on the other hand, have clear trend and pattern histories
and can be readily predicted. They are often referred to as climate elements and include
variables such as water temperature and air pressure.
The CMethods class serves a collection of bias correction procedures to adjust
time-series of climate data.

The following bias correction techniques are available:
Scaling-based techniques:
* Linear Scaling :func:`cmethods.CMethods.linear_scaling`
* Variance Scaling :func:`cmethods.CMethods.variance_scaling`
* Delta (change) Method :func:`cmethods.CMethods.delta_method`

Distribution-based techniques:
* Quantile Mapping :func:`cmethods.CMethods.quantile_mapping`
* Detrended Quantile Mapping :func:`cmethods.CMethods.detrended_quantile_mapping`
* Quantile Delta Mapping :func:`cmethods.CMethods.quantile_delta_mapping`

Except for the Variance Scaling all methods can be applied on both, stochastic and non-stochastic
variables. The Variance Scaling can only be applied on stochastic climate variables.

- Non-stochastic climate variables are those that can be predicted with relative certainty based
on factors such as location, elevation, and season. Examples of non-stochastic climate variables
include air temperature, air pressure, and solar radiation.

- Stochastic climate variables, on the other hand, are those that exhibit a high degree of
variability and unpredictability, making them difficult to forecast accurately.
Precipitation is an example of a stochastic climate variable because it can vary greatly in timing,
intensity, and location due to complex atmospheric and meteorological processes.
"""

SCALING_METHODS = ["linear_scaling", "variance_scaling", "delta_method"]
Expand Down Expand Up @@ -397,10 +398,10 @@ def linear_scaling(

**Additive**:

In Linear Scaling, the long-term monthly mean (:math:`\mu_m`) of the modeled data :math:`T_{sim,h}` is subtracted
from the long-term monthly mean of the reference data :math:`T_{obs,h}` at time step :math:`i`.
This difference in month-dependent long-term mean is than added to the long-term monthly mean for time step :math:`i`,
in the time-series that is to be adjusted (:math:`T_{sim,p}`).
In Linear Scaling, the long-term monthly mean (:math:`\mu_m`) of the modeled data :math:`X_{sim,h}` is subtracted
from the long-term monthly mean of the reference data :math:`X_{obs,h}` at time step :math:`i`.
This difference in month-dependent long-term mean is than added to the value of time step :math:`i`,
in the time-series that is to be adjusted (:math:`X_{sim,p}`).

.. math::

Expand Down Expand Up @@ -504,7 +505,7 @@ def variance_scaling(
of the Variance Scaling approach are shown:

**(1)** First, the modeled data of the control and scenario period must be bias-corrected using
the Linear Scaling technique. This corrects the deviation in the mean.
the additive linear scaling technique. This adjusts the deviation in the mean.

.. math::

Expand Down
15 changes: 8 additions & 7 deletions docs/src/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,19 @@ The following bias correction techniques are available:

All of these methods are intended to be applied on 1-dimensional time-series climate data.
This module also provides the function :func:`cmethods.CMethods.adjust_3d` that enables
the application of the desired bias correction method on 3-dimensinoal data sets.
the application of the desired bias correction method on 3-dimensional data sets.

Except for the variance scaling, all methods can be applied on stochastic and non-stochastic
climate variables. Variance scaling can only be applied on non-stochastic climate variables.

- Stochastic climate variables are those that are subject to random fluctuations
and are not predictable. They have no predictable trend or pattern. Examples of
stochastic climate variables include precipitation, air temperature, and humidity.
- Non-stochastic climate variables are those that can be predicted with relative certainty based
on factors such as location, elevation, and season. Examples of non-stochastic climate variables
include air temperature, air pressure, and solar radiation.

- Non-stochastic climate variables, on the other hand, have clear trend and pattern histories
and can be readily predicted. They are often referred to as climate elements and include
variables such as water temperature and air pressure.
- Stochastic climate variables, on the other hand, are those that exhibit a high degree of
variability and unpredictability, making them difficult to forecast accurately.
Precipitation is an example of a stochastic climate variable because it can vary greatly in timing,
intensity, and location due to complex atmospheric and meteorological processes.

Examples can be found in the `python-cmethods`_ repository and of course
within this documentation.
Expand Down