# Posts tagged time series

## Multivariate Gaussian Random Walk

- 02 February 2023
- Category: beginner

This notebook shows how to fit a correlated time series using multivariate Gaussian random walks (GRWs). In particular, we perform a Bayesian regression of the time series data against a model dependent on GRWs.

## Analysis of An AR(1) Model in PyMC

- 07 January 2023
- Category: , intermediate

Consider the following AR(2) process, initialized in the infinite past: $\( y_t = \rho_0 + \rho_1 y_{t-1} + \rho_2 y_{t-2} + \epsilon_t, \)\( where \)\epsilon_t \overset{iid}{\sim} {\cal N}(0,1)\(. Suppose you'd like to learn about \)\rho\( from a a sample of observations \)Y^T = { y_0, y_1,\ldots, y_T }$.

## Bayesian Vector Autoregressive Models

- 04 November 2022
- Category: intermediate

Duplicate implicit target name: “bayesian vector autoregressive models”.

## Interrupted time series analysis

- 04 October 2022
- Category: intermediate

This notebook focuses on how to conduct a simple Bayesian interrupted time series analysis. This is useful in quasi-experimental settings where an intervention was applied to all treatment units.

## Gaussian Processes: Latent Variable Implementation

- 28 September 2022
- Category: intermediate, reference

The `gp.Latent`

class is a direct implementation of a Gaussian process without approximation. Given a mean and covariance function, we can place a prior on the function \(f(x)\),

## Difference in differences

- 04 September 2022
- Category: intermediate

This notebook provides a brief overview of the difference in differences approach to causal inference, and shows a working example of how to conduct this type of analysis under the Bayesian framework, using PyMC. While the notebooks provides a high level overview of the approach, I recommend consulting two excellent textbooks on causal inference. Both The Effect [Huntington-Klein, 2021] and Causal Inference: The Mixtape [Cunningham, 2021] have chapters devoted to difference in differences.

## Counterfactual inference: calculating excess deaths due to COVID-19

- 04 July 2022
- Category: intermediate

Causal reasoning and counterfactual thinking are really interesting but complex topics! Nevertheless, we can make headway into understanding the ideas through relatively simple examples. This notebook focuses on the concepts and the practical implementation of Bayesian causal reasoning using PyMC.

## Stochastic Volatility model

- 17 June 2022
- Category: beginner

Asset prices have time-varying volatility (variance of day over day `returns`

). In some periods, returns are highly variable, while in others very stable. Stochastic volatility models model this with a latent volatility variable, modeled as a stochastic process. The following model is similar to the one described in the No-U-Turn Sampler paper, [Hoffman and Gelman, 2014].

## Air passengers - Prophet-like model

- 04 April 2022
- Category: intermediate

We’re going to look at the “air passengers” dataset, which tracks the monthly totals of a US airline passengers from 1949 to 1960. We could fit this using the Prophet model [Taylor and Letham, 2018] (indeed, this dataset is one of the examples they provide in their documentation), but instead we’ll make our own Prophet-like model in PyMC3. This will make it a lot easier to inspect the model’s components and to do prior predictive checks (an integral component of the Bayesian workflow [Gelman *et al.*, 2020]).