# Data Preprocessing

Economic and financial time series data can require preprocessing or
transforming before you can analyze or model them. While base MATLAB^{®} has general purpose and timetable functionality for
preprocessing or cleaning data (for example, the `log`

function
removes an exponential trend from series and Data Cleaner
enables you to clean messy data interactively), Econometrics Toolbox™ has specialized functionality for preprocessing financial time
series. For example, you can obtain a common or desired time base by
aggregating multiple series, convert price series to growth rates, or
decompose series into additive trend and cyclical components.

## Apps

Econometric Modeler | Analyze and model econometric time series |

## Classes

`LagOp` | Create lag operator polynomial |

## Functions

## Topics

### Interactive Workflows

**Prepare Time Series Data for Econometric Modeler App**

Prepare time series data at the MATLAB command line, and then import the set into Econometric Modeler.**Import Time Series Data into Econometric Modeler App**

Import time series data from the MATLAB Workspace or a MAT-file into Econometric Modeler.**Plot Time Series Data Using Econometric Modeler App**

Interactively plot univariate and multivariate time series data, then interpret and interact with the plots.**Transform Time Series Using Econometric Modeler App**

Transform time series data interactively.**Analyze Time Series Data Using Econometric Modeler**

Interactively visualize and analyze univariate or multivariate time series data.

### Transform Time Series Data

**Nonseasonal Differencing**

Take a nonseasonal difference of a time series.**Nonseasonal and Seasonal Differencing**

Apply both nonseasonal and seasonal differencing using lag operator polynomial objects.**Econometric Modeling**

Understand model-selection techniques and Econometrics Toolbox features.**Stochastic Process Characteristics**

Understand the definition, forms, and properties of stochastic processes.**Data Transformations**

Determine which data transformations are appropriate for your problem.**Trend-Stationary vs. Difference-Stationary Processes**

Determine the characteristics of nonstationary processes.**Time Base Partitions for ARIMA Model Estimation**

When you fit a time series model to data, lagged terms in the model require initialization, usually with observations at the beginning of the sample.

### Decompose Time Series Data

**Decompose Time Series Into Additive Trend Components**

Estimate nonseasonal and seasonal trend components using parametric models.**Estimate Moving Average Trend Using Moving Average Filter**

This example shows how to estimate long-term trend using a symmetric moving average function.**Seasonal Filters**

You can use a seasonal filter (moving average) to estimate the seasonal component of a time series.**Seasonal Adjustment**

Seasonal adjustment is the process of removing a nuisance periodic component. The result of a seasonal adjustment is a deseasonalized time series.**Seasonal Adjustment Using a Stable Seasonal Filter**

Deseasonalize a time series using a stable seasonal filter.**Seasonal Adjustment Using S(n,m) Seasonal Filters**

Apply seasonal filters to deseasonalize a time series.**Use Hodrick-Prescott Filter to Reproduce Original Result**

Use the Hodrick-Prescott filter to decompose a time series.**Compare One-Sided and Two-Sided Hodrick-Prescott Filter Results**

Smooth the U.S. GDP by applying the one-sided and two-sided Hodrick-Prescott filters, and compare the resulting smoothed trends.**Compare Hodrick-Prescott Filter Formulations**

Compare two formulations of the Hodrick-Prescott filter: the closed-form solution of the programming problem and its state-space formulation, with a focus on how each formulation addresses missing observations.

### Plot Recession Periods with Time Series Data

**Compare Recession Indicators**

Analyze time-varying local trends in carbon emissions data by building dynamic state-space models from series for coal, gas, and oil.

### Lag Operator Polynomial Operations

**Specify Lag Operator Polynomials**

Create lag operator polynomial objects.