MATLAB Examples

Inspect a squared residual series for autocorrelation by plotting the sample autocorrelation function (ACF) and partial autocorrelation function (PACF). Then, conduct a Ljung-Box

Assess whether a time series is a random walk. It uses market data for daily returns of stocks and cash (money market) from the period January 1, 2000 to November 7, 2005.

Do goodness of fit checks. Residual diagnostic plots help verify model assumptions, and cross-validation prediction checks help assess predictive performance. The time series is

Conduct the Ljung-Box Q-test for autocorrelation.

Test a univariate time series for a unit root. It uses wages data (1900-1970) in the manufacturing sector. The series is in the Nelson-Plosser data set.

Specify a composite conditional mean and variance model using arima .

Conduct a likelihood ratio test to choose the number of lags in a GARCH model.

Calculate the required inputs for conducting a Lagrange multiplier (LM) test with lmtest . The LM test compares the fit of a restricted model against an unrestricted model by testing whether

Check whether a linear time series is a unit root process in several ways. You can assess unit root nonstationarity statistically, visually, and algebraically.

Conduct Engle's ARCH test for conditional heteroscedasticity.

Compare two competing, conditional variance models using a likelihood ratio test.

Calculate the required inputs for conducting a Wald test with waldtest . The Wald test compares the fit of a restricted model against an unrestricted model by testing whether the restriction

Test univariate time series models for stationarity. It shows how to simulate data from four types of models: trend stationary, difference stationary, stationary (AR(1)), and a

Check the model assumptions for a Chow test. The model is of U.S. gross domestic product (GDP), with consumer price index (CPI) and paid compensation of employees (COE) as predictors. The

Estimate the power of a Chow test using a Monte Carlo simulation.

Select statistically significant predictor histories for multiple linear regression models. It is the ninth in a series of examples on time series regression, following the presentation

Detect correlation among predictors and accommodate problems of large estimator variance. It is the second in a series of examples on time series regression, following the presentation in

Illustrates the use of a vector error-correction (VEC) model as a linear alternative to the Smets-Wouters Dynamic Stochastic General Equilibrium (DSGE) macroeconomic model, and applies

Introduces basic assumptions behind multiple linear regression models. It is the first in a series of examples on time series regression, providing the basis for all subsequent examples.

Choose the state-space model specification with the best predictive performance using a rolling window. A rolling window analysis for an explicitly defined state-space model is

Estimate multiple linear regression models of time series data in the presence of heteroscedastic or autocorrelated (nonspherical) innovations. It is the tenth in a series of examples on

Evaluate model assumptions and investigate respecification opportunities by examining the series of residuals. It is the sixth in a series of examples on time series regression,

The use of the likelihood ratio, Wald, and Lagrange multiplier tests. These tests are useful in the evaluation and assessment of model restrictions and, ultimately, the selection of a model

Change the bandwidth when estimating a HAC coefficient covariance, and compare estimates over varying bandwidths and kernels.

Plot heteroscedastic-and-autocorrelation consistent (HAC) corrected confidence bands using Newey-West robust standard errors.

Use the Box-Jenkins methodology to select an ARIMA model. The time series is the log quarterly Australian Consumer Price Index (CPI) measured from 1972 and 1991.

Use the Bayesian information criterion (BIC) to select the degrees p and q of an ARMA model. Estimate several models with different p and q values. For each estimated model, output the

Infer conditional variances from a fitted conditional variance model. Standardized residuals are computed using the inferred conditional variances to check the model fit.

Specify and fit a GARCH, EGARCH, and GJR model to foreign exchange rate returns. Compare the fits using AIC and BIC.

Infer residuals from a fitted ARIMA model. Diagnostic checks are performed on the residuals to assess model fit.

Compute the sample autocorrelation function (ACF) and partial autocorrelation function (PACF) to qualitatively assess autocorrelation.

The Engle-Granger method has several limitations. First of all, it identifies only a single cointegrating relation, among what might be many such relations. This requires one of the

Use a rolling window to check whether the parameters of a time-series model are time invariant. This example analyzes two time series:

Converts the polynomials of a VARMA model to a pure AR polynomial of a VAR model.

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Contact your local office