MISO2 Stats

Created on Mon Feb 21 17:44:34 2022

@author: bgrammer

class model.output.MISO2_stats.MISO2Stats

Contains summary statistics (sample size, mean and sample variance) over multiple MISO2Output objects.

This is a child class of MISO2Output.

values

A nested dictionary of Pandas dataframes. Keys are parameter names and result types (“mean”, “ssq” and “s_var”).

Type:

dict

metadata

Metadata information, copied from first output file added.

Type:

dict

n

Number of aggregated src outputs.

Type:

int

add_miso_output(miso_output, add='result')

Appends values of a MISO2Output object to the summary statistics.

The implementation uses Welford’s online algorithm. Sample variance is not continuously updated, but needs to be explicitly called for with the method calculate_s_var.

Parameters:
  • miso_output (MISO2Output) – MISO2Output object, whose “result” values are added to the running mean/var.

  • add (str) – Type of output that is added. Defaults to “result”.

calculate_consecutive_stock_summaries(stocks='S10_stock_enduse')

Returns consecutive stock summarise by enduse.

Stock name / enduse output needs to be present for this to work.

Parameters:

stocks (str) – Name of stock by enduse parameter

Returns:

Dataframe with combined results and number of run as part of index.

Return type:

combined(pd.DataFrame)

finalize()

Finalize MISO2Stats object by calculating variance and setting correct indices.

Since index values change, no further output can be added to object once it has been finalized.