Skip to content

Commit 0c4590e

Browse files
Always count names to determine k_endog
1 parent 530f530 commit 0c4590e

File tree

1 file changed

+6
-7
lines changed
  • pymc_extras/statespace/models/structural

1 file changed

+6
-7
lines changed

pymc_extras/statespace/models/structural/core.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -483,13 +483,12 @@ def populate_component_properties(self):
483483
def _get_combined_shapes(self, other):
484484
k_states = self.k_states + other.k_states
485485
k_posdef = self.k_posdef + other.k_posdef
486-
if self.k_endog == other.k_endog:
487-
k_endog = self.k_endog
488-
else:
489-
combined_states = self._combine_property(
490-
other, "observed_state_names", allow_duplicates=False
491-
)
492-
k_endog = len(combined_states)
486+
487+
# To count endog states, we have to count unique names between the two components.
488+
combined_states = self._combine_property(
489+
other, "observed_state_names", allow_duplicates=False
490+
)
491+
k_endog = len(combined_states)
493492

494493
return k_states, k_posdef, k_endog
495494

0 commit comments

Comments
 (0)