Decompose a forecast distribution into contributions from each component.
sts_decompose_forecast_by_component(model, forecast_dist, parameter_samples)
component_dists A named list mapping
component StructuralTimeSeries instances (elements of model$components
)
to Distribution
instances representing the marginal forecast for each component.
Each distribution has batch shape matching forecast_dist
(specifically,
the event shape is [num_steps_forecast]
).
An instance of sts_sum
representing a structural time series model.
A Distribution
instance returned by sts_forecast()
.
(specifically, must be a tfd.MixtureSameFamily
over a
tfd_linear_gaussian_state_space_model
parameterized by posterior samples).
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.
Other sts-functions:
sts_build_factored_surrogate_posterior()
,
sts_build_factored_variational_loss()
,
sts_decompose_by_component()
,
sts_fit_with_hmc()
,
sts_forecast()
,
sts_one_step_predictive()
,
sts_sample_uniform_initial_state()