【发布时间】:2020-05-30 21:15:48
【问题描述】:
我正在运行 tensorflow 2.1 和 tensorflow_probability 0.9。我已经拟合了带有季节性成分的结构时间序列模型。我正在使用 Tensorflow Probability Structural Time Series Probability 示例中的代码: Tensorflow Github.
在示例中,有一个很好的分解图:
# Get the distributions over component outputs from the posterior marginals on
# training data, and from the forecast model.
component_dists = sts.decompose_by_component(
demand_model,
observed_time_series=demand_training_data,
parameter_samples=q_samples_demand_)
forecast_component_dists = sts.decompose_forecast_by_component(
demand_model,
forecast_dist=demand_forecast_dist,
parameter_samples=q_samples_demand_)
demand_component_means_, demand_component_stddevs_ = (
{k.name: c.mean() for k, c in component_dists.items()},
{k.name: c.stddev() for k, c in component_dists.items()})
(
demand_forecast_component_means_,
demand_forecast_component_stddevs_
) = (
{k.name: c.mean() for k, c in forecast_component_dists.items()},
{k.name: c.stddev() for k, c in forecast_component_dists.items()}
)
当使用趋势组件时,是否可以同时分解和可视化:
趋势/_level_scale & 趋势/_slope_scale
我尝试了很多排列来提取趋势组件的嵌套元素,但没有成功。
提前感谢您的宝贵时间。
【问题讨论】:
标签: time-series tensorflow-probability state-space