bulum.plots.ensemble_altair_plots module
Statistical analyses of DataframeEnsemble
- ensemble_probability_plot(input: DataframeEnsemble | list, variable: str, parameters: list, stat_function, labels=None, width=800, height=400)
Returns a plot of typical probabilistic outputs from DataframeEnsemble inputs.
- Parameters:
input (DataframeEnsemble | list of DataframeEnsemble) – A (likely) filtered DataframeEnsemble (or list of DataframeEnsembles).
variable (str) – Timeseries column of interest from the ensembled DataFrames e.g. ‘Storage Volume’.
parameters (list) – List of parameters to test (relevant to function type).
stat_function (function) – Function from the bulum.stats.ensemble_stats module, namely from the following list: - cumulative_risk - incremental_risk - annual_incremental_risk - percentile_envelope
width (int, optional) – Plot width. Defaults to 800.
height (int, optional) – Plot height. Defaults to 400.
- Returns:
Returns an Altair chart object.
- Return type:
altair.Chart
Examples
Constructing cumulative risk plot, looking at storage volumes [100000,50000,20000].
>>> ensemble_probability_plot(input=[DataframeEnsemble.filter_tag("Scen1"), DataframeEnsemble.filter_tag("Scen2")], variable="Dam Storage Volume", parameters=[100000,50000,20000], stat_function=stats.cumulative_risk)
Constructing annual incremental risk plot, looking at storage volumes [100000,50000,20000]. Custom labels.
>>> ensemble_probability_plot(input=[DataframeEnsemble.filter_tag("Scen1"), DataframeEnsemble.filter_tag("Scen2")], variable="Dam Storage Volume", parameters=[100000,50000,20000], stat_function=stats.annual_incremental_risk, labels=["Existing Dam", "Raised Dam"])
Constructing percentile envelope plot (single dataset), looking at percentiles [1,10,90].
>>> ensemble_probability_plot(input=DataframeEnsemble.filter_tag("Scen1"), variable="Dam Storage Volume", parameters=[1,10,90], stat_function=stats.percentile_envelope)