100% found this document useful (4 votes)
2K views59 pages

MATLAB Econometrics Toolbox User s Guide The Mathworks pdf download

The document is a user's guide for the Econometrics Toolbox by The MathWorks, detailing features, model objects, and data preprocessing techniques. It includes sections on econometric modeling, stochastic processes, and various data transformation methods. Additionally, it provides links to other MATLAB toolbox user guides and contact information for MathWorks support.

Uploaded by

kozulkoldahp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (4 votes)
2K views59 pages

MATLAB Econometrics Toolbox User s Guide The Mathworks pdf download

The document is a user's guide for the Econometrics Toolbox by The MathWorks, detailing features, model objects, and data preprocessing techniques. It includes sections on econometric modeling, stochastic processes, and various data transformation methods. Additionally, it provides links to other MATLAB toolbox user guides and contact information for MathWorks support.

Uploaded by

kozulkoldahp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 59

MATLAB Econometrics Toolbox User s Guide The

Mathworks download

https://textbookfull.com/product/matlab-econometrics-toolbox-
user-s-guide-the-mathworks/

Download more ebook from https://textbookfull.com


We believe these products will be a great fit for you. Click
the link to download now, or visit textbookfull.com
to discover even more!

MATLAB Bioinformatics Toolbox User s Guide The


Mathworks

https://textbookfull.com/product/matlab-bioinformatics-toolbox-
user-s-guide-the-mathworks/

MATLAB Mapping Toolbox User s Guide The Mathworks

https://textbookfull.com/product/matlab-mapping-toolbox-user-s-
guide-the-mathworks/

MATLAB Optimization Toolbox User s Guide The Mathworks

https://textbookfull.com/product/matlab-optimization-toolbox-
user-s-guide-the-mathworks/

MATLAB Trading Toolbox User s Guide The Mathworks

https://textbookfull.com/product/matlab-trading-toolbox-user-s-
guide-the-mathworks/
MATLAB Computer Vision Toolbox User s Guide The
Mathworks

https://textbookfull.com/product/matlab-computer-vision-toolbox-
user-s-guide-the-mathworks/

MATLAB Curve Fitting Toolbox User s Guide The Mathworks

https://textbookfull.com/product/matlab-curve-fitting-toolbox-
user-s-guide-the-mathworks/

MATLAB Fuzzy Logic Toolbox User s Guide The Mathworks

https://textbookfull.com/product/matlab-fuzzy-logic-toolbox-user-
s-guide-the-mathworks/

MATLAB Global Optimization Toolbox User s Guide The


Mathworks

https://textbookfull.com/product/matlab-global-optimization-
toolbox-user-s-guide-the-mathworks/

MATLAB Image Processing Toolbox User s Guide The


Mathworks

https://textbookfull.com/product/matlab-image-processing-toolbox-
user-s-guide-the-mathworks/
Econometrics Toolbox™
User's Guide

R2020a
How to Contact MathWorks

Latest news: www.mathworks.com

Sales and services: www.mathworks.com/sales_and_services

User community: www.mathworks.com/matlabcentral

Technical support: www.mathworks.com/support/contact_us

Phone: 508-647-7000

The MathWorks, Inc.


1 Apple Hill Drive
Natick, MA 01760-2098
Econometrics Toolbox™ User's Guide
© COPYRIGHT 1999–2020 by The MathWorks, Inc.
The software described in this document is furnished under a license agreement. The software may be used or copied
only under the terms of the license agreement. No part of this manual may be photocopied or reproduced in any form
without prior written consent from The MathWorks, Inc.
FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentation by, for, or through
the federal government of the United States. By accepting delivery of the Program or Documentation, the government
hereby agrees that this software or documentation qualifies as commercial computer software or commercial computer
software documentation as such terms are used or defined in FAR 12.212, DFARS Part 227.72, and DFARS 252.227-7014.
Accordingly, the terms and conditions of this Agreement and only those rights specified in this Agreement, shall pertain
to and govern the use, modification, reproduction, release, performance, display, and disclosure of the Program and
Documentation by the federal government (or other entity acquiring for or through the federal government) and shall
supersede any conflicting contractual terms or conditions. If this License fails to meet the government's needs or is
inconsistent in any respect with federal procurement law, the government agrees to return the Program and
Documentation, unused, to The MathWorks, Inc.
Trademarks
MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See
www.mathworks.com/trademarks for a list of additional trademarks. Other product or brand names may be
trademarks or registered trademarks of their respective holders.
Patents
MathWorks products are protected by one or more U.S. patents. Please see www.mathworks.com/patents for
more information.
Revision History
October 2008 Online only Version 1.0 (Release 2008b)
March 2009 Online only Revised for Version 1.1 (Release 2009a)
September 2009 Online only Revised for Version 1.2 (Release 2009b)
March 2010 Online only Revised for Version 1.3 (Release 2010a)
September 2010 Online only Revised for Version 1.4 (Release 2010b)
April 2011 Online only Revised for Version 2.0 (Release 2011a)
September 2011 Online only Revised for Version 2.0.1 (Release 2011b)
March 2012 Online only Revised for Version 2.1 (Release 2012a)
September 2012 Online only Revised for Version 2.2 (Release 2012b)
March 2013 Online only Revised for Version 2.3 (Release 2013a)
September 2013 Online only Revised for Version 2.4 (Release 2013b)
March 2014 Online Only Revised for Version 3.0 (Release 2014a)
October 2014 Online Only Revised for Version 3.1 (Release 2014b)
March 2015 Online Only Revised for Version 3.2 (Release 2015a)
September 2015 Online Only Revised for Version 3.3 (Release 2015b)
March 2016 Online Only Revised for Version 3.4 (Release 2016a)
September 2016 Online Only Revised for Version 3.5 (Release 2016b)
March 2017 Online Only Revised for Version 4.0 (Release 2017a)
September 2017 Online Only Revised for Version 4.1 (Release 2017b)
March 2018 Online Only Revised for Version 5.0 (Release 2018a)
September 2018 Online Only Revised for Version 5.1 (Release 2018b)
March 2019 Online Only Revised for Version 5.2 (Release 2019a)
September 2019 Online Only Revised for Version 5.3 (Release 2019b)
March 2020 Online Only Revised for Version 5.4 (Release 2020a)
Contents

Getting Started
1
Econometrics Toolbox Product Description . . . . . . . . . . . . . . . . . . . . . . . . 1-2

Econometric Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3


Model Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
Econometrics Toolbox Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3

Econometrics Toolbox Model Objects, Properties, and Object Functions


.......................................................... 1-7
Model Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7
Model Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8
Specify Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-10
Retrieve Model Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-13
Modify Model Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-14
Object Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-15

Stochastic Process Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-16


What Is a Stochastic Process? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-16
Stationary Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-17
Linear Time Series Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-17
Unit Root Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-18
Lag Operator Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-19
Characteristic Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-20

Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-22

Data Preprocessing
2
Data Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Why Transform? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Common Data Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2

Trend-Stationary vs. Difference-Stationary Processes . . . . . . . . . . . . . . . . 2-6


Nonstationary Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6
Trend Stationary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7
Difference Stationary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7

Specify Lag Operator Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9


Lag Operator Polynomial of Coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9
Difference Lag Operator Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11

iii
Nonseasonal Differencing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-13

Nonseasonal and Seasonal Differencing . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16

Time Series Decomposition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-19

Moving Average Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-21

Moving Average Trend Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-22

Parametric Trend Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-25

Hodrick-Prescott Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-30

Using the Hodrick-Prescott Filter to Reproduce Their Original Result


......................................................... 2-31

Seasonal Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-35


What Is a Seasonal Filter? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-35
Stable Seasonal Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-35
Sn × m seasonal filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-36

Seasonal Adjustment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-38


What Is Seasonal Adjustment? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-38
Deseasonalized Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-38
Seasonal Adjustment Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-38

Seasonal Adjustment Using a Stable Seasonal Filter . . . . . . . . . . . . . . . . 2-40

Seasonal Adjustment Using S(n,m) Seasonal Filters . . . . . . . . . . . . . . . . 2-46

Model Selection
3
Box-Jenkins Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2

Box-Jenkins Model Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4

Autocorrelation and Partial Autocorrelation . . . . . . . . . . . . . . . . . . . . . . 3-11


What Are Autocorrelation and Partial Autocorrelation? . . . . . . . . . . . . . . 3-11
Theoretical ACF and PACF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11
Sample ACF and PACF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11

Ljung-Box Q-Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13

Detect Autocorrelation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15


Compute Sample ACF and PACF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15
Conduct the Ljung-Box Q-Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17

Engle’s ARCH Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20

iv Contents
Detect ARCH Effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-22
Test Autocorrelation of Squared Residuals . . . . . . . . . . . . . . . . . . . . . . . 3-22
Conduct Engle's ARCH Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-24

Unit Root Nonstationarity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-27


What Is a Unit Root Test? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-27
Modeling Unit Root Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-27
Available Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-28
Testing for Unit Roots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-30

Unit Root Tests . . . . . . . . . . . . . . . . . . ............................ 3-32


Test Simulated Data for a Unit Root ............................ 3-32
Test Time Series Data for Unit Root ............................ 3-37
Test Stock Data for a Random Walk ............................ 3-39

Assess Stationarity of a Time Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-42

Information Criteria . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-45

Model Comparison Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-46


Available Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-46
Likelihood Ratio Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-48
Lagrange Multiplier Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-48
Wald Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-48
Covariance Matrix Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-49

Conduct Lagrange Multiplier Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-50

Conduct Wald Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-53

Compare GARCH Models Using Likelihood Ratio Test . . . . . . . . . . . . . . . 3-55

Check Fit of Multiplicative ARIMA Model . . . . . . . . . . . . . . . . . . . . . . . . . 3-58

Goodness of Fit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-63

Residual Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-64


Check Residuals for Normality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-64
Check Residuals for Autocorrelation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-64
Check Residuals for Conditional Heteroscedasticity . . . . . . . . . . . . . . . . 3-64

Assess Predictive Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-66

Nonspherical Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-67


What Are Nonspherical Models? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-67

Plot a Confidence Band Using HAC Estimates . . . . . . . . . . . . . . . . . . . . . 3-68

Change the Bandwidth of a HAC Estimator . . . . . . . . . . . . . . . . . . . . . . . 3-75

Check Model Assumptions for Chow Test . . . . . . . . . . . . . . . . . . . . . . . . . 3-80

Power of the Chow Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-87

v
Econometric Modeler
4
Econometric Modeler App Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
Prepare Data for Econometric Modeler App . . . . . . . . . . . . . . . . . . . . . . . 4-3
Import Time Series Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
Perform Exploratory Data Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5
Fitting Models to Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-15
Conducting Goodness-of-Fit Checks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-23
Finding Model with Best In-Sample Fit . . . . . . . . . . . . . . . . . . . . . . . . . . 4-29
Export Session Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-30

Specifying Lag Operator Polynomials Interactively . . . . . . . . . . . . . . . . . 4-37


Specify Lag Structure Using Lag Order Tab . . . . . . . . . . . . . . . . . . . . . . 4-38
Specify Lag Structure Using Lag Vector Tab . . . . . . . . . . . . . . . . . . . . . . 4-40

Prepare Time Series Data for Econometric Modeler App . . . . . . . . . . . . 4-43


Prepare Table of Multivariate Data for Import . . . . . . . . . . . . . . . . . . . . . 4-43
Prepare Numeric Vector for Import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-44

Import Time Series Data into Econometric Modeler App . . . . . . . . . . . . 4-46


Import Data from MATLAB Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . 4-46
Import Data from MAT-File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-47

Plot Time Series Data Using Econometric Modeler App . . . . . . . . . . . . . 4-50


Plot Univariate Time Series Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-50
Plot Multivariate Time Series and Correlations . . . . . . . . . . . . . . . . . . . . 4-51

Detect Serial Correlation Using Econometric Modeler App . . . . . . . . . . 4-56


Plot ACF and PACF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-56
Conduct Ljung-Box Q-Test for Significant Autocorrelation . . . . . . . . . . . . 4-58

Detect ARCH Effects Using Econometric Modeler App . . . . . . . . . . . . . . 4-62


Inspect Correlograms of Squared Residuals for ARCH Effects . . . . . . . . . 4-62
Conduct Ljung-Box Q-Test on Squared Residuals . . . . . . . . . . . . . . . . . . 4-65
Conduct Engle's ARCH Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-67

Assess Stationarity of Time Series Using Econometric Modeler . . . . . . . 4-70


Test Assuming Unit Root Null Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-70
Test Assuming Stationary Null Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-73
Test Assuming Random Walk Null Model . . . . . . . . . . . . . . . . . . . . . . . . 4-77

Assess Collinearity Among Multiple Series Using Econometric Modeler


App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-81

Transform Time Series Using Econometric Modeler App . . . . . . . . . . . . 4-84


Apply Log Transformation to Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-84
Stabilize Time Series Using Nonseasonal Differencing . . . . . . . . . . . . . . 4-88
Convert Prices to Returns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-91
Remove Seasonal Trend from Time Series Using Seasonal Difference . . . 4-94
Remove Deterministic Trend from Time Series . . . . . . . . . . . . . . . . . . . . 4-97

Implement Box-Jenkins Model Selection and Estimation Using


Econometric Modeler App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-99

vi Contents
Select ARCH Lags for GARCH Model Using Econometric Modeler App
........................................................ 4-109

Estimate Multiplicative ARIMA Model Using Econometric Modeler App


........................................................ 4-118

Perform ARIMA Model Residual Diagnostics Using Econometric Modeler


App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-128

Specify t Innovation Distribution Using Econometric Modeler App . . . 4-137

Compare Predictive Performance After Creating Models Using


Econometric Modeler App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-141

Estimate ARIMAX Model Using Econometric Modeler App . . . . . . . . . . 4-148

Estimate Regression Model with ARMA Errors Using Econometric


Modeler App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-156

Compare Conditional Variance Model Fit Statistics Using Econometric


Modeler App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-170

Perform GARCH Model Residual Diagnostics Using Econometric Modeler


App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-179

Share Results of Econometric Modeler App Session . . . . . . . . . . . . . . . 4-186

Time Series Regression Models


5
Time Series Regression Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3

Regression Models with Time Series Errors . . . . . . . . . . . . . . . . . . . . . . . . 5-5


What Are Regression Models with Time Series Errors? . . . . . . . . . . . . . . . 5-5
Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5

Create Regression Models with ARIMA Errors . . . . . . . . . . . . . . . . . . . . . . 5-8


Default Regression Model with ARIMA Errors Specifications . . . . . . . . . . 5-8
Specify regARIMA Models Using Name-Value Pair Arguments . . . . . . . . . . 5-9
Specify Linear Regression Models Using Econometric Modeler App . . . . 5-15

Specify the Default Regression Model with ARIMA Errors . . . . . . . . . . . 5-19

Modify regARIMA Model Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-21


Modify Properties Using Dot Notation . . . . . . . . . . . . . . . . . . . . . . . . . . 5-21
Nonmodifiable Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-23

Create Regression Models with AR Errors . . . . . . . . . . . . . . . . . . . . . . . . 5-26


Default Regression Model with AR Errors . . . . . . . . . . . . . . . . . . . . . . . . 5-26
AR Error Model Without an Intercept . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-27
AR Error Model with Nonconsecutive Lags . . . . . . . . . . . . . . . . . . . . . . . 5-27

vii
Known Parameter Values for a Regression Model with AR Errors . . . . . . 5-28
Regression Model with AR Errors and t Innovations . . . . . . . . . . . . . . . . 5-29

Create Regression Models with MA Errors . . . . . . . . . . . . . . . . . . . . . . . . 5-31


Default Regression Model with MA Errors . . . . . . . . . . . . . . . . . . . . . . . 5-31
MA Error Model Without an Intercept . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-32
MA Error Model with Nonconsecutive Lags . . . . . . . . . . . . . . . . . . . . . . 5-32
Known Parameter Values for a Regression Model with MA Errors . . . . . . 5-33
Regression Model with MA Errors and t Innovations . . . . . . . . . . . . . . . . 5-34

Create Regression Models with ARMA Errors . . . . . . . . . . . . . . . . . . . . . . 5-36


Default Regression Model with ARMA Errors . . . . . . . . . . . . . . . . . . . . . 5-36
ARMA Error Model Without an Intercept . . . . . . . . . . . . . . . . . . . . . . . . 5-37
ARMA Error Model with Nonconsecutive Lags . . . . . . . . . . . . . . . . . . . . 5-37
Known Parameter Values for a Regression Model with ARMA Errors . . . . 5-38
Regression Model with ARMA Errors and t Innovations . . . . . . . . . . . . . 5-38
Specify Regression Model with ARMA Errors Using Econometric Modeler
App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-40

Create Regression Models with ARIMA Errors . . . . . . . . . . . . . . . . . . . . . 5-44


Default Regression Model with ARIMA Errors . . . . . . . . . . . . . . . . . . . . . 5-44
ARIMA Error Model Without an Intercept . . . . . . . . . . . . . . . . . . . . . . . . 5-45
ARIMA Error Model with Nonconsecutive Lags . . . . . . . . . . . . . . . . . . . . 5-45
Known Parameter Values for a Regression Model with ARIMA Errors . . . 5-46
Regression Model with ARIMA Errors and t Innovations . . . . . . . . . . . . . 5-47

Create Regression Models with SARIMA Errors . . . . . . . . . . . . . . . . . . . . 5-49


SARMA Error Model Without an Intercept . . . . . . . . . . . . . . . . . . . . . . . 5-49
Known Parameter Values for a Regression Model with SARIMA Errors . . 5-50
Regression Model with SARIMA Errors and t Innovations . . . . . . . . . . . . 5-50

Specify Regression Model with SARIMA Errors . . . . . . . . . . . . . . . . . . . . 5-53

Specify ARIMA Error Model Innovation Distribution . . . . . . . . . . . . . . . . 5-60


About the Innovation Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-60
Innovation Distribution Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-61
Specify Innovation Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-61

Impulse Response of Regression Models with ARIMA Errors . . . . . . . . . 5-65

Plot Impulse Response of Regression Model with ARIMA Errors . . . . . . 5-66


Regression Model with AR Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-66
Regression Model with MA Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-67
Regression Model with ARMA Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-68
Regression Model with ARIMA Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-70

Maximum Likelihood Estimation of regARIMA Models . . . . . . . . . . . . . . 5-73


Innovation Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-73
Loglikelihood Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-73

regARIMA Model Estimation Using Equality Constraints . . . . . . . . . . . . 5-75

Presample Values for regARIMA Model Estimation . . . . . . . . . . . . . . . . 5-109

Initial Values for regARIMA Model Estimation . . . . . . . . . . . . . . . . . . . . 5-111

viii Contents
Optimization Settings for regARIMA Model Estimation . . . . . . . . . . . . 5-113
Optimization Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-113
Constraints on Regression Models with ARIMA Errors . . . . . . . . . . . . . 5-115

Estimate a Regression Model with ARIMA Errors . . . . . . . . . . . . . . . . . 5-116

Estimate a Regression Model with Multiplicative ARIMA Errors . . . . . 5-123

Select Regression Model with ARIMA Errors . . . . . . . . . . . . . . . . . . . . . 5-131

Choose Lags for ARMA Error Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-133

Intercept Identifiability in Regression Models with ARIMA Errors . . . 5-137


Intercept Identifiability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-137
Intercept Identifiability Illustration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-138

Alternative ARIMA Model Representations . . . . . . . . . . . . . . . . . . . . . . . 5-141


regARIMA to ARIMAX Model Conversion . . . . . . . . . . . . . . . . . . . . . . . 5-141
Illustrate regARIMA to ARIMAX Model Conversion . . . . . . . . . . . . . . . . 5-142

Simulate Regression Models with ARMA Errors . . . . . . . . . . . . . . . . . . . 5-147


Simulate an AR Error Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-147
Simulate an MA Error Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-153
Simulate an ARMA Error Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-159

Simulate Regression Models with Nonstationary Errors . . . . . . . . . . . . 5-166


Simulate a Regression Model with Nonstationary Errors . . . . . . . . . . . 5-166
Simulate a Regression Model with Nonstationary Exponential Errors . . 5-169

Simulate Regression Models with Multiplicative Seasonal Errors . . . . 5-174


Simulate a Regression Model with Stationary Multiplicative Seasonal Errors
.................................................... 5-174
Untitled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-176

Monte Carlo Simulation of Regression Models with ARIMA Errors . . . 5-179


What Is Monte Carlo Simulation? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-179
Generate Monte Carlo Sample Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-179
Monte Carlo Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-180

Presample Data for regARIMA Model Simulation . . . . . . . . . . . . . . . . . 5-182

Transient Effects in regARIMA Model Simulations . . . . . . . . . . . . . . . . 5-183


What Are Transient Effects? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-183
Illustration of Transient Effects on Regression . . . . . . . . . . . . . . . . . . . 5-183

Forecast a Regression Model with ARIMA Errors . . . . . . . . . . . . . . . . . . 5-191

Forecast a Regression Model with Multiplicative Seasonal ARIMA Errors


........................................................ 5-194

Verify Predictive Ability Robustness of a regARIMA Model . . . . . . . . . . 5-198

MMSE Forecasting Regression Models with ARIMA Errors . . . . . . . . . 5-200


What Are MMSE Forecasts? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-200
How forecast Generates MMSE Forecasts . . . . . . . . . . . . . . . . . . . . . . 5-200

ix
Forecast Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-202

Monte Carlo Forecasting of regARIMA Models . . . . . . . . . . . . . . . . . . . . 5-203


Monte Carlo Forecasts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-203
Advantage of Monte Carlo Forecasts . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-203

Bayesian Linear Regression


6
Bayesian Linear Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
Classical Versus Bayesian Analyses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
Main Bayesian Analysis Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3
Posterior Estimation and Inference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4

Implement Bayesian Linear Regression . . . . . . . . . . . . . . . . . . . . . . . . . . 6-10


Workflow for Standard Bayesian Linear Regression Models . . . . . . . . . . 6-10
Workflow for Bayesian Predictor Selection . . . . . . . . . . . . . . . . . . . . . . . 6-13

Specify Gradient for HMC Sampler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-18

Posterior Estimation and Simulation Diagnostics . . . . . . . . . . . . . . . . . . 6-27


Diagnose MCMC Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-27
Perform Sensitivity Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-34

Tune Slice Sampler For Posterior Estimation . . . . . . . . . . . . . . . . . . . . . . 6-36

Compare Robust Regression Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . 6-43

Bayesian Lasso Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-52

Bayesian Stochastic Search Variable Selection . . . . . . . . . . . . . . . . . . . . 6-63

Replacing Removed Syntaxes of estimate . . . . . . . . . . . . . . . . . . . . . . . . . 6-73


Replace Removed Syntax When Estimating Analytical Marginal Posterior
..................................................... 6-74
Replace Removed Syntax When Estimating Numerical Marginal Posterior
..................................................... 6-75
Replace Removed Syntax When Estimating Conditional Posterior . . . . . . 6-77

Conditional Mean Models


7
Conditional Mean Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3
Unconditional vs. Conditional Mean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3
Static vs. Dynamic Conditional Mean Models . . . . . . . . . . . . . . . . . . . . . . 7-3
Conditional Mean Models for Stationary Processes . . . . . . . . . . . . . . . . . . 7-3

Specify Conditional Mean Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5


Default ARIMA Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5

x Contents
Specify Nonseasonal Models Using Name-Value Pairs . . . . . . . . . . . . . . . . 7-7
Specify Multiplicative Models Using Name-Value Pairs . . . . . . . . . . . . . . 7-11
Specify Conditional Mean Model Using Econometric Modeler App . . . . . 7-14

Autoregressive Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-17


AR(p) Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-17
Stationarity of the AR Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-17

AR Model Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-19


Default AR Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-19
AR Model with No Constant Term . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-19
AR Model with Nonconsecutive Lags . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-20
ARMA Model with Known Parameter Values . . . . . . . . . . . . . . . . . . . . . . 7-21
AR Model with t Innovation Distribution . . . . . . . . . . . . . . . . . . . . . . . . . 7-22
Specify AR Model Using Econometric Modeler App . . . . . . . . . . . . . . . . 7-22

Moving Average Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-26


MA(q) Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-26
Invertibility of the MA Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-26

MA Model Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-28


Default MA Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-28
MA Model with No Constant Term . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-28
MA Model with Nonconsecutive Lags . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-29
MA Model with Known Parameter Values . . . . . . . . . . . . . . . . . . . . . . . . 7-30
MA Model with t Innovation Distribution . . . . . . . . . . . . . . . . . . . . . . . . 7-31
Specify MA Model Using Econometric Modeler App . . . . . . . . . . . . . . . . 7-31

Autoregressive Moving Average Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-35


ARMA(p,q) Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-35
Stationarity and Invertibility of the ARMA Model . . . . . . . . . . . . . . . . . . 7-35

ARMA Model Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-37


Default ARMA Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-37
ARMA Model with No Constant Term . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-37
ARMA Model with Known Parameter Values . . . . . . . . . . . . . . . . . . . . . . 7-38
Specify ARMA Model Using Econometric Modeler App . . . . . . . . . . . . . . 7-39

ARIMA Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-42

ARIMA Model Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-44


Default ARIMA Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-44
ARIMA Model with Known Parameter Values . . . . . . . . . . . . . . . . . . . . . 7-45
Specify ARIMA Model Using Econometric Modeler App . . . . . . . . . . . . . 7-45

Multiplicative ARIMA Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-49

Multiplicative ARIMA Model Specifications . . . . . . . . . . . . . . . . . . . . . . . 7-51


Seasonal ARIMA Model with No Constant Term . . . . . . . . . . . . . . . . . . . 7-51
Seasonal ARIMA Model with Known Parameter Values . . . . . . . . . . . . . . 7-52
Specify Multiplicative ARIMA Model Using Econometric Modeler App . . 7-53

Specify Multiplicative ARIMA Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-58

xi
ARIMA Model Including Exogenous Covariates . . . . . . . . . . . . . . . . . . . . 7-62
ARIMAX(p,D,q) Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-62
Conventions and Extensions of the ARIMAX Model . . . . . . . . . . . . . . . . . 7-62

ARIMAX Model Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-64


Create ARIMAX Model Using Name-Value Pairs . . . . . . . . . . . . . . . . . . . 7-64
Specify ARMAX Model Using Dot Notation . . . . . . . . . . . . . . . . . . . . . . . 7-65
Specify ARIMAX or SARIMAX Model Using Econometric Modeler App . . 7-66

Modify Properties of Conditional Mean Model Objects . . . . . . . . . . . . . . 7-70


Dot Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-70
Nonmodifiable Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-73

Specify Conditional Mean Model Innovation Distribution . . . . . . . . . . . . 7-75


About the Innovation Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-75
Choices for the Variance Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-75
Choices for the Innovation Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . 7-75
Specify the Innovation Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-76
Modify the Innovation Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-78

Specify Conditional Mean and Variance Models . . . . . . . . . . . . . . . . . . . . 7-80

Impulse Response Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-84

Plot the Impulse Response Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-85


Moving Average Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-85
Autoregressive Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-86
ARMA Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-87

Box-Jenkins Differencing vs. ARIMA Estimation . . . . . . . . . . . . . . . . . . . 7-89

Maximum Likelihood Estimation for Conditional Mean Models . . . . . . . 7-92


Innovation Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-92
Loglikelihood Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-92

Conditional Mean Model Estimation with Equality Constraints . . . . . . . 7-94

Presample Data for Conditional Mean Model Estimation . . . . . . . . . . . . 7-95

Initial Values for Conditional Mean Model Estimation . . . . . . . . . . . . . . 7-97

Optimization Settings for Conditional Mean Model Estimation . . . . . . . 7-99


Optimization Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-99
Conditional Mean Model Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . 7-101

Estimate Multiplicative ARIMA Model . . . . . . . . . . . . . . . . . . . . . . . . . . 7-102

Model Seasonal Lag Effects Using Indicator Variables . . . . . . . . . . . . . 7-105

Forecast IGD Rate from ARX Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-109

Estimate Conditional Mean and Variance Model . . . . . . . . . . . . . . . . . . 7-115

Choose ARMA Lags Using BIC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-120

xii Contents
Infer Residuals for Diagnostic Checking . . . . . . . . . . . . . . . . . . . . . . . . . 7-123

Monte Carlo Simulation of Conditional Mean Models . . . . . . . . . . . . . . 7-128


What Is Monte Carlo Simulation? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-128
Generate Monte Carlo Sample Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-128
Monte Carlo Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-129

Presample Data for Conditional Mean Model Simulation . . . . . . . . . . . 7-130

Transient Effects in Conditional Mean Model Simulations . . . . . . . . . . 7-131

Simulate Stationary Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-132


Simulate AR Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-132
Simulate MA Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-136

Simulate Trend-Stationary and Difference-Stationary Processes . . . . . 7-140

Simulate Multiplicative ARIMA Models . . . . . . . . . . . . . . . . . . . . . . . . . 7-144

Simulate Conditional Mean and Variance Models . . . . . . . . . . . . . . . . . 7-147

Monte Carlo Forecasting of Conditional Mean Models . . . . . . . . . . . . . 7-151


Monte Carlo Forecasts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-151
Advantage of Monte Carlo Forecasting . . . . . . . . . . . . . . . . . . . . . . . . . 7-151

MMSE Forecasting of Conditional Mean Models . . . . . . . . . . . . . . . . . . 7-152


What Are MMSE Forecasts? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-152
How forecast Generates MMSE Forecasts . . . . . . . . . . . . . . . . . . . . . . 7-152
Forecast Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-153

Convergence of AR Forecasts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-155

Forecast Multiplicative ARIMA Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-159

Specify Presample and Forecast Period Data To Forecast ARIMAX Model


........................................................ 7-162

Forecast Conditional Mean and Variance Model . . . . . . . . . . . . . . . . . . . 7-166

Model and Simulate Electricity Spot Prices Using the Skew-Normal


Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-169

Conditional Variance Models


8
Conditional Variance Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2
General Conditional Variance Model Definition . . . . . . . . . . . . . . . . . . . . . 8-2
GARCH Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3
EGARCH Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3
GJR Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4

xiii
Specify GARCH Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-6
Default GARCH Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-6
Specify Default GARCH Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7
Using Name-Value Pair Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-8
Specify GARCH Model Using Econometric Modeler App . . . . . . . . . . . . . 8-11
Specify GARCH Model with Mean Offset . . . . . . . . . . . . . . . . . . . . . . . . . 8-13
Specify GARCH Model with Known Parameter Values . . . . . . . . . . . . . . . 8-14
Specify GARCH Model with t Innovation Distribution . . . . . . . . . . . . . . . 8-14
Specify GARCH Model with Nonconsecutive Lags . . . . . . . . . . . . . . . . . . 8-15

Specify EGARCH Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-17


Default EGARCH Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-17
Specify Default EGARCH Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-19
Using Name-Value Pair Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-19
Specify EGARCH Model Using Econometric Modeler App . . . . . . . . . . . . 8-22
Specify EGARCH Model with Mean Offset . . . . . . . . . . . . . . . . . . . . . . . . 8-24
Specify EGARCH Model with Nonconsecutive Lags . . . . . . . . . . . . . . . . . 8-24
Specify EGARCH Model with Known Parameter Values . . . . . . . . . . . . . . 8-25
Specify EGARCH Model with t Innovation Distribution . . . . . . . . . . . . . . 8-26

Specify GJR Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-28


Default GJR Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-28
Specify Default GJR Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-29
Using Name-Value Pair Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-30
Specify GJR Model Using Econometric Modeler App . . . . . . . . . . . . . . . . 8-33
Specify GJR Model with Mean Offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-35
Specify GJR Model with Nonconsecutive Lags . . . . . . . . . . . . . . . . . . . . . 8-35
Specify GJR Model with Known Parameter Values . . . . . . . . . . . . . . . . . . 8-36
Specify GJR Model with t Innovation Distribution . . . . . . . . . . . . . . . . . . 8-37

Modify Properties of Conditional Variance Models . . . . . . . . . . . . . . . . . 8-39


Dot Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-39
Nonmodifiable Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-41

Specify the Conditional Variance Model Innovation Distribution . . . . . . 8-44

Specify Conditional Variance Model For Exchange Rates . . . . . . . . . . . . 8-47

Maximum Likelihood Estimation for Conditional Variance Models . . . . 8-52


Innovation Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-52
Loglikelihood Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-52

Conditional Variance Model Estimation with Equality Constraints . . . . 8-54

Presample Data for Conditional Variance Model Estimation . . . . . . . . . . 8-55

Initial Values for Conditional Variance Model Estimation . . . . . . . . . . . . 8-57

Optimization Settings for Conditional Variance Model Estimation . . . . 8-58


Optimization Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-58
Conditional Variance Model Constraints . . . . . . . . . . . . . . . . . . . . . . . . . 8-60

Infer Conditional Variances and Residuals . . . . . . . . . . . . . . . . . . . . . . . . 8-62

Likelihood Ratio Test for Conditional Variance Models . . . . . . . . . . . . . . 8-66

xiv Contents
Compare Conditional Variance Models Using Information Criteria . . . . 8-69

Monte Carlo Simulation of Conditional Variance Models . . . . . . . . . . . . 8-72


What Is Monte Carlo Simulation? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-72
Generate Monte Carlo Sample Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-72
Monte Carlo Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-73

Presample Data for Conditional Variance Model Simulation . . . . . . . . . . 8-75

Simulate GARCH Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-76

Assess EGARCH Forecast Bias Using Simulations . . . . . . . . . . . . . . . . . . 8-81

Simulate Conditional Variance Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-86

Monte Carlo Forecasting of Conditional Variance Models . . . . . . . . . . . . 8-89


Monte Carlo Forecasts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-89
Advantage of Monte Carlo Forecasting . . . . . . . . . . . . . . . . . . . . . . . . . . 8-89

MMSE Forecasting of Conditional Variance Models . . . . . . . . . . . . . . . . . 8-90


What Are MMSE Forecasts? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-90
EGARCH MMSE Forecasts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-90
How forecast Generates MMSE Forecasts . . . . . . . . . . . . . . . . . . . . . . . 8-90

Forecast GJR Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-94

Forecast a Conditional Variance Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-97

Converting from GARCH Functions to Model Objects . . . . . . . . . . . . . . . 8-99

Multivariate Time Series Models


9
Vector Autoregression (VAR) Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3
Types of Stationary Multivariate Time Series Models . . . . . . . . . . . . . . . . 9-3
Lag Operator Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-5
Stable and Invertible Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-6
Models with Regression Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-6
VAR Model Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-7

Multivariate Time Series Data Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-10


Multivariate Time Series Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-10
Load Multivariate Economic Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-10
Multivariate Data Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-12
Preprocess Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-14
Time Base Partitions for Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-15
Partition Multivariate Time Series Data for Estimation . . . . . . . . . . . . . . 9-17

Vector Autoregression (VAR) Model Creation . . . . . . . . . . . . . . . . . . . . . . 9-19


Create VAR Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-19
Fully Specified Model Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-20
Model Template for Unrestricted Estimation . . . . . . . . . . . . . . . . . . . . . . 9-22

xv
Partially Specified Model Object for Restricted Estimation . . . . . . . . . . . 9-23
Display and Change Model Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-23
Select Appropriate Lag Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-26

Create and Adjust VAR Model Using Shorthand Syntax . . . . . . . . . . . . . . 9-29

Create and Adjust VAR Model Using Longhand Syntax . . . . . . . . . . . . . . 9-31

VAR Model Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-33


Preparing VAR Models for Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-33
Fitting Models to Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-33
Examining the Stability of a Fitted Model . . . . . . . . . . . . . . . . . . . . . . . . 9-34

Convert VARMA Model to VAR Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-36

Fit VAR Model of CPI and Unemployment Rate . . . . . . . . . . . . . . . . . . . . 9-37

Fit VAR Model to Simulated Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-41

VAR Model Forecasting, Simulation, and Analysis . . . . . . . . . . . . . . . . . . 9-43


VAR Model Forecasting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-43
Data Scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-45
Calculating Impulse Responses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-45

Generate VAR Model Impulse Responses . . . . . . . . . . . . . . . . . . . . . . . . . 9-47

Compare Generalized and Orthogonalized Impulse Response Functions


......................................................... 9-51

Forecast VAR Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-59

Forecast VAR Model Using Monte Carlo Simulation . . . . . . . . . . . . . . . . 9-62

Forecast VAR Model Conditional Responses . . . . . . . . . . . . . . . . . . . . . . . 9-65

Implement Seemingly Unrelated Regression . . . . . . . . . . . . . . . . . . . . . . 9-69

Estimate Capital Asset Pricing Model Using SUR . . . . . . . . . . . . . . . . . . 9-74

Simulate Responses of Estimated VARX Model . . . . . . . . . . . . . . . . . . . . 9-77

Simulate VAR Model Conditional Responses . . . . . . . . . . . . . . . . . . . . . . 9-84

Simulate Responses Using filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-88

VAR Model Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-90

Convert from vgx Functions to Model Objects . . . . . . . . . . . . . . . . . . . . 9-104

Cointegration and Error Correction Analysis . . . . . . . . . . . . . . . . . . . . . 9-107


Integration and Cointegration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-107
Cointegration and Error Correction . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-107
The Role of Deterministic Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-108
Cointegration Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-109

xvi Contents
Determine Cointegration Rank of VEC Model . . . . . . . . . . . . . . . . . . . . 9-111

Identifying Single Cointegrating Relations . . . . . . . . . . . . . . . . . . . . . . . 9-113


The Engle-Granger Test for Cointegration . . . . . . . . . . . . . . . . . . . . . . . 9-113
Limitations of the Engle-Granger Test . . . . . . . . . . . . . . . . . . . . . . . . . . 9-113

Test for Cointegration Using the Engle-Granger Test . . . . . . . . . . . . . . 9-116

Estimate VEC Model Parameters Using egcitest . . . . . . . . . . . . . . . . . . 9-120

VEC Model Monte Carlo Forecasts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-123

Generate VEC Model Impulse Responses . . . . . . . . . . . . . . . . . . . . . . . . 9-131

Identifying Multiple Cointegrating Relations . . . . . . . . . . . . . . . . . . . . . 9-135

Test for Cointegration Using the Johansen Test . . . . . . . . . . . . . . . . . . . 9-136

Estimate VEC Model Parameters Using jcitest . . . . . . . . . . . . . . . . . . . . 9-138

Compare Approaches to Cointegration Analysis . . . . . . . . . . . . . . . . . . . 9-141

Testing Cointegrating Vectors and Adjustment Speeds . . . . . . . . . . . . . 9-144

Test Cointegrating Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-145

Test Adjustment Speeds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-147

Structural Change Models


10
Discrete-Time Markov Chains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2
What Are Discrete-Time Markov Chains? . . . . . . . . . . . . . . . . . . . . . . . . 10-2
Discrete-Time Markov Chain Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-3

Markov Chain Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-8


Discrete-Time Markov Chain Object Framework Overview . . . . . . . . . . . 10-8
Markov Chain Analysis Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-11

Create and Modify Markov Chain Model Objects . . . . . . . . . . . . . . . . . . 10-17


Create Markov Chain from Stochastic Transition Matrix . . . . . . . . . . . . 10-17
Create Markov Chain from Random Transition Matrix . . . . . . . . . . . . . 10-19
Specify Structure for Random Markov Chain . . . . . . . . . . . . . . . . . . . . 10-20

Work with State Transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-23

Visualize Markov Chain Structure and Evolution . . . . . . . . . . . . . . . . . . 10-27

Determine Asymptotic Behavior of Markov Chain . . . . . . . . . . . . . . . . . 10-39

Identify Classes in Markov Chain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-47

xvii
Compare Markov Chain Mixing Times . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-50

Simulate Random Walks Through Markov Chain . . . . . . . . . . . . . . . . . . 10-59

Compute State Distribution of Markov Chain at Each Time Step . . . . . 10-66

State-Space Models
11
What Are State-Space Models? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-3
Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-3
State-Space Model Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-5

What Is the Kalman Filter? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-7


Standard Kalman Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-7
State Forecasts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-8
Filtered States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-8
Smoothed States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-9
Smoothed State Disturbances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-9
Forecasted Observations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-10
Smoothed Observation Innovations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-10
Kalman Gain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-11
Backward Recursion of the Kalman Filter . . . . . . . . . . . . . . . . . . . . . . . 11-11
Diffuse Kalman Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-12

Explicitly Create State-Space Model Containing Known Parameter Values


........................................................ 11-13

Create State-Space Model with Unknown Parameters . . . . . . . . . . . . . . 11-15


Explicitly Create State-Space Model Containing Unknown Parameters
.................................................... 11-15
Implicitly Create Time-Invariant State-Space Model . . . . . . . . . . . . . . . 11-16

Create State-Space Model Containing ARMA State . . . . . . . . . . . . . . . . 11-18

Implicitly Create State-Space Model Containing Regression Component


........................................................ 11-21

Implicitly Create Diffuse State-Space Model Containing Regression


Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-23

Implicitly Create Time-Varying State-Space Model . . . . . . . . . . . . . . . . 11-25

Implicitly Create Time-Varying Diffuse State-Space Model . . . . . . . . . . 11-27

Create State-Space Model with Random State Coefficient . . . . . . . . . . 11-30

Estimate Time-Invariant State-Space Model . . . . . . . . . . . . . . . . . . . . . . 11-32

Estimate Time-Varying State-Space Model . . . . . . . . . . . . . . . . . . . . . . . 11-35

xviii Contents
Estimate Time-Varying Diffuse State-Space Model . . . . . . . . . . . . . . . . . 11-39

Estimate State-Space Model Containing Regression Component . . . . . 11-43

Filter States of State-Space Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-45

Filter Time-Varying State-Space Model . . . . . . . . . . . . . . . . . . . . . . . . . . 11-48

Filter Time-Varying Diffuse State-Space Model . . . . . . . . . . . . . . . . . . . 11-53

Filter States of State-Space Model Containing Regression Component


........................................................ 11-59

Smooth States of State-Space Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-62

Smooth Time-Varying State-Space Model . . . . . . . . . . . . . . . . . . . . . . . . 11-65

Smooth Time-Varying Diffuse State-Space Model . . . . . . . . . . . . . . . . . . 11-71

Smooth States of State-Space Model Containing Regression Component


........................................................ 11-77

Simulate States and Observations of Time-Invariant State-Space Model


........................................................ 11-80

Simulate Time-Varying State-Space Model . . . . . . . . . . . . . . . . . . . . . . . 11-83

Simulate States of Time-Varying State-Space Model Using Simulation


Smoother . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-87

Estimate Random Parameter of State-Space Model . . . . . . . . . . . . . . . . 11-90

Forecast State-Space Model Using Monte-Carlo Methods . . . . . . . . . . . 11-97

Forecast State-Space Model Observations . . . . . . . . . . . . . . . . . . . . . . 11-103

Forecast Observations of State-Space Model Containing Regression


Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-106

Forecast Time-Varying State-Space Model . . . . . . . . . . . . . . . . . . . . . . 11-110

Forecast State-Space Model Containing Regime Change in the Forecast


Horizon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-114

Forecast Time-Varying Diffuse State-Space Model . . . . . . . . . . . . . . . . 11-119

Compare Simulation Smoother to Smoothed States . . . . . . . . . . . . . . 11-123

Rolling-Window Analysis of Time-Series Models . . . . . . . . . . . . . . . . . 11-128


Rolling-Window Analysis for Parameter Stability . . . . . . . . . . . . . . . . . 11-128
Rolling Window Analysis for Predictive Performance . . . . . . . . . . . . . . 11-128

Assess State-Space Model Stability Using Rolling Window Analysis . 11-131


Assess Model Stability Using Rolling Window Analysis . . . . . . . . . . . . 11-131

xix
Assess Stability of Implicitly Created State-Space Model . . . . . . . . . . 11-134

Choose State-Space Model Specification Using Backtesting . . . . . . . . 11-138

Functions
12

Appendices
A
Data Sets and Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-2

Glossary

xx Contents
1

Getting Started

• “Econometrics Toolbox Product Description” on page 1-2


• “Econometric Modeling” on page 1-3
• “Econometrics Toolbox Model Objects, Properties, and Object Functions” on page 1-7
• “Stochastic Process Characteristics” on page 1-16
• “Bibliography” on page 1-22
1 Getting Started

Econometrics Toolbox Product Description


Model and analyze financial and economic systems using statistical methods

Econometrics Toolbox provides functions for modeling and analyzing time series data. It offers a wide
range of diagnostic tests for model selection, including tests for impulse analysis, unit roots and
stationarity, cointegration, and structural change. You can estimate, simulate, and forecast economic
systems using a variety of models, including, regression, ARIMA, state space, GARCH, multivariate
VAR and VEC, and switching models representing dynamic shifts in data. The toolbox also provides
Bayesian and Markov-based tools for developing time-varying models that learn from new data.

1-2
Econometric Modeling

Econometric Modeling
In this section...
“Model Selection” on page 1-3
“Econometrics Toolbox Features” on page 1-3

Model Selection
A probabilistic time series model is necessary for a wide variety of analysis goals, including
regression inference, forecasting, and Monte Carlo simulation. When selecting a model, aim to find
the most parsimonious model that adequately describes your data. A simple model is easier to
estimate, forecast, and interpret.

• Specification tests help you identify one or more model families that could plausibly describe the
data generating process.
• Model comparisons help you compare the fit of competing models, with penalties for complexity.
• Goodness-of-fit checks help you assess the in-sample adequacy of your model, verify that all model
assumptions hold, and evaluate out-of-sample forecast performance.

Model selection is an iterative process. When goodness-of-fit checks suggest model assumptions are
not satisfied—or the predictive performance of the model is not satisfactory—consider making model
adjustments. Additional specification tests, model comparisons, and goodness-of-fit checks help guide
this process.

Econometrics Toolbox Features


Modeling Features Related Functions
Questions
What is the • The conditional mean and variance models, regression • arima
dimension of my models with ARIMA errors, and Bayesian linear regression • bayeslm
response variable? models in this toolbox are for modeling univariate,
discrete-time data. • egarch

• Separate models are available for multivariate, discrete- • egcitest


time data, such as VAR and VEC models. • dssm
• State-space models support univariate or multivariate • garch
response variables. • gjr
• jcontest
• regARIMA
• ssm
• varm
Is my time series • Stationarity tests are available. If your data is not • arima
stationary? stationary, consider transforming your data. Stationarity is • i10test
the foundation of many time series models.
• kpsstest
• Or, consider using a nonstationary ARIMA model if there
is evidence of a unit root in your data. • lmctest

1-3
1 Getting Started

Modeling Features Related Functions


Questions
Does my time series • Unit root tests are available. Evidence in favor of a unit • adftest
have a unit root? root suggests your data is difference stationary. • arima
• You can difference a series with a unit root until it is • i10test
stationary, or model it using a nonstationary ARIMA
model. • pptest
• vratiotest
How can I handle • You can deseasonalize (seasonally adjust) your data. Use • arima
seasonal effects? seasonal filters or regression models to estimate the • regARIMA
seasonal component.
• Seasonal ARIMA models use seasonal differencing to
remove seasonal effects. You can also include seasonal
lags to model seasonal autocorrelation (both additively
and multiplicatively).
Is my data • Sample autocorrelation and partial autocorrelation • arima
autocorrelated? functions help identify autocorrelation. • autocorr
• Conduct a Ljung-Box Q-test to test autocorrelations at • fgls
several lags jointly.
• hac
• If autocorrelation is present, consider using a conditional
mean model. • lbqtest

• For regression models with autocorrelated errors, • parcorr


consider using FGLS or HAC estimators. If the error • regARIMA
model structure is an ARIMA model, consider using a
regression model with ARIMA errors.
What if my data is • Looking for autocorrelation in the squared residual series • archtest
heteroscedastic is one way to detect conditional heteroscedasticity. • egarch
(exhibits volatility • Engle’s ARCH test evaluates evidence against the null of • fgls
clustering)? independent innovations in favor of an ARCH model
alternative. • garch

• To model conditional heteroscedasticity, consider using a • gjr


conditional variance model. • hac
• For regression models that exhibit heteroscedastic errors,
consider using FGLS or HAC estimators.
Is there an • You can use a Student’s t distribution to model fatter tails • arima
alternative to a than a Gaussian distribution (excess kurtosis). • egarch
Gaussian innovation • You can specify a t innovation distribution for all
distribution for • garch
conditional mean and variance models, and ARIMA error
leptokurtic data? models in Econometrics Toolbox. • gjr

• You can estimate the degrees of freedom of the t • regARIMA


distribution along with other model parameters.

1-4
Econometric Modeling

Modeling Features Related Functions


Questions
How do I decide • You can compare nested models using misspecification • aicbic
between several tests, such as the likelihood ratio test, Wald’s test, or • lmtest
model fits? Lagrange multiplier test.
• lratiotest
• Information criteria, such as AIC or BIC, compare model
fit with a penalty for complexity. • waldtest
Do I have two or • The Johansen and Engle-Granger cointegration tests • egcitest
more time series that assess evidence of cointegration. • jcitest
are cointegrated? • Consider using the VEC model for modeling multivariate, • jcontest
cointegrated series.
• Also consider cointegration when regressing time series.
If present, it can introduce spurious regression effects.
What if I want to • ARIMAX, VARX, regression models with ARIMA errors, • arima
include predictor and Bayesian linear regression models are available in • bayeslm
variables? this toolbox.
• dssm
• State-space models support predictor data.
• ssm
• regARIMA
• varm
What if I want to • Regression models with ARIMA errors are available in this • bayeslm
implement toolbox. • fgls
regression, but the • Regress robustly using FGLS or HAC estimators.
classical linear • hac
model assumptions • Use Bayesian linear regression. • mvregress
might not apply? • For a series of examples on time series regression • regARIMA
techniques that illustrate common principles and tasks in
time series regression modeling, see Econometrics
Toolbox Examples.
• For more regression options, see Statistics and Machine
Learning Toolbox™ documentation.
What if observations Standard, linear state-space modeling is available in this • dssm
of a dynamic process toolbox. • ssm
include
measurement error?

See Also

Related Examples
• “Box-Jenkins Model Selection” on page 3-4
• “Detect Autocorrelation” on page 3-15
• “Detect ARCH Effects” on page 3-22
• “Unit Root Tests” on page 3-32
• “Time Series Regression I: Linear Models”

1-5
1 Getting Started

• “Time Series Regression II: Collinearity and Estimator Variance”


• “Time Series Regression III: Influential Observations”
• “Time Series Regression IV: Spurious Regression”
• “Time Series Regression V: Predictor Selection”
• “Time Series Regression VI: Residual Diagnostics”
• “Time Series Regression VII: Forecasting”
• “Time Series Regression VIII: Lagged Variables and Estimator Bias”
• “Time Series Regression IX: Lag Order Selection”
• “Time Series Regression X: Generalized Least Squares and HAC Estimators”

More About
• “Trend-Stationary vs. Difference-Stationary Processes” on page 2-6
• “Box-Jenkins Methodology” on page 3-2
• “Goodness of Fit” on page 3-63
• “Regression Models with Time Series Errors” on page 5-5
• “Nonspherical Models” on page 3-67
• “Conditional Mean Models” on page 7-3
• “Conditional Variance Models” on page 8-2
• “Vector Autoregression (VAR) Models” on page 9-3
• “Cointegration and Error Correction Analysis” on page 9-107

1-6
Econometrics Toolbox Model Objects, Properties, and Object Functions

Econometrics Toolbox Model Objects, Properties, and Object


Functions
In this section...
“Model Objects” on page 1-7
“Model Properties” on page 1-8
“Specify Models” on page 1-10
“Retrieve Model Properties” on page 1-13
“Modify Model Properties” on page 1-14
“Object Functions” on page 1-15

Model Objects
After you have a potential model for your data, you must specify the model to MATLAB® to proceed
with your analysis. Econometrics Toolbox has model objects for storing discrete-time econometric
models.

For univariate series, the available model objects are:

• arima — for integrated, autoregressive, moving average (ARIMA) models optionally containing
exogenous predictor variables
• garch — for generalized autoregressive conditional heteroscedasticity models (GARCH)
• egarch — for exponential GARCH models
• gjr — for Glosten-Jagannathan-Runkle models
• regARIMA — for regression models with ARIMA errors

For multivariate series, the available model objects are:

• varm — for vector autoregression models optionally containing exogenous predictor variables
• vecm — for vector error-correction (cointegrated VARM) models optionally containing exogenous
predictor variables

Econometrics Toolbox supports univariate Bayesian linear regression analysis. Bayesian linear
regression model objects specify the joint prior distribution of the regression coefficients and
disturbance variance. The available prior model objects are:

• conjugateblm — for the normal-inverse-gamma conjugate prior model. The regression


coefficients and disturbance variance are dependent random variables.
• semiconjugateblm — for the normal-inverse-gamma semiconjugate prior model. The regression
coefficients and disturbance variance are independent random variables.
• diffuseblm — the joint prior distribution is proportional to the inverse of the disturbance
variance.
• empiricalblm — the joint prior distribution is specified by a random sample from the joint
posterior distribution.
• customblm — the joint prior distribution is specified in a custom function that you declare.

To perform Bayesian variable selection, available prior model objects are:

1-7
1 Getting Started

• mixconjugateblm — for performing stochastic search variable selection (SSVS). The regression
coefficients and disturbance variance are dependent random variables (the prior and posterior
distributions are conjugate).
• mixsemiconjugateblm — for performing SSVS. The regression coefficients and disturbance
variance are independent random variables (the prior and posterior distributions are
semiconjugate).
• lassoblm — for performing Bayesian lasso regression.

Econometrics Toolbox supports modelling and analyzing discrete or continuous state Markov models.
Available model objects are:

• dtmc — for discrete-time Markov chain models characterized by transition matrices.


• ssm — for continuous, multivariate state-space models optionally containing exogenous predictor
variables
• dssm — for continuous, multivariate state-space models with diffuse initial states optionally
containing exogenous predictor variables

To create a model object, specify the form of your model to one of the model functions (e.g., arima or
garch). The function creates the model object of the corresponding type in the MATLAB workspace,
as shown in the figure.

You can work with model objects as you would with any other variable in MATLAB. For example, you
can assign the object variable a name, view it in the MATLAB Workspace, and display its value in the
Command Window by typing its name.

This image shows a workspace containing an arima model named Mdl.

Model Properties
A model object holds all the information necessary to estimate, simulate, and forecast econometric
models. This information includes the:

• Parametric form of the model


• Number of model parameters (e.g., the degree of the model)

1-8
Econometrics Toolbox Model Objects, Properties, and Object Functions

• Innovation distribution (Gaussian or Student’s t)


• Amount of presample data needed to initialize the model

Such pieces of information are properties of the model, which are stored as fields within the model
object. In this way, a model object resembles a MATLAB data structure (struct array).

The five model types—arima, garch, egarch, gjr, and regARIMA—have properties according to the
econometric models they support. Each property has a predefined name, which you cannot change.

For example, arima supports conditional mean models (multiplicative and additive AR, MA, ARMA,
ARIMA, and ARIMAX processes). Every arima model object has these properties, shown with their
corresponding names.

Property Name Property Description


Constant Model constant
AR Nonseasonal AR coefficients
MA Nonseasonal MA coefficients
SAR Seasonal AR coefficients (in a multiplicative model)
SMA Seasonal MA coefficients (in a multiplicative model)
D Degree of nonseasonal differencing
Seasonality Degree of seasonal differencing
Variance Variance of the innovation distribution
Distribution Parametric family of the innovation distribution
P Amount of presample data needed to initialize the AR component of
the model
Q Amount of presample data needed to initialize the MA component of
the model

When a model object exists in the workspace, double-click its name in the Workspace window to open
the Variable Editor. The Variable Editor shows all model properties and their names.

1-9
Another Random Scribd Document
with Unrelated Content
eyes, "Endlich habe ich ein Lesebuch." He has spent a good deal of
time, since, holding it upside down and asking not to be disturbed
while reading. He and Jom Chermont had a clash of arms, and Bobo,
the two-year-old little Jap, ran the whole show with singular
competence.
An invading nostalgia possessed me all the afternoon, and I kept
thinking of the beautiful word the Portuguese chargé, De Lima,
taught me a few days ago at dinner—"saudades," meaning memory
of dear and early scenes, or of loved ones, or of all these things
together. I presented my son with two tortoises and a little green
bird, a clarine, which can be kept on the oleander terrace, though he
had asked for a monkey and a crocodile.
I see that Abbey is dead. The wonder of those reds of the "Parsifal"
frieze in the Boston Library has followed me for years. Tout a une
fin, but when an artist dies there is a double end. I have just come
across most beautiful photographs of Mexico—gum-prints and
callotypes, after some special process by an artist named Ravell,
who has a remarkable eye for this beauty and evidently a soul to
receive it.

August 8th.
To-day was my usual Tuesday at home. Elim, in spotless white,
played quietly under the tea-table most of the time with his little legs
sticking out. Torrents of rain, and only a few callers, among them
the German Consul-General, Rieloff, very musical, asking us for
dinner, and Mrs. Cummings, handsome, competent, and warm-
hearted, the wife of the head of the cable company, and a friend of
Aunt Laura's since many years.
Lately I have bought several beautiful old Mexican or Spanish
frames. Sometimes they are inlaid with mother-of-pearl, sometimes
with ivory or bone. Sometimes they are old, sometimes only so
cunningly arranged to deceive the eye and fancy that they give the
same pleasure. To-day a short, stubby, insistent Mestizo, from the
Calle Amargura, brought me a beautiful one, and I spent a most
exciting hour haggling over the price. The four evangelists are
carved in mother-of-pearl at the four corners, with a charming,
simple device of diamond-shaped pieces in between. A beautiful
Ravell photograph of the stone sails of Guadalupe just fitted into it,
and it will hang above the bookcase by my sofa. The room has many
friends whom I have put in Mexican frames; Elim and Sofka,
Iswolsky, the Towers, Mr. Taft, Mr. Roosevelt. A sweet one of Gladys
S., with her first-born in her arms, has a soft, yellow wood frame,
with an old, irregular tracing in black and ivory.
I can't call Mexico a melting-pot exactly, as things don't melt here.
But it is a strange place, with strange people and peculiar situations.
Society here, blown together by the four winds of the earth, is a
mixed affair, and various people have disappeared from the rolls
since our arrival. Some come to seek, some, it would appear,
because they are being sought, others still whose life demands a
change of setting.
It now appears that a certain agreeable foreign couple, received by
everybody, had never been joined in holy matrimony. It came out
between the invitation and the dinner at the — Legation. It was not
official enough for the minister to intimate to them that the dinner
was off, but definite enough to make him most uncomfortable.
Everybody behaved very well, however, and as he sat at the table,
his eye glancing rather anxiously about the possible field of battle, I
felt quite sorry for him; but I realized that though anybody has a
right to the highways, in the narrow compass of the drawing-room
all must, alack! be alike.
Peretti de la Rocca, the clever conseiller of the French Embassy in
Washington, took me out to dinner. It is he who married, when en
poste here, the handsome only daughter of the Suinagás', living in
our street. It was very pleasant talking Washingtoniana, Mexicana,
and politics.
Yesterday, Sunday, I spent the day at the Del Rios' at Tlalpan, on the
first slopes of the Ajusco Mountains. Von. H., who confesses openly
to homesickness, took me out with Elim, and we dropped N. for the
usual Sunday golf at the Country Club as we passed by.
The Del Rios have a big, comfortable, modernized house, with a
huge, unmodernized garden; and it is a favorite Sunday haunt of
certain of the diplomats. In the tiny inner court there is still a gem of
an old "rosace"-shaped fountain, with calla-lilies growing about it.
Small bitter-orange trees, thickly hung with green and yellow fruit,
adorn the corners, and masses of geranium-like vines mingle with
the ivy which covers the house walls, pierced here and there with
old grilled, arched windows.
On the plateau, familiar vines and fruit-trees grow willingly among so
many things that don't flourish together in Europe. Tlalpan was once
beloved of the viceroys; I think Revillagigedo first made it
fashionable, though it was settled immediately after the Conquest,
when the picturesque old church was erected.
Madame Calderon de la Barca, in whose time Tlalpan was known
after the name of the church, San Agustin de las Cuevas,[11] gives a
most amusing account of the great annual Whitsuntide gaming
festival, and Del Rio tells me that la Feria de Tlalpan still continues to
be fittingly celebrated by the exchange of temporary possessions in
various forms of gambling, and that it's not quite innocent of cock-
fights.
However, we moderns repaired to the tennis-court on arriving,
where we found a dozen or so people using it to play hockey, and
others sitting about in comfortable chairs watching the proceedings.
We went for lunch and tea, but stayed for supper, all scampering to
the house at tea-time, when a single, well-timed shower deluged the
scene.
Some played bridge, and some read. Del Rio is an agreeable,
intellectual, bookish man, with degrees at several continental
universities, and has a good library of new and old books. He also
possesses some rather radical ideas, though his personal life, as is
so often the case, plays itself out with conventionality on the highest
of ethical planes. His wife, partly of German origin, is very pretty in a
dark-eyed, unaffected, happy way.
When the rain passed we went out and sat in the mirador, a sort of
summer-house built into a corner of the high stone wall, a feature of
every Mexican garden, and watched the sun-glow slipping from the
hills, which took on a vivid blue, though the volcanoes kept their
light in their own exclusive, dazzling way for long after. A pale moon,
arisen among the sunset clouds, was waiting for its chance. By the
time we started home through a magical night in an open motor,
packed with flowers, a lot of us together, the moon was flooding the
world and had cut the whole plateau into great squares of black and
white.

August 10th.
I have just seen a list of the diplomatic shifts. Dear Mr. O'Brien goes
to Rome, the Ridgely-Carters, after their pleasant, successful years
of Europe, to the Argentine. The Jacksons have been appointed to
Rumania. It was very nice having them "near," in Havana. Each must
take his turn in the tropics, but we aren't any of us physically fitted
for prolonged sojourns, and I suppose they are delighted to return
to Europe, after their "cycle of Cathay."
Mr. Lloyd Bryce, so cultured and agreeable, has been appointed
minister to Holland. With his beautiful wife and their gifts of fortune
they will make a representation in a thousand.
Mexico seems to me the best of the Latin-American posts, the most
important to the United States, the most interesting, the most
accessible. We are lucky to have got it, though I didn't feel so on the
night of the 10th of January, when the friendly porter of the Hotel
Bristol (in Vienna), as I was coming down-stairs for one of the usual
petits soupers, said to me: "So Madame is going to leave us?" When
I asked, "Where?" he told me it was Mexico, having seen the Paris
Herald before we had! It was like hearing we had been transferred
to the moon.
Penn Cresson, secretary at Lima, is passing through, en route for
Washington. He says Peru is far; but he brings some very attractive
photographs of his abode there, and it all depends, anyway, on what
you take to a place yourself—the heart and brain luggage—whether
you like it or not.
Yesterday we started to call on Madame Bonilla, whom I had met at
the Del Rios', and for whom Mr. Cresson had messages from the
British consul-general and his wife in Lima, formerly in Mexico.
Madame B. is an Englishwoman, and I had heard much of her great
taste and the really good things she has picked up.
When, on going to the address I thought was hers, we got into a
hall with a life-size negro in plaster-of-Paris, draped with a pale blue
scarf, and holding out a gilt card-receiver, placed near the door, and
to whom we almost spoke, I was a bit taken aback. An Indian
servant somewhat stealthily showed us into a dull-red dadoed room
with a waving, light-blue ceiling, and many enlarged family
photographs in black frames hanging against the walls. I saw C.'s
interest wane as to the giving of the message, and when, after ten
minutes, a large magenta-robed, hastily dressed, startled-looking
dark lady appeared, we could only make our excuses. After much
courtesy on her part, murmurings of à la disposición de usted, and
more excuses from us, we got the address next door, where we
found the kind of interior we were expecting, drank the freshest of
tea brought in immediately by an accustomed servant, and poured
by a charming lady never surprised at five o'clock.
We fingered bits of silver, hearing just how they had been acquired,
looked at the marks on the porcelain, admired some gorgeous
seventeenth-century strips of brocade, all to the accompaniment of
questions about mutual friends and the inexhaustible "Mexican
situation." Suum cuique.

August 12th.
Last night, dinner at the Danish Legation, where things are well and
carefully done. I again sat next the Acting Secretary for Foreign
Affairs, Carbajal y Rosas, a huge man with a black beard, and
intellectual in our sense of the word. He talked very interestingly
about Mexico and affairs here in general. In regretting certain things,
he gave me a quotation from Taine to the effect that it is un pauvre
patriotisme que celui qui s'imagine que l'on doit excuser les crimes
de son pays, simplement parcequ'on en est un citoyen.
He and President de la Barra are great friends; and he thinks that
after this coming electoral term (six years) he should be President
again—himself, I suppose, as Minister for Foreign Affairs. Now De la
Barra, who is the candidate for the Vice-Presidency of the Catholic
party, which is to be reorganized with a modern and republican
program, could not be elected, even if he wished. The Madero wave
sweeps everything else before it, though De la Barra is filling a very
difficult situation with dignity and tact. He is called el Presidente
Blanco (the White President), for evident and creditable reasons.
As we sat about the handsome, methodically arranged rooms after
dinner they seemed filled not alone with Scandinavian household
gods, but with the atmosphere of the north, and as entirely
detached from Mexico as a polar bear carried to southern seas on a
block of ice. The portrait of Mr. L.'s father, the author, and other
portraits of distinguished men of an unrelated race, watched us from
the walls. Even the old pieces of silver and the bric-à-brac were but
remotely connected with this present existence, and Mr. L.'s glass-
doored bookcases were filled with Scandinavian literature. He is à
cheval between Mexico City and Havana, but in Havana they live in a
hotel, keeping the "Saga" here.
F. Vasquez Gómez has announced himself as candidate for the
coming presidential elections, but I expect it will end with the
announcement.
In toying with the Encyclopedia Britannica on a watery afternoon I
accidentally came across the name of "Elim." I expected to see some
hero of Russian history, but lo! it said, "Elim, third king of Ireland,
killed in battle." I builded better than I knew!

Assumption Day, August 15th.


Went to the cathedral this morning, walking down the broad streets
through a glistening, dry air; this afternoon, however, hail, wind, and
sheets of water are spoiling the holiday for the people.
A dinner here last night. Beautiful, ragged, yellow chrysanthemums,
much smaller than ours, decorated the table and drawing-room. The
German and Russian ministers, Penn Cresson, the McLarens, and
others were the guests.
A letter comes from Demidoff. He is leaving Paris to join Sofka, who
is now in Russia with her people. They go together to Taguil in the
Ural Mountains, to inspect their platinum mines. He is just back from
a trip to the Spanish Pyrenees with Célestin after chamois, which
latter he says don't compare with their Transylvanian cousins. He
rather loftily asks if N. enjoys most parrot-shooting or monkey-
stalking. His letter is interlarded with little questions as to when we
are going to annex the country.
He had been in charge for a month and had the excitement of a
change of government and the Agadir incident during that time. At
the Embassy, it would seem, they are one big, jolly family. It made
me quite homesick.
He winds up with a postscript, saying he had just finished The New
Machiavelli. He considers it a chef d'œuvre, but I read it only a few
months ago, and no book whose atmosphere and intrigue you forget
in as short a time is great.
I think of you and Sofka, standing in the station, as the train rolled
out from Paris, that rainy Sunday, to Cherbourg, our first étape to
the tropics.

August 17th.
All quiet in Mexico City, but we understand that to-day a battle is
taking place at Cuernavaca between Zapata, our "foremost" brigand,
with three thousand troops, and the Federals.
Those who know tell me that Zapata is atavistic in type, desirous of
Mexico for the Indians, à la a celebrated Indian chief of the Sierras
de Alica. "Mexico for the Indians" really means a sponging out of
everything between us and Montezuma, and decidedly "gives to
think."
A few days ago, dining at Silvain's, the French restaurant in vogue
here, we saw a General Huerta who seemed muy hombre, a broad-
shouldered, flat-faced, restless-eyed Indian with big glasses, rather
impressive, who was returning to Morelos to fight Zapata. I don't
know if this was his battle or not.
The Russian minister is going on leave. I gave him a little green jade
god, to take to Demidoff, sworn to me, in the name of various
deities, to be what it appears to be, authentic. He is not handsome,
but he has a delightful, smooth "feel" and something chic about him,
in his own little Aztec way.

August 18th.
The Finance Ministry, which was just opposite when we first came,
where Limantour created and guided the infant steps of Mexican
finance (le premier pas qui coûte), is now converted into the Police
Bureau. There are always a lot of people—women, children, young
men and old—all in some kind of trouble, standing or sitting on the
curve in the most picturesque combinations. It makes the street very
human, almost too human, when lawbreakers are brought to justice
in the night hours.

August 20th.
Two days ago N. met a man who knows all about your Avino mines,
but nothing consoling. It is a splendid property, but had the
misfortune to be exploited by one of the canniest of men. One,
however, who didn't lie awake nights worrying about the investors,
and who ruined it, as far as the investors are concerned, by always
getting in new machinery, he taking the commissions on the
machinery, which was easier and quicker than getting the ore out.
The mining history of Mexico is romantic in the way Eastern tales of
gleaming treasure are—a simple rubbing of Aladdin's lamp in many
cases—and certainly her national destinies have been molded by the
precious stores that her mountains hold. Some of the historic mines
were so rich that the veins could be worked by bars with a point at
one end and a chisel at the other, simply prying out the silver, sans
autre forme de procès! The famous Bueno Suceso Mine in Sonora
was discovered by an Indian who swam across the river after a great
flood and found the crest of an immense lode laid bare by the action
of the water—a pure, massive hump sparkling in the rays of the sun.
I told you of the Conde de Regla's mine, the celebrated Real del
Monte at Pachuca and the wealth beyond the dreams of avarice that
it brought in. He began life as a muletier by the name of Terreros,
and ended by being able to lend the King of Spain a million pesos.
The mines of Catorce were discovered by a negro fiddler, who,
caught out by the darkness on his way home over the mountain,
built a fire on what happened to be a bare vein. The morning sun
showed molten bits of pure silver glistening among the embers. It's
all rather upsetting, collectively and individually.
Padre Flores, a poor priest in a little town in this same San Luis
Potosí, bought, for a small sum, from some one still poorer, a mining
claim. When exploring it he came upon a small cavern which he
straightway named "the purse of God," for in it he found great heaps
of ore in a state of decomposition!
The Morelos Mine was discovered by two Indians, brothers, so poor
that the night before they could not even buy a little corn for
tortillas. Any Indian could dream this dream going over any
mountain.
There is the story of Almada, the owner of the celebrated Quintera
Mine, who, on the occasion of the marriage of his daughter, lined the
bridal chamber with silver and paved with silver the way which led
from the house to the church. In fact, there is a vast bibliography of
mining romance. Many of the lovely old churches in out-of-the-way
places were built by the friars of the seventeenth century, who
worked the mines solely to build churches and missions. Humboldt
estimates that from its discovery up to his time (1803) Spanish
America had sent nearly thirty milliards of piastres to Europe, an
almost uncountable sum.
It's difficult to expect normal government from a people who, in
some parts of their country, are nourished by the labor-saving
banana and in other parts by tales of about one in every fifteen
millions becoming, overnight, rich beyond imaginings. In the end it
all must have some influence on the psychology of the inhabitants.
Needless to add that your mine doesn't seem to be one in fifteen
millions! 'Twill be well to dream some other dream!

August 27th.
Last night a large crowd, or rather mob, assembled at the station to
meet Madero on his return to town. He did not come on the
announced train and the multitude then marched through the town,
a squad of mounted soldiers behind, to keep them in mind that the
whole earth does not yet belong to them. We were sitting in the
library, about 10.30, as they passed through Calle Humboldt, making
all kinds of unearthly noises. Suddenly a little night-robed figure
rushed in, saying, "Ich will nicht getötet sein." Elim had awakened
and jumped out of bed at the noise, thinking the revolutionary fate
he hears so much about was upon him.
The German minister gave a large dinner last night, and afterward I
played bridge with Otto Scherer, the big científico Jewish banker, a
friend of the Speyers, the Schwalbachs, et al. He didn't draw his
trumps out, and so lost the rubber. I didn't mind. It was so amusing
to see a large financial light on his way to join the ten thousand
English who are at Boulogne for the same reason.
I am going to take Elim out to lunch at Mrs. Kilvert's at Coyoacan,
and must now get ready. They have an old house, trimmed with
Bougainvillea outside and lined with books inside. To-night we dine
at the McLarens'—a dinner for James Garfield, who is their guest.

St. Augustine's Day, August 28th.


Have been thinking of you to-day, as you will know. The once
famous Church of San Agustin is now the National Library, so I went
to San Hipólito near by, equally interesting, and one of the oldest in
Mexico, dating from 1525. It was built on the spot where hundreds
of Spaniards lost their lives during the retreat of the "Melancholy
Night." But I was thinking of the Nauheim days, and all the
preparations for your feast, and so much that has slipped "into the
vast river flowing." I hope you got the pearl pin.
Spent yesterday at the Bonillas'. They have a tumble-down,
picturesque old country house, unoccupied for a generation, that
they are beginning to put in order, with a jewel of an unkempt old
garden, where all the growing things have just done as they
beautifully pleased. It is a favorite spot for picnics for our little circle
—not too far out of town, just beyond Tacubaya. After luncheon,
partaken of under an arbor of mosquete and honeysuckle at the end
of a lovely white-pillared walk, we wandered over the maguey-
planted hills stretching back of the garden.
Von H. does not care about it all. As we sat on the hillside, talking of
Iswolsky, Demidoff, and Petersburg, where he was for seven and a
half years naval aide, ad latere, to the Czar from the Kaiser, I
thought how little, after all, he was fitted for a background of agave
Americana.
Such a sweet letter from Miton S., from Copenhagen, with a
photograph of their charming Legation drawing-room—with Miton's
portrait and that of Janos by Tini Rupprecht hanging on the wall.
She tells me she returns to Horpács, where Laszlo is to do her
portrait and her sister's. They are occupied with the familiar
Copenhagen round, golfing every day at beautiful Klampenborg, and
are going to the Fryjs' magnificent place for a visit, and later to
Norway chez les Löwenskiold.

August 31st.
Mr. Garfield came to lunch to-day with the McLarens. He is most
agreeable, and is trying to pursue the political game along altruistic
lines. I certainly wish him success. He, too, hopes all things from
Madero. So few Americans have come this way that to have any of
the really nice ones here is a great treat. It made me think of all
those far-away tales of my childhood, when you knew his father as
President. The luncheon was the vehicle for one of those informal,
intimate exchanges from like standpoints, always so particularly
agreeable against an exotic background.
Yesterday, the 30th, Madero was nominated for President by the
Mexican Progressive party in convention in the city. As it was a case
of "birds of a feather," all went off smoothly as far as that special
assemblage was concerned, though any kind of peace is apt to be
rather noisy, I have discovered, this side of the Rio Grande. The
elections, primary and secondary, are set for October 1st and 15th.
IX
The Vírgen de los Remedios—General Bernardo Reyes—A description
of the famous ceremony of the "Grito de Dolores" at the palace

September 1st, evening.


To-day was the feast of the Vírgen de los Remedios, once so
important in "New Spain," and, as I had planned, Mr. de Soto and I
made the pilgrimage there.
It was the first church Cortés built in Mexico, on the site of the Aztec
temple, where he and his battered remnant halted to bind up their
wounds after the retreat from Mexico City in the "Melancholy Night."
We started out at eight o'clock, on a dazzling morning, rather weakly
and apologetically within ourselves and to each other, in a carriage,
which took us through the Paseo to Popotla and Tacuba and
Azcapotzalco, where we descended and crossed some maguey-fields
fringed by squat, half-ruined adobe huts.
We jumped endless ditches, made after the antique pattern, until we
finally reached an uncovered horse-tramway, crowded with such
specimens of the plebs as had the superfluous centavos for wheeled
conveyances. We were finally deposited at San Bartolo Naucalpam,
and then did the rest of the way, several kilometers, decently and
fittingly on foot, climbing over the white, shining, pathless tepetate,
which, with the pink tezontle, has been from all time the building
material for Mexico City. We were in the foot-hills of the Sierra de las
Cruces, covered with a scant vegetation, various kinds of cactus, or
an occasional árbol de Perú.
The Indians seem to partake of this thinness of the soil, this strange,
vanishing quality of light, this dissolving of horizons, this pulsing of
colors. A generative, effective something is underneath all the unrest
and disorder of the miserable political systems they seem to
produce, and if a race is constantly being born into a world of
wondrous light and color, it can persist in spite of everything else
being impossible.
Indians were rapidly and silently approaching from all sides as we
neared the church, which I had only seen pressed against the purple
hills, wonderfully transfigured at sunset or catching the light in the
morning hours. Mexico can hold the fancy quite independent of the
work of man. But when one adds the activities of that creative,
potent, Spanish race, infinitely inspired by the background already
perfect, with the building materials, tepetate and tezontle, white and
pink, giving them what they wanted to place against green and blue,
the beauty of the result, wrapped in the strange transparence of the
plateau, is not to be wondered at.
Everywhere we looked we found something that needed only to be
framed to make a perfect picture, a dome (media naranja, half
orange, they call the form), with its attendant belfry of reddish-gray
lace against a hill, a group of Indians resting, with notes of red
zarape, white trousers, peaked hat. Any spot can become a shop;
there is just a spreading out of their wares, and though the jefe
político of their special pueblo sees that they don't vend without a
license, at least there is no rent.
A TYPICAL GROUP OF CORN-SELLERS
Photograph by Ravell

The basket-venders, the sandal-venders, the pottery-venders, the


water-carriers, the carriers of glass jars of precious pulque, were out
in force, and the candle-trade was going strong, as we ascended the
crooked, crowded way to the patio. The buildings about were
crumbling and neglected, and the smell of the pungent messes the
Indians put into their tortillas was mingled with faint whiffs of
incense.
Everywhere the tortilleras were busy patting up their tortillas, sitting
squatted on their heels, occasionally on a petate made from tules
(reeds), but they seem to prefer Mother Earth with their children
tumbling about. We got through the crowd to the door of the church
where clouds of incense, smoke from numberless candles held in
pious hands, and a persistent, almost visible, odor of Aztec, la race
cuivrée, further thickened the air.
No one noticed us. When you may have come fifty kilometers on
foot to worship a Dios Todopoderoso a stranger or two doesn't
count. They were kneeling thickly pressed around the high altar,
bending, with their sombreros or their burdens laid in front of them,
with their arms extended, heads raised, a grave, strange-eyed race,
at the oldest of all occupations, communion with its Maker.
Peons almost never sing, but a wheezy organ was playing, and the
priest, whom I could just see, was giving the blessing after Mass.
The Ite missa est did not, however, empty the church as it does the
temples of more sophisticated races, and it remained tightly packed.
There are some old pictures, De Soto told me, of authentic date of
the first period after the Conquest, but the church was somber, and
they were so darkened by time that one couldn't tell.
As for the Vírgen de los Remedios herself I could only dimly perceive
her over the heads of Indians kneeling before the little chapel of the
shrine, where a few bunches of red-berried branches mingled with
the paper and tinsel flowers. It is a small, wooden figure rudely
carved, holding an Infant Jesus. Tradition has it that on the several
occasions when it was decided to render it more artistic the artist
appointed straightway sickened and died. The figure is supposed to
have belonged to one of Cortés's captains, who brought it from
Spain and who clung to it through all the horrors and dangers of the
"Melancholy Night." He afterward placed it for safe-keeping in a
huge maguey plant, where it was found a generation later by a
baptized Indian.
For centuries a great silver maguey, which Madame C. de la B. (also
that unflagging but amusing rejecter of all things Romish, R. A.
Wilson) spoke of seeing, was inclosed in her shrine.
At the time of the struggle for independence startling anecdotes
were recorded in connection with her. She was the patroness of the
Spaniards, who had her dressed in the full regimentals of a general,
in competition with the celebrated Virgin of Guadalupe, the great
patroness of independent Mexico and the Indians. The Mexicans
defeated the Spaniards at the battle of Las Cruces, 1810, and then
the Virgin was summarily stripped of her general's uniform, her sash
and various insignia being torn from her and her passports given her
—a touch of the party spirit which continues to be the curse of
Mexico.
The Virgin of the Remedies was, among other things, the great rain-
maker, and in the viceregal days was often carried in gorgeous
processions through the city (of course the naturally rainy months
were tout indiqués for the procession). De Soto tells me there is still
an old proverb, Hasta el agua nos debe venir de la Gachupina.[12]
After the Laws of Reform were adopted the silver railing which
inclosed the altar, the great silver maguey, and all the treasures of
jewels and votive offerings, went into the national exchequer, with
the unfortunate result that now there is nothing in the church and
nothing in the treasury. The aforesaid Mr. Wilson, who demolishes
every Aztec dream of Prescott and almost routs Humboldt from the
scene, was particularly wrathy at the idea of the three petticoats she
wore, one embroidered in pearls, one in rubies, and one in
diamonds.
Perhaps it was because he only found what he calls a "brand-new
Paris doll" when he was there in 1859, after the Laws of Reform.
I wanted to linger, but pangs of hunger, as well as great banks of
clouds, every possible shade of gray, rolling up high, with here and
there a patchwork of dazzling blue, reminded us that there are
various ways of getting rain. By the time we reached Calle Humboldt
it was nearly three o'clock, and as we lunched great cracks of
thunder sounded, the heavens opened, and then came the rattling
of hail. I thought with pity of the shelterless Indians on the hill,
whose whole life is some simple yet mysterious pilgrimage from the
cradle to the grave, and stupidly wished them all sorts of things they
can't have.

September 3d.
— writes that everything on the Isthmus is a chaos or a drifting. The
government is so uncertain that nobody dares make any move
except the brigands and revolutionaries; and they, it would appear,
are always lively. Revolution comes easily in Mexico; it's done with a
light spontaneity, north, east, west, and south, that "gives to think."
It just bubbles up, now the "lid is off," inherent and artless, like any
other disquieting natural phenomenon.
The great thing to read is Madero's Presidential Succession. I have
been looking at it, expecting to be more interested than I am, but
the subject-matter, it seems to me, is only interesting because it
applies to Mexico. Otherwise it is a bit platitudinous—the kind of
thing that in all ages sincere demagogues have preached to the
people. It has, however, served to bring a sort of democratic party, a
so-called government by the people, into being, but any kind of
liberal bird, methinks, is apt to lose a few tail-feathers here.

September 5th.
Waiting for Tuesday visitors. I tried the first and third Tuesdays, but
it was a bore remembering which, so I am at home every Tuesday.
Sometimes they are interesting, sometimes not, as is the way of
"days."

Later.
Mrs. Martin's English friend from Japan presented his letter this
afternoon. As De Soto and the newly appointed Mexican minister to
Vienna, Covarrubias, were here, and this latter was anxious to get a
lot of Vienna details, the elements were somewhat diverse.
A letter from Cal O'Laughlin tells us that Arthur Willert, of the
London Times, is on his way to Mexico to write up the situation for
his paper. He adds that people are beginning to regard affairs in
Mexico as little less serious than the Boxer outrages, and that a good
deal of apprehension is felt. He himself is off for a trip through
Canada to write up reciprocity as the Canadians look at it.
I am sending you a photograph of the "Man of the Hour." As you will
see, being photographed is not his "forte"; he sits wooden-faced in a
huge, carved armchair, with a copy of the Constitution in his hands
and the date 1857 picked out in shining white on the covers. He is
now in Yucatan, making one of his accustomed political tournées. He
is developing into a sort of "Reise-Kaiser." It is rumored that from
the state of sisal and henequen he will pick his running-mate.
Gen. Bernardo Reyes was stoned and robbed and mobbed when he
attempted to make a speech the other day, and things are pretty
noisy. He was rescued by the police from the infuriated mob with the
greatest difficulty. He had just resigned his commission in the army
in order to be ready to serve an evidently unwilling country as Chief
Executive.

September 12th, evening.


I sent you a rather hasty line this morning in commemoration of —'s
birthday, the best and most faithful of friends for this life and the
next. I went to early Mass to San Lorenzo, in the old part of the
town, one of the ways of seeing Mexico City.
Indians were sweeping the Alameda as I passed through, with
brooms of dry bushes tied on to long sticks. A thin, pinky-white sun
was filtering through the lovely trees, and watering-carts were in
evidence, making rather scant tracings on the dusty, untrodden
streets of the night.
A little boy was drinking from a gutter, like some puppy—his morning
meal, I suppose. I do hope he took the pennies I gave him to some
place where he could fill his little "tummy." The population, Indian
and Mestizo only, up and about their tasks, were shivering a little in
the chilly morning. Long lines of arrieros, bringing their heavily laden
donkeys into town with the day's provision for le ventre de Mexico,
were prodding and exhorting their burros none too gently.
Priests introduced the donkey here in the sixteenth century, to
relieve the Indian of his burdens, and the poor beasts have had an
awful time ever since. The only live stock for whose comfort the
Indians are really solicitous is the fighting-cock. He is fed, he is
housed, and his vagaries and exigencies are tenderly followed.
Elim has just asked me, with a hopeful gleam in his young eye, what
"raining cats and dogs" means, a side-light on the afternoon
weather.
The government would love to defer the elections for a while, but
the authorities don't dare not carry out the promised program.
To-day Arthur Willert, the very agreeable London Times
correspondent, just arrived, lunched with us, and we got a view of
Mexico from another angle, and a lot of outside news. Evidently they
are pessimistic in Washington. He comes to tea to-morrow to meet
the McLarens and Von H., to whom he also has a letter. As Von H. is
busy hunting down the perpetrators of the Puebla outrage, with his
own strength and time and money, he does not see anything couleur
de rose, and Willert will get nothing cheerful from him.
Saturday we dined at the new British Legation, the first dinner
Hohler has given there. It is really quite lovely. A dado of Puebla tiles
has just been completed around the hall and stairway, and the large
rooms are sparingly and very decoratively arranged with H.'s good
things, pending the arrival from England of the government
furnishings.
The new houses here are generally horrors; they don't even build
them with patios, and it seems criminal to shut out of daily life this
beauty of light and sky. Many of the new buildings are almost like
miniature New York tenements, with light-shafts only for some of the
rooms. My patio, with its square of heaven, is an abiding joy.
A cable came from Prince Festetics, whom we had congratulated on
the occasion of his new title. But it all seems a far dream of a far
past.
Luncheon here yesterday—to the Horigutchis, the Norwegians, Mr.
Wilson, of course, and Mr. Bird from New York. Mr. Bird brought a
letter to us, and is down here in connection with a mining claim that
has been on the Embassy files for nearly twenty years to one of the
richest mines in Mexico. He is accompanied by a white-bearded,
magnetic old gentleman of some ninety years.

September 13th.
Last night a huge banquet in honor of the ambassador given by the
leading male American citizens. The consuls all over Mexico sent
telegrams of congratulation, and Mr. Wilson made one of his
accustomed polished and trenchant speeches. Mr. Hudson's toast (he
is the clever editor of the Mexican Herald, that no breakfast is
complete without) was to "Mexico present and future." It was not
more optimistic than the occasion required, but certainly more so
than the actual situation warrants. He did touch on the most vital
question, as to whether the results of the election will be peaceably
accepted by the people, and hoped they would recognize the
necessity of abiding by the result of the polls next month. All sorts of
political shades are appearing. It isn't just one solid Madero color, as
it was four months ago.
September 15th, morning.
This is Independence Day here, and Heaven alone knows how
Mexico will celebrate it. To-night at the palace, which I have not yet
seen officially, is held the famous ceremony of the "Grito de
Dolores."

September 16th.
Everything quiet in Calle Humboldt. N. has gone to the Embassy for
late work, servants are invisible, the infant is in the "first sweet
dreams of night," and I can have an hour with you about the
celebration last night, which was most interesting.
I went rather contre gré. The heavens had been more than usually
lavish with their water-gifts during the afternoon, and the house was
damp and chilly. But I got into the black velvet with the gray and jet
design, so easy to don, as any black dress should be, and we were
ready when the ambassador came for us.
We passed through the brilliantly lighted and beflagged Avenida San
Francisco to the Zócalo, where an immense crowd was already
assembling. Mounted police were dashing to and fro as we passed
under the "Puerta de Honor," through which the Corps Diplomatique
enters on official occasions. The huge bronze statue of Benito
Juarez, still and shining, caught the patio lights. I suppose the real
Benito was watching the proceedings also from some angle, up or
down, I can't say.
We went up the broad stairway with the handsomest and reddest of
carpets, which Allart said had been bought for the Centenario
celebration. We entered the Sala de Espera at the top, where our
wraps were disposed of, under a huge allegorical picture of "La
Constitución." We then went through a series of really handsome
rooms in the sumptuous style; with their great proportions and high
ceilings they are most impressive. Everywhere are hung pictures of
their illustrious men, who mostly did not die in their beds—Hidalgo,
Morelos, Iturbide, Juarez, Diaz.
At one time I found myself in a huge room, and looking down upon
me was the delicate, ascetic face of Hidalgo—"other-worldliness"
stamped all over it. The scroll in his hand, proclaiming independence
to Mexico, the same kind, unfortunately, I should judge, that we
were there to celebrate, testified to the fires consuming him from
the earthly furnace of liberty and regeneration, in which he dreamed
of purifying his nation and his race. The pictures, however, are
mostly more remarkable for their size and the value of their frames
than for their artistic work.
We were received with dignity and ceremony by President de la
Barra and the members of his Cabinet. But Madero was the center of
attraction as he moved about with a dreamy, pleased expression, not
unduly elated, however. A sort of simplicity stamps all that he does.
The women were mostly in hats. Their afternoon costumes are apt
to be the dressiest. But the Corps Diplomatique was en grande
toilette. We had been wondering, in absence of notification from the
Foreign Office, what we were to wear, but accepted Hohler's verdict
that "after seven o'clock you can't go wrong in evening togs."
As we strolled about the handsome rooms a life-size painting of the
German Emperor, given on I don't know what occasion, was the only
European sovereign we met. There are many fine Chinese vases. In
the red room, they told me, those supporting the candelabra had
belonged to Maximilian, but during viceregal days much very
beautiful Chinese porcelain found its way to Mexico from the East to
the port of Acapulco, and was brought up to the capital on the backs
of Indian runners.
Señor Calero, the very clever Minister of Justice, took me out to
supper. The table was high, and as we stood instead of sitting at our
destined places we were not too far from our plates.
Calero speaks unmistakable American-English extremely well, with a
slight Middle-West twang. He knows almost all the things we Anglo-
Saxons know, and some that we don't. Though still in deep
mourning, black studs, cuff-buttons, vest, etc., for his first wife, he
was accompanied by a pretty, shy bride of two weeks, who seemed
to be very pleased at finding herself standing just across the table
from him. I suppose there is some rule here about wearing black
which does not take into consideration possible early reblossomings.
He is extremely clever, and I fancy very ambitious. However, as
honors, wealth, and power are the natural objects of human life,
why not?
The table was decorated with three splendid silver épergnes, and
some very large, fine fruit-dishes, all bearing the tragic and imperial
crest; though I understood from Allart that the plate used for the
service of the supper dated from Diaz's time, and was first used
when the famous Pan-American Congress met in Mexico City.
A blaze of light came from the great crystal chandeliers, and the
walls and windows were hung with crimson brocade. We went
through a long menu, with many courses and appropriate wines. I
think no expense was spared. De la B. is used to functions, anyway.
Of course, the great moment of the evening was the ringing of the
Independence Bell. The President stepped out on the little balcony
overlooking the Plaza, a few minutes before midnight, followed by
Madero, and voiced the celebrated cry, "Libertad é Independencia,"
while just above the balcony sounded the Campana de la
Independencia, which Hidalgo rang to call the patriots together in
Dolores on the night of September 15, 1810.
Then the great bells of the cathedral rang out, and cheers and cries
came from a crowd of about a hundred thousand people.
The President asked me to go out on the balcony; I was the only
lady of the American Embassy present, and I stood there for a few
minutes between him and Madero and looked down upon those
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like