TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

Module: tfp.sts

View source on GitHub

Framework for Bayesian structural time series models.

Classes

class AdditiveStateSpaceModel: A state space model representing a sum of component state space models.

class Autoregressive: Formal representation of an autoregressive model.

class AutoregressiveStateSpaceModel: State space model for an autoregressive process.

class ConstrainedSeasonalStateSpaceModel: Seasonal state space model with effects constrained to sum to zero.

class DynamicLinearRegression: Formal representation of a dynamic linear regresson model.

class DynamicLinearRegressionStateSpaceModel: State space model for a dynamic linear regression from provided covariates.

class LinearRegression: Formal representation of a linear regression from provided covariates.

class LocalLevel: Formal representation of a local level model.

class LocalLevelStateSpaceModel: State space model for a local level.

class LocalLinearTrend: Formal representation of a local linear trend model.

class LocalLinearTrendStateSpaceModel: State space model for a local linear trend.

class MaskedTimeSeries: Named tuple encoding a time series Tensor and optional missingness mask.

class Seasonal: Formal representation of a seasonal effect model.

class SeasonalStateSpaceModel: State space model for a seasonal effect.

class SemiLocalLinearTrend: Formal representation of a semi-local linear trend model.

class SemiLocalLinearTrendStateSpaceModel: State space model for a semi-local linear trend.

class SmoothSeasonal: Formal representation of a smooth seasonal effect model.

class SmoothSeasonalStateSpaceModel: State space model for a smooth seasonal effect.

class SparseLinearRegression: Formal representation of a sparse linear regression.

class StructuralTimeSeries: Base class for structural time series models.

class Sum: Sum of structural time series components.

Functions

build_factored_surrogate_posterior(...): Build a variational posterior that factors over model parameters.

build_factored_variational_loss(...): Build a loss function for variational inference in STS models. (deprecated)

decompose_by_component(...): Decompose an observed time series into contributions from each component.

decompose_forecast_by_component(...): Decompose a forecast distribution into contributions from each component.

fit_with_hmc(...): Draw posterior samples using Hamiltonian Monte Carlo (HMC).

forecast(...): Construct predictive distribution over future observations.

impute_missing_values(...): Runs posterior inference to impute the missing values in a time series.

one_step_predictive(...): Compute one-step-ahead predictive distributions for all timesteps.

sample_uniform_initial_state(...): Initialize from a uniform [-2, 2] distribution in unconstrained space.