We need to add a check on the data passed to build_statespace_graph: currently, it doesn't make sure that the order of the columns in the dataframe is the same as the list of observed states passed to observed_state_names by the user.
This will cause unexpected behavior for multivariate time series: the model will run, but the indices of the time series will be messed up. For instance, if I pass my observed_state_names in the chronological order (one president, then the next in history let's say), but then I pass a dataframe whose columns are sorted alphabetically, the resulting time series will be misaligned.
We need to add a check on the data passed to
build_statespace_graph: currently, it doesn't make sure that the order of the columns in the dataframe is the same as the list of observed states passed toobserved_state_namesby the user.This will cause unexpected behavior for multivariate time series: the model will run, but the indices of the time series will be messed up. For instance, if I pass my
observed_state_namesin the chronological order (one president, then the next in history let's say), but then I pass a dataframe whose columns are sorted alphabetically, the resulting time series will be misaligned.