Given samples from the posterior over parameters, return the predictive
distribution over observations at each time T
, given observations up
through time T-1
.
sts_one_step_predictive(
observed_time_series,
model,
parameter_samples,
timesteps_are_event_shape = TRUE
)
forecast_dist a tfd_mixture_same_family
instance with event shape
list(num_timesteps)
and batch shape tf$concat(list(sample_shape, model$batch_shape))
, with
num_posterior_draws
mixture components. The t
th step represents the
forecast distribution p(observed_time_series[t] | observed_time_series[0:t-1], parameter_samples)
.
float
tensor
of shape
concat([sample_shape, model.batch_shape, [num_timesteps, 1]])
where
sample_shape
corresponds to i.i.d. observations, and the trailing [1]
dimension may (optionally) be omitted if num_timesteps > 1
. May
optionally be an instance of sts_masked_time_series
, which includes
a mask tensor
to specify timesteps with missing observations.
An instance of StructuralTimeSeries
representing a
time-series model. This represents a joint distribution over
time-series and their parameters with batch shape [b1, ..., bN]
.
list
of tensors
representing posterior samples
of model parameters, with shapes
list(tf$concat(list(list(num_posterior_draws), param<1>$prior$batch_shape, param<1>$prior$event_shape), list(list(num_posterior_draws), param<2>$prior$batch_shape, param<2>$prior$event_shape), ... ) )
for all model parameters.
This may optionally also be a named list mapping parameter names to tensor
values.
Deprecated, for backwards compatibility only. If False, the predictive distribution will return per-timestep probabilities Default value: TRUE.
Other sts-functions:
sts_build_factored_surrogate_posterior()
,
sts_build_factored_variational_loss()
,
sts_decompose_by_component()
,
sts_decompose_forecast_by_component()
,
sts_fit_with_hmc()
,
sts_forecast()
,
sts_sample_uniform_initial_state()