statsmodels.tsa.statespace.news.NewsResults.summary_details

NewsResults.summary_details(source='news', impact_date=None, impacted_variable=None, update_date=None, updated_variable=None, groupby='update date', sparsify=True, float_format='%.2f', multiple_tables=False)[source]

Create summary table with detailed impacts; by date, variable

Parameters:
source{news, revisions}

The source of impacts to summarize. Default is “news”.

impact_dateint, str, datetime, list, array, or slice, optional

Observation index label or slice of labels specifying particular impact periods to display. The impact date(s) describe the periods in which impacted variables were affected by the news. If this argument is given, the output table will only show this impact date or dates. Note that this argument is passed to the Pandas loc accessor, and so it should correspond to the labels of the model’s index. If the model was created with data in a list or numpy array, then these labels will be zero-indexes observation integers.

impacted_variablestr, list, array, or slice, optional

Observation variable label or slice of labels specifying particular impacted variables to display. The impacted variable(s) describe the variables that were affected by the news. If you do not know the labels for the variables, check the endog_names attribute of the model instance.

update_dateint, str, datetime, list, array, or slice, optional

Observation index label or slice of labels specifying particular updated periods to display. The updated date(s) describe the periods in which the new data points were available that generated the news). See the note on impact_date for details about what these labels are.

updated_variablestr, list, array, or slice, optional

Observation variable label or slice of labels specifying particular updated variables to display. The updated variable(s) describe the variables that were affected by the news. If you do not know the labels for the variables, check the endog_names attribute of the model instance.

groupby{update date, updated date, impact date, impacted date}

The primary variable for grouping results in the details table. The default is to group by update date.

sparsifybool, optional, default True

Set to False for the table to include every one of the multiindex keys at each row.

float_formatstr, optional

Formatter format string syntax for converting numbers to strings. Default is ‘%.2f’.

multiple_tablesbool, optional

If set to True, this function will return a list of tables, one table for each of the unique groupby levels. Default is False, in which case this function returns a single table.

Returns:
details_tableSimpleTable or list of SimpleTable

Table or list of tables describing how the news from each update (i.e. news from a particular variable / date) translates into changes to the forecasts of each impacted variable variable / date.

This table contains information about the updates and about the impacts. Updates are newly observed datapoints that were not available in the previous results set. Each update leads to news, and the news may cause changes in the forecasts of the impacted variables. The amount that a particular piece of news (from an update to some variable at some date) impacts a variable at some date depends on weights that can be computed from the model results.

The data contained in this table that refer to updates are:

  • update date : The date at which a new datapoint was added.

  • updated variable : The variable for which a new datapoint was added.

  • forecast (prev) : The value that had been forecast by the previous model for the given updated variable and date.

  • observed : The observed value of the new datapoint.

  • news : The news is the difference between the observed value and the previously forecast value for a given updated variable and date.

The data contained in this table that refer to impacts are:

  • impact date : A date associated with an impact.

  • impacted variable : A variable that was impacted by the news.

  • weight : The weight of news from a given update date and update variable on a given impacted variable at a given impact date.

  • impact : The revision to the smoothed estimate / forecast of the impacted variable at the impact date based specifically on the news generated by the updated variable at the update date.


Last update: Apr 19, 2024