TensorFlow 2.0 Beta is available Learn more

Module: tfp.sts

Framework for Bayesian structural time series models.

Defined in python/sts/__init__.py.


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 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.


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

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.

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.