Here:
Common jargon
Uncertainty quantification
Joe Hamman, September 15, 2019
xsd
is a toolkit for statistical downscaling usising Xarray. It is meant to support the development of new and existing downscaling methods in a common framework. It implements a train/predict API that accepts Xarray objects, similiar to Python's Scikit-Learn, for building a range of downscaling models. For example, implementing a BCSD workflow may look something like this:
from xsd.pointwise_models import PointWiseDownscaler
from xsd.models.bcsd import BCSDTemperature, bcsd_disaggregator
# da_temp_train: xarray.DataArray (monthly)
# da_temp_obs: xarray.DataArray (monthly)
# da_temp_obs_daily: xarray.DataArray (daily)
# da_temp_predict: xarray.DataArray (monthly)
# create a model
bcsd_model = PointWiseDownscaler(BCSDTemperature(), dim='time')
# train the model
bcsd_model.train(da_temp_train, da_temp_obs)
# predict with the model (downscaled_temp: xr.DataArray)
downscaled_temp = bcsd_model.predict(da_temp_predict)
# disaggregate the downscaled data (final: xr.DataArray)
final = bcsd_disaggregator(downscaled_temp, da_temp_obs_daily)
I'm currently envisioning the project having three componenets (described in the components section). While I haven't started work on the deep learning models component, this is certainly a central motivation to this package and I am looking forward to starting on this work soon.
pointwise_models
: a collection of linear models that are intended to be applied point-by-point. These may be sklearn Pipelines or custom sklearn-like models (e.g. BCSDTemperature).global_models
: (not implemented) concept space for deep learning-based models.metrics
: (not implemented) concept space for a benchmarking suiteXSD should provide a collection of a common set of downscaling models and the building blocks to construct new models. As a starter, I intend to implement the following models:
Pointwise models
Other methods, like LOCA, MACA, BCCA, etc, should also be possible.
Global models
This class of methods is really what is motivating the development of this package. We've seen some early work from TJ Vandal in this area but there is more work to be done. For now, I'll just jot down what a possible API might look like:
from xsd.global_models import GlobalDownscaler
from xsd.global_models.deepsd import DeepSD
# ...
# create a model
model = GlobalDownscaler(DeepSD()) # <-- I'll save my thoughts on the under-the-hood implementation for later
# train the model
model.train(da_temp_train, da_temp_obs)
# predict with the model (downscaled_temp: xr.DataArray)
downscaled_temp = model.predict(da_temp_predict)