Module: tfp.substrates.numpy.sts

Framework for Bayesian structural time series models.

See the blog post for an introductory example.

Classes

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

class Autoregressive: Formal representation of an autoregressive model.

class AutoregressiveIntegratedMovingAverage: Represents an autoregressive integrated moving-average (ARIMA) model.

class AutoregressiveMovingAverageStateSpaceModel: State space model for an autoregressive moving average process.

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 IntegratedStateSpaceModel: Integrates (/cumsums) a noise-free state space model.

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 MissingValuesTolerance: MissingValuesTolerance(overall_fraction, fraction_low_missing_number, fraction_high_missing_number, low_missing_number, high_missing_number)

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_surrogate_posterior_stateless(...): Returns stateless functions for building a variational posterior.

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.

moments_of_masked_time_series(...): Compute mean and variance, accounting for a mask.

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

regularize_series(...): Infers frequency and makes an irregular time series regular.

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