original_docstring: Sample from the joint prior over model parameters and trajectories.
  
      Args:
        num_timesteps: Scalar `int` `Tensor` number of timesteps to model.
        initial_step: Optional scalar `int` `Tensor` specifying the starting
          timestep.
            Default value: 0.
        params_sample_shape: Number of possible worlds to sample iid from the
          parameter prior, or more generally, `Tensor` `int` shape to fill with
          iid samples.
            Default value: `[]` (i.e., draw a single sample and don't expand the
            shape).
        trajectories_sample_shape: For each sampled set of parameters, number
          of trajectories to sample, or more generally, `Tensor` `int` shape to
          fill with iid samples.
          Default value: `[]` (i.e., draw a single sample and don't expand the
            shape).
        seed: PRNG seed; see `tfp.random.sanitize_seed` for details.
  
      Returns:
        trajectories: `float` `Tensor` of shape
          `trajectories_sample_shape + params_sample_shape + [num_timesteps, 1]`
          containing all sampled trajectories.
        param_samples: list of sampled parameter value `Tensor`s, in order
          corresponding to `self.parameters`, each of shape
          `params_sample_shape + prior.batch_shape + prior.event_shape`.
      
docstring: Sample from the joint prior over model parameters and trajectories.
docstring_tokens: Sample from the joint prior over model parameters and trajectories .
code: def prior_sample(self,
                     num_timesteps,
                     initial_step=0,
                     params_sample_shape=(),
                     trajectories_sample_shape=(),
                     seed=None):
      """Sample from the joint prior over model parameters and trajectories.
  
      Args:
        num_timesteps: Scalar `int` `Tensor` number of timesteps to model.
        initial_step: Optional scalar `int` `Tensor` specifying the starting
          timestep.
            Default value: 0.
        params_sample_shape: Number of possible worlds to sample iid from the
          parameter prior, or more generally, `Tensor` `int` shape to fill with
          iid samples.
            Default value: `[]` (i.e., draw a single sample and don't expand the
            shape).
        trajectories_sample_shape: For each sampled set of parameters, number
          of trajectories to sample, or more generally, `Tensor` `int` shape to
          fill with iid samples.
          Default value: `[]` (i.e., draw a single sample and don't expand the
            shape).
        seed: PRNG seed; see `tfp.random.sanitize_seed` for details.
  
      Returns:
        trajectories: `float` `Tensor` of shape
          `trajectories_sample_shape + params_sample_shape + [num_timesteps, 1]`
          containing all sampled trajectories.
        param_samples: list of sampled parameter value `Tensor`s, in order
          corresponding to `self.parameters`, each of shape
          `params_sample_shape + prior.batch_shape + prior.event_shape`.
      """
  
      seed = tfp_util.SeedStream(
          seed, salt='StructuralTimeSeries_prior_sample')
  
      with tf.name_scope('prior_sample'):
        param_samples = [
            p.prior.sample(params_sample_shape, seed=seed(), name=p.name)
            for p in self.parameters
        ]
        model = self.make_state_space_model(
            num_timesteps=num_timesteps,
            initial_step=initial_step,
            param_vals=param_samples)
        return model.sample(trajectories_sample_shape, seed=seed()), param_samples
code_tokens: def prior_sample ( self , num_timesteps , initial_step = 0 , params_sample_shape = ( ) , trajectories_sample_shape = ( ) , seed = None ) : seed = tfp_util . SeedStream ( seed , salt = 'StructuralTimeSeries_prior_sample' ) with tf . name_scope ( 'prior_sample' ) : param_samples = [ p . prior . sample ( params_sample_shape , seed = seed ( ) , name = p . name ) for p in self . parameters ] model = self . make_state_space_model ( num_timesteps = num_timesteps , initial_step = initial_step , param_vals = param_samples ) return model . sample ( trajectories_sample_shape , seed = seed ( ) ) , param_samples
short_docstring: Sample from the joint prior over model parameters and trajectories.
short_docstring_tokens: Sample from the joint prior over model parameters and trajectories .
comment: """Sample from the joint prior over model parameters and trajectories.
  
      Args:
        num_timesteps: Scalar `int` `Tensor` number of timesteps to model.
        initial_step: Optional scalar `int` `Tensor` specifying the starting
          timestep.
            Default value: 0.
        params_sample_shape: Number of possible worlds to sample iid from the
          parameter prior, or more generally, `Tensor` `int` shape to fill with
          iid samples.
            Default value: `[]` (i.e., draw a single sample and don't expand the
            shape).
        trajectories_sample_shape: For each sampled set of parameters, number
          of trajectories to sample, or more generally, `Tensor` `int` shape to
          fill with iid samples.
          Default value: `[]` (i.e., draw a single sample and don't expand the
            shape).
        seed: PRNG seed; see `tfp.random.sanitize_seed` for details.
  
      Returns:
        trajectories: `float` `Tensor` of shape
          `trajectories_sample_shape + params_sample_shape + [num_timesteps, 1]`
          containing all sampled trajectories.
        param_samples: list of sampled parameter value `Tensor`s, in order
          corresponding to `self.parameters`, each of shape
          `params_sample_shape + prior.batch_shape + prior.event_shape`.
      """