environmentaltools.temporal.ensemble_dt
- environmentaltools.temporal.ensemble_dt(models: dict, percentiles='equally')[source]
Compute ensemble of temporal dependency parameters from multiple models.
Combines VAR model parameters from multiple Regional Climate Models (RCMs) or different model realizations using weighted or equal averaging.
- Parameters:
models (dict) – Dictionary with model identifiers as keys and file paths as values. Each file should contain temporal dependency parameters (B, Q matrices)
percentiles (str or list, optional) –
Weighting scheme for ensemble:
’equally’: Equal weight for all models (default)
list of float: Weight for each model (must sum to 1)
- Returns:
Ensemble temporal dependency parameters containing:
- Bnp.ndarray
Averaged autoregression coefficient matrix
- Qnp.ndarray
Averaged covariance matrix of residuals
- idint
Model order
- Return type:
dict
Notes
The ensemble is computed by:
Reading B and Q matrices from each model
Aligning matrix dimensions (padding with zeros if needed)
Computing weighted average (or simple average if ‘equally’)
For equal weights: B_ensemble = mean(B_i)
For custom weights: B_ensemble = sum(w_i * B_i)
Examples
>>> models = { ... 'model1': 'path/to/model1.json', ... 'model2': 'path/to/model2.json', ... 'model3': 'path/to/model3.json' ... } >>> # Equal weighting >>> ensemble = ensemble_dt(models, percentiles='equally') >>> >>> # Custom weighting >>> ensemble = ensemble_dt(models, percentiles=[0.5, 0.3, 0.2])