class_docstr: Base class for structural time series models.
  
  A StructuralTimeSeries object represents a declarative specification of a
  structural time series model, including priors on model parameters.
  It implements a joint probability model
    `p(params, y) = p(params) p(y | params)`,
  where `params` denotes a list of real-valued parameters specified by the child
  class, and `p(y | params)` is a linear Gaussian state space model with
  structure determined by the child class.
class_docstr_tok: ["Base","class","for","structural","time","series","models",".","A","StructuralTimeSeries","object","represents","a","declarative","specification","of","a","structural","time","series","model",",","including","priors","on","model","parameters",".","It","implements","a","joint","probability","model","`","p","(","params",",","y",")","=","p","(","params",")","p","(","y","|","params",")","`",",","where","`","params","`","denotes","a","list","of","real-valued","parameters","specified","by","the","child","class",",","and","`","p","(","y","|","params",")","`","is","a","linear","Gaussian","state","space","model","with","structure","determined","by","the","child","class","."]
docstr: Models the sum of the series from the two components.
docstr_tok: ["Models","the","sum","of","the","series","from","the","two","components","."]
code: def __add__(self, other):
      """Models the sum of the series from the two components."""
      # Local import to avoid circular dependency.
      from tensorflow_probability.python.sts.components import (
          sum as sts_sum,
      )  # pylint: disable=g-import-not-at-top
  
      sum_kwargs = {}
      if isinstance(self, sts_sum.Sum) and isinstance(
          other, sts_sum.Sum
      ):
          # Debatably, a Sum + Sum should sum the `constant_offset` parameters, and
          # should model the sum of the component observation noises (e.g., if
          # `noise1 ~ N(0, scale=1)` and `noise2 ~ N(0, scale=1)`, then
          # `noise1 + noise2 ~ N(0, scale=sqrt(2))`). But this would be surprising
          # in the likely-common case where both sums are modeling the same
          # observed_time_series. So we instead treat Sum + Sum as a logical
          # 'merge' operation on the components, requiring that all other parameters
          # match.
          _assert_dict_contents_are_equal(
              self.init_parameters,
              other.init_parameters,
              ignore=["components"],
              message="Cannot add Sum components with different parameter values.",
          )
          sum_kwargs = self.init_parameters
      elif isinstance(self, sts_sum.Sum):
          sum_kwargs = self.init_parameters
      elif isinstance(other, sts_sum.Sum):
          sum_kwargs = other.init_parameters
      else:
          # If creating a Sum from scratch, try to infer a heuristic noise prior.
          observed_time_series = self.init_parameters.get(
              "observed_time_series", None
          )
          if observed_time_series is None:
              observed_time_series = other.init_parameters.get(
                  "observed_time_series", None
              )
          if observed_time_series is None:
              raise ValueError(
                  "Could not automatically create a `Sum` component "
                  "because neither summand was initialized with an "
                  "`observed_time_series`. You may still instantiate "
                  "the component manually as `tfp.sts.Sum(...)."
              )
          sum_kwargs["observed_time_series"] = observed_time_series
  
      my_components = getattr(self, "components", [self])
      other_components = getattr(other, "components", [other])
      sum_kwargs["components"] = list(my_components) + list(
          other_components
      )
      return sts_sum.Sum(**sum_kwargs)
  
imports: import collections
  import types
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import joint_distribution_auto_batched
  from tensorflow_probability.python.distributions import sample
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.sts.internal import util
  from tensorflow.python.util import deprecation
label_desc: Use image node_id 9 for calling the StructuralTimeSeries obj's underlying member method code with example usage: obj.__add__(other) and returns: sts_sum