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: 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.
      Default value: `None`.
  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`.
docstr_tok: ["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","do","n'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","do","n't","expand","the","shape",")",".","seed",":","PRNG","seed",";","see","`","tfp.random.sanitize_seed","`","for","details",".","Default","value",":","`","None","`",".","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","`","."]
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.
          Default value: `None`.
      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`.
      """
      parameters_seed, trajectories_seed = samplers.split_seed(
          seed, n=2
      )
      param_samples = self._joint_prior_distribution().sample(
          params_sample_shape, seed=parameters_seed
      )
      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=trajectories_seed
          ),
          list(param_samples.values()),
      )
  
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 15 for calling the StructuralTimeSeries obj's underlying member method code with example usage: obj.prior_sample(num_timesteps, initial_step, params_sample_shape, trajectories_sample_shape, seed) and returns: model,  list