def test_adder_transition_to_powers(self):
   num_steps = 3
   dtype = dtypes.float64
   adder = level_trend.AdderStateSpaceModel(
       configuration=state_space_model.StateSpaceModelConfiguration(
           dtype=dtype))
   test_utils.transition_power_test_template(
       test_case=self, model=adder, num_steps=num_steps)
 def test_adder_noise_accumulator(self):
   num_steps = 3
   dtype = dtypes.float64
   use_level_noise = True
   adder = level_trend.AdderStateSpaceModel(
       use_level_noise=use_level_noise,
       configuration=state_space_model.StateSpaceModelConfiguration(
           dtype=dtype))
   test_utils.noise_accumulator_test_template(
       test_case=self, model=adder, num_steps=num_steps)
示例#3
0
def _replicate_level_trend_models(multivariate_configuration,
                                  univariate_configuration):
  """Helper function to construct a multivariate level/trend component."""
  with variable_scope.variable_scope("adder"):
    # Construct a level and trend model for each feature, with correlated
    # transition noise.
    adder_features = []
    for feature in range(multivariate_configuration.num_features):
      with variable_scope.variable_scope("feature{}".format(feature)):
        adder_features.append(level_trend.AdderStateSpaceModel(
            configuration=univariate_configuration))
    adder_part = state_space_model.StateSpaceCorrelatedFeaturesEnsemble(
        ensemble_members=adder_features,
        configuration=multivariate_configuration)
  return adder_part