Introducing Orbit, An Open Source Package for Time Series Inference and Forecasting
May 14, 2021 / Global
Orbit is a general interface for Bayesian time series modeling. The goal of Orbit development team is to create a tool that is easy to use, flexible, interitible, and high performing (fast computation). Under the hood, Orbit uses the probabilistic programming languages (PPL) including but not limited to Stan and Pyro for posterior approximation (i.e, MCMC sampling, SVI). Below is a quadrant chart to position a few time series related packages in our assessment in terms of flexibility and completeness. Orbit is the only tool that allows for easy model specification and analysis while not limiting itself to a small subset of models. For example Prophet has a complete end to end solution but only has one model type and Pyro has total specification model flexibility but does not give an end to end solution. Thus Orbit bridges the gap between business problems and statistical solutions.

There are many different use cases of time series forecasting at Uber, both strategic ones (long-term) and tactical ones (short-term). This Uber blog post provided an overview of those use cases. Many of them not only require end-to-end forecasting, but also a causal inference structure in order to provide explainability, quantify uncertainty, and perform a what-if scenario analysis. Orbit could improve the quality and efficiency of this process.
Orbit has a wide range of applications in Uber’s marketing data science team for measurement, planning, and forecasting. Primarily it is used in measuring the performance for various marketing levers at subchannel and daily granularity.
Orbit enables the easy decomposition of a KPI time series into trend, seasonality, and marketing channels effects. This decomposition enables unbiased forecasting and dynamic insights, including cost curves and ROAS of marketing channels. The forecasting is an important part of planning future marketing budgets and the optimization of spending across different channels and regions.
Orbit can utilize real world data in multiple formats simultaneously; i.e., incorporating results from previous experimentations along with multiple channels of contemporaneous data.

What is Orbit?
Orbit stands for Object-ORiented BayesIan Time Series. It is used to conduct time series inferences and forecasting with structural Bayesian time series models for real-world cases and research. Like many other ML use cases, the best model structure is largely dependent on that particular use case and available data. A common approach to determine a well-suited model is to try out different model types, perform backtesting, and diagnose how well they perform. Having one, consistent interface for performing all these tasks largely simplifies our ability to determine the best model for a given use case.
While there are plenty of time series model implementations in the Python ecosystem, Orbit aims to provide a consistent Python interface to simplify Bayesian time-series modeling workflow by linking one command to each step in the following diagram. Check out the How to Use Orbit? section for command examples.

We follow a number of object-oriented design patterns to maintain independence between Estimators and Models. What that means for the end users is that there will be consistency in package usage to accomplish a desired use case. What that means for model developers is that their focus can be on the structure of the model, rather than the Orbit interface or interactions with the underlying PPL.

Estimators are classes that handle interactions with the PPL such as Stan or Pyro. It may seem unnecessary to implement this class if we are using an underlying PPL, however, in addition to the nuances of each PPL, a user must also determine:
- Whether to perform a point estimate or sample a full distribution
- What algorithm to use for sampling a distribution
- What kind of aggregation to use for a point estimation
- And various algorithm fine-tuning configurations
We abstract away some of the decisions, and allow a Model to compose a specified Estimator within it. A Model is a concrete implementation of a model structure, and how to perform inference after the parameter estimation. Currently implemented are two main classes of models, named Local Global Trend (LGT) and Damped Local Trend (DLT), which we’ll discuss in further detail below. We found that for our use cases, the current two model implementations performed well relative to other solutions. One important goal of Orbit is to quickly incorporate new models while maintaining a consistent interface. Furthermore, we have modules for backtesting, diagnostics, and visualization that will work out of box with any Orbit model object. To be specific, our package provides:
- A general interface for training and prediction of time series models with great extendibility
- Child classes for a family of Bayesian exponential smoothing models
- Data loaders for quick access of time series data sets with different granularities
- Rich diagnostic plotting tools
- A general-purpose backtesting utility
- A hyper-parameter tuning utility
How to Use Orbit?
Orbit’s APIs are descended to have a similar interface to Scikit-learn (the de-facto standard Python library for general-purpose statistical and machine learning model building). An example workflow using Damped Local Trend (DLT) model in Orbit API is as follows:
For more details, read our quick start guide and documentation page.
After model training, the predictions can be visualized at convenience.

Orbit also provides a rich set of plotting tools to visualize and diagnose the posterior distribution of sampling parameters and the trace of posteriors.




