# Bayesian structural time series

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Bayesian_structural_time_series
> Markdown URL: https://mediated.wiki/source/Bayesian_structural_time_series.md
> Source: https://en.wikipedia.org/wiki/Bayesian_structural_time_series
> Source revision: 1307979873
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

Statistical technique used for feature selection

This article includes a list of general references, but it lacks sufficient corresponding inline citations. Please help to improve this article by introducing more precise citations. (April 2016) (Learn how and when to remove this message)

**Bayesian structural time series** (**BSTS**) model is a [statistical](/source/Statistical) technique used for [feature selection](/source/Feature_selection), time series forecasting, [nowcasting](/source/Nowcasting_(economics)), inferring causal impact and other applications. The model is designed to work with [time series](/source/Time_series) data.

The model has also promising application in the field of analytical [marketing](/source/Marketing). In particular, it can be used in order to assess how much different marketing campaigns have contributed to the change in web search volumes, product sales, brand popularity and other relevant indicators. [Difference-in-differences](/source/Difference_in_differences) models[1] and [interrupted time series](/source/Interrupted_time_series) designs[2] are alternatives to this approach. "In contrast to classical difference-in-differences schemes, state-space models make it possible to (i) infer the temporal evolution of attributable impact, (ii) incorporate empirical priors on the parameters in a fully Bayesian treatment, and (iii) flexibly accommodate multiple sources of variation, including the time-varying influence of contemporaneous covariates, i.e., synthetic controls."[1]

## General model description

The model consists of three main components:

1. **[Kalman filter](/source/Kalman_filter)**. The technique for time series decomposition. In this step, a researcher can add different state variables: trend, seasonality, regression, and others.

1. **[Spike-and-slab](/source/Spike-and-slab_variable_selection) method.** In this step, the most important regression predictors are selected.

1. **[Bayesian model averaging](/source/Ensemble_learning).** Combining the results and prediction calculation.

The model could be used to discover the causations with its counterfactual prediction and the observed data.[1]

A possible drawback of the model can be its relatively complicated mathematical underpinning and difficult implementation as a computer program. However, the programming language [R](/source/R_(programming_language)) has ready-to-use packages for calculating the BSTS model,[3][4] which do not require strong mathematical background from a researcher.

## See also

- [Bayesian inference using Gibbs sampling](/source/Bayesian_inference_using_Gibbs_sampling)

- [Correlation does not imply causation](/source/Correlation_does_not_imply_causation)

- [Spike-and-slab regression](/source/Spike-and-slab_regression)

## References

1. ^ [***a***](#cite_ref-:0_1-0) [***b***](#cite_ref-:0_1-1) [***c***](#cite_ref-:0_1-2) ["Inferring causal impact using Bayesian structural time-series models"](http://research.google.com/pubs/pub41854.html). *research.google.com*. Retrieved 2016-04-17.

1. **[^](#cite_ref-2)** ["Interrupted Time-Series Design"](https://web.archive.org/web/20190321192704/https://www.insightsassociation.org/issues-policies/glossary/interrupted-time-series-design). *Interrupted Time-Series Design*. Insights Association. Archived from [the original](https://www.insightsassociation.org/issues-policies/glossary/interrupted-time-series-design) on 21 March 2019. Retrieved 21 March 2019.

1. **[^](#cite_ref-3)** ["bsts"](https://cran.r-project.org/web/packages/bsts/bsts.pdf) (PDF).

1. **[^](#cite_ref-4)** ["CausalImpact"](https://google.github.io/CausalImpact/CausalImpact.html). *google.github.io*. Retrieved 2016-04-17.

## Further reading

- Scott, S. L., & Varian, H. R. 2014a. [Bayesian variable selection for nowcasting economic time series](http://people.ischool.berkeley.edu/~hal/Papers/2012/fat.pdf). *Economic Analysis of the Digital Economy.*

- Scott, S. L., & Varian, H. R. 2014b. [Predicting the present with bayesian structural time series](http://people.ischool.berkeley.edu/~hal/Papers/2013/pred-present-with-bsts.pdf). *International Journal of Mathematical Modelling and Numerical Optimisation.*

- Varian, H. R. 2014. [Big Data: New Tricks for Econometrics](http://people.ischool.berkeley.edu/~hal/Papers/2013/ml.pdf). *Journal of Economic Perspectives*

- Brodersen, K. H., Gallusser, F., Koehler, J., Remy, N., & Scott, S. L. 2015. [Inferring causal impact using Bayesian structural time-series models](http://research.google.com/pubs/pub41854.html). *The Annals of Applied Statistics.*

- R package ["bsts"](https://cran.r-project.org/web/packages/bsts/bsts.pdf).

- R package ["CausalImpact"](https://google.github.io/CausalImpact/CausalImpact.html).

- O’Hara, R. B., & Sillanpää, M. J. 2009. [A review of Bayesian variable selection methods: what, how and which](https://projecteuclid.org/euclid.ba/1340370391). *Bayesian analysis.*

- [Hoeting, J. A.](/source/Jennifer_A._Hoeting), Madigan, D., Raftery, A. E., & Volinsky, C. T. 1999. [Bayesian model averaging: a tutorial](https://projecteuclid.org/euclid.ss/1009212519). *Statistical science.*

---
Adapted from the Wikipedia article [Bayesian structural time series](https://en.wikipedia.org/wiki/Bayesian_structural_time_series) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Bayesian_structural_time_series?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
