Matlab Econometrics Toolbox Documentation PDF Download
Matlab Econometrics Toolbox Documentation PDF Download
download
https://ebookbell.com/product/matlab-econometrics-toolbox-
documentation-6741906
https://ebookbell.com/product/matlab-r2023a-econometrics-toolbox-
users-guide-mathworks-49478912
https://ebookbell.com/product/matlab-econometrics-toolbox-users-
guide-r2020a-the-mathworks-11236174
https://ebookbell.com/product/matlab-a-practical-introduction-to-
programming-and-problem-solving-6th-edition-stormy-attaway-46075418
https://ebookbell.com/product/matlab-for-engineering-
applications-5e-ise-5thise-william-j-palm-iii-46562738
Matlab And Simulink Crash Course For Engineers 1st Ed 2022 Eklas
Hossain
https://ebookbell.com/product/matlab-and-simulink-crash-course-for-
engineers-1st-ed-2022-eklas-hossain-46608958
https://ebookbell.com/product/matlab-medical-imaging-toolbox-users-
guide-the-mathworks-46611260
https://ebookbell.com/product/matlab-for-engineering-applications-5th-
edition-william-palm-46651690
https://ebookbell.com/product/matlab-for-engineering-berardino-
dacunto-48710470
https://ebookbell.com/product/matlab-for-medical-physics-reallife-
clinical-scenarios-and-projects-jidi-sun-49034592
Econometrics Toolbox™
User's Guide
R2016a
How to Contact MathWorks
Phone: 508-647-7000
Getting Started
1
Econometrics Toolbox Product Description . . . . . . . . . . . . . 1-2
Key Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-27
v
Data Preprocessing
2
Data Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Why Transform? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Common Data Transformations . . . . . . . . . . . . . . . . . . . . . . 2-2
vi Contents
Seasonal Adjustment Using a Stable Seasonal Filter . . . . . 2-57
Model Selection
3
Box-Jenkins Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
vii
Test Multiple Time Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-62
viii Contents
Time Series Regression Models
4
Time Series Regression Models . . . . . . . . . . . . . . . . . . . . . . . . 4-3
ix
Known Parameter Values for a Regression Model with ARMA
Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-44
Regression Model with ARMA Errors and t Innovations . . . 4-45
x Contents
Optimization Settings for regARIMA Model Estimation . . 4-100
Optimization Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-100
Constraints on Regression Models with ARIMA Errors . . . 4-103
xi
Presample Data for regARIMA Model Simulation . . . . . . . 4-191
xii Contents
AR Model Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-21
Default AR Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-21
AR Model with No Constant Term . . . . . . . . . . . . . . . . . . . 5-22
AR Model with Nonconsecutive Lags . . . . . . . . . . . . . . . . . . 5-23
ARMA Model with Known Parameter Values . . . . . . . . . . . 5-24
AR Model with a t Innovation Distribution . . . . . . . . . . . . . 5-25
xiii
Conventions and Extensions of the ARIMAX Model . . . . . . . 5-58
xiv Contents
Conditional Mean Model Constraints . . . . . . . . . . . . . . . . 5-111
xv
Convergence of AR Forecasts . . . . . . . . . . . . . . . . . . . . . . . 5-185
xvi Contents
Specify GJR Model with t Innovation Distribution . . . . . . . 6-40
xvii
Simulate GARCH Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-96
xviii Contents
Specification Structures with Known Parameters . . . . . . . . 7-15
Specification Structures with No Parameter Values . . . . . . 7-16
Specification Structures with Selected Parameter Values . . 7-17
Displaying and Changing a Specification Structure . . . . . . . 7-19
Determining an Appropriate Number of Lags . . . . . . . . . . . 7-19
xix
VAR Model Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-89
xx Contents
State-Space Models
8
What Are State-Space Models? . . . . . . . . . . . . . . . . . . . . . . . . . 8-3
Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3
State-Space Model Creation . . . . . . . . . . . . . . . . . . . . . . . . . 8-6
xxi
Estimate Time-Varying State-Space Model . . . . . . . . . . . . . 8-45
xxii Contents
Forecast Time-Varying State-Space Model . . . . . . . . . . . . . 8-143
Glossary
xxiii
1
Getting Started
Econometrics Toolbox™ provides functions for modeling economic data. You can select
and calibrate economic models for simulation and forecasting. For time series modeling
and analysis, the toolbox includes univariate ARMAX/GARCH composite models with
several GARCH variants, multivariate VARMAX models, and cointegration analysis.
It also provides methods for modeling economic systems using state-space models and
for estimating using the Kalman filter. You can use a variety of diagnostic functions for
model selection, including hypothesis, unit root, and stationarity tests.
Key Features
• Univariate ARMAX/GARCH composite models, including EGARCH, GJR, and other
variants
• Multivariate simulation and forecasting of VAR, VEC, and cointegrated models
• State-space models and the Kalman filter for estimation
• Tests for unit root (Dickey-Fuller, Phillips-Perron) and stationarity (Leybourne-
McCabe, KPSS)
• Statistical tests, including likelihood ratio, LM, Wald, Engle’s ARCH, and Ljung-Box
Q
• Cointegration tests, including Engle-Granger and Johansen
• Diagnostics and utilities, including AIC/BIC model selection and partial-, auto-, and
cross-correlations
• Hodrick-Prescott filter for business-cycle analysis
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.
1-3
1 Getting Started
1-4
Econometric Modeling
1-5
1 Getting Started
Related Examples
• “Box-Jenkins Model Selection” on page 3-4
• “Detect Autocorrelation” on page 3-18
• “Detect ARCH Effects” on page 3-28
• “Unit Root Tests” on page 3-44
• “Time Series Regression I: Linear Models”
• “Time Series Regression II: Collinearity and Estimator Variance”
• “Time Series Regression III: Influential Observations”
1-6
Econometric Modeling
More About
• “Trend-Stationary vs. Difference-Stationary Processes” on page 2-7
• “Box-Jenkins Methodology” on page 3-2
• “Goodness of Fit” on page 3-88
• “Regression Models with Time Series Errors” on page 4-6
• “Nonspherical Models” on page 3-94
• “Conditional Mean Models” on page 5-3
• “Conditional Variance Models” on page 6-2
• “Vector Autoregressive (VAR) Models” on page 7-3
• “Cointegration and Error Correction Analysis” on page 7-108
1-7
1 Getting Started
In this section...
“Model Objects” on page 1-8
“Model Properties” on page 1-9
“Specify Models” on page 1-11
“Retrieve Model Properties” on page 1-16
“Modify Model Properties” on page 1-17
“Methods” on page 1-18
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
specified econometric models. For univariate, discrete time series analysis, there are five
available model objects:
For multivariate, discrete time series analysis you can create a state-space model using
an ssm model obvect.
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.
1-8
Model Objects, Properties, and Methods
MATLAB Workspace
Specify Create
Proposed
Model (User)
arima (Software)
arima
variable
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.
Model Properties
A model object holds all the information necessary to estimate, simulate, and forecast
econometric models. This information includes the:
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.
1-9
1 Getting Started
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.
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-10
Model Objects, Properties, and Methods
Specify Models
Specify a model by assigning values to model properties. You do not need, nor are you
able, to specify a value for every property. The constructor function assigns default
values to any properties you do not, or cannot, specify.
Tip It is good practice to be aware of the default property values for any model you create.
In addition to having a predefined name, each model property has a predefined data type.
When assigning or modifying a property’s value, the assignment must be consistent with
the property data type.
1-11
1 Getting Started
where the innovations are independent and identically distributed normal random
variables with mean 0 and variance 0.2. This is a conditional mean model, so use arima.
Assign values to model properties using name-value pair arguments.
This model has two AR coefficients, 0.8 and -0.2. Assign these values to the property AR
as a cell array, {0.8,-0.2}. Assign the value 0.2 to Variance, and 0 to Constant.
You do not need to assign a value to Distribution because the default innovation
distribution is 'Gaussian'. There are no MA terms, seasonal terms, or degrees of
integration, so do not assign values to these properties. You cannot specify values for the
properties P and Q.
Mdl = arima('AR',{0.8,-0.2},'Variance',0.2,'Constant',0)
Mdl =
1-12
Model Objects, Properties, and Methods
ARIMA(2,0,0) Model:
--------------------
Distribution: Name = 'Gaussian'
P: 2
D: 0
Q: 0
Constant: 0
AR: {0.8 -0.2} at Lags [1 2]
SAR: {}
MA: {}
SMA: {}
Variance: 0.2
The output displays the value of the created model, Mdl. Notice that the property
Seasonality is not in the output. Seasonality only displays for models with seasonal
integration. The property is still present, however, as seen in the Variable Editor.
1-13
1 Getting Started
Mdl has values for every arima property, even though the specification included only
three. arima assigns default values for the unspecified properties. The values of SAR,
MA, and SMA are empty cell arrays because the model has no seasonal or MA terms.
The values of D and Seasonality are 0 because there is no nonseasonal or seasonal
differencing. arima sets:
1-14
Model Objects, Properties, and Methods
where
This model has one GARCH coefficient (corresponding to the lagged variance term) and
one ARCH coefficient (corresponding to the lagged squared innovation term), both with
unknown values. To specify this model, enter:
Mdl = garch('GARCH',NaN,'ARCH',NaN)
Mdl =
The default value for the constant term is also NaN. Parameters with NaN values need to
be estimated or otherwise specified before you can forecast or simulate the model. There
is also a shorthand syntax to create a default GARCH(1,1) model:
Mdl = garch(1,1)
Mdl =
1-15
1 Getting Started
--------------------------------------
Distribution: Name = 'Gaussian'
P: 1
Q: 1
Constant: NaN
GARCH: {NaN} at Lags [1]
ARCH: {NaN} at Lags [1]
The shorthand syntax returns a GARCH model with one GARCH coefficient and one
ARCH coefficient, with default NaN values.
For example, consider the arima model with this AR(2) specification:
Mdl = arima('AR',{0.8,-0.2},'Variance',0.2,'Constant',0);
To display the value of the property AR for the created model, enter:
arCoefficients = Mdl.AR
arCoefficients =
[0.8000] [-0.2000]
AR is a cell array, so you must use cell-array syntax. The coefficient cell arrays are lag-
indexed, so entering
secondARCoefficient = Mdl.AR{2}
secondARCoefficient =
-0.2000
returns the coefficient at lag 2. You can also assign any property value to a new variable:
ar = Mdl.AR
1-16
Model Objects, Properties, and Methods
ar =
[0.8000] [-0.2000]
Mdl =
ARIMA(2,0,0) Model:
--------------------
Distribution: Name = 'Gaussian'
P: 2
D: 0
Q: 0
Constant: 0
AR: {0.8 -0.2} at Lags [1 2]
SAR: {}
MA: {}
SMA: {}
Variance: 0.2
The created model has the default Gaussian innovation distribution. Change the
innovation distribution to a Student's t distribution with eight degrees of freedom. The
data type for Distribution is a struct array.
Mdl.Distribution = struct('Name','t','DoF',8)
Mdl =
ARIMA(2,0,0) Model:
--------------------
Distribution: Name = 't', DoF = 8
P: 2
D: 0
Q: 0
1-17
1 Getting Started
Constant: 0
AR: {0.8 -0.2} at Lags [1 2]
SAR: {}
MA: {}
SMA: {}
Variance: 0.2
Methods
Methods are functions that accept models as inputs. In Econometrics Toolbox, these
functions accept arima, garch, egarch, gjr, and regARIMA models:
• estimate
• infer
• forecast
• simulate
Methods can distinguish between model objects (e.g., an arima model vs. a garch
model). That is, some methods accept different optional inputs and return different
outputs depending on the type of model that is input.
Find method reference pages for a specific model by entering, for example, doc
arima.estimate.
See Also
regARIMA | ssm | arima | egarch | garch | gjr | struct
Related Examples
• “Specify Conditional Mean Models Using arima” on page 5-6
• “Specify GARCH Models Using garch” on page 6-8
• “Specify EGARCH Models Using egarch” on page 6-19
• “Specify GJR Models Using gjr” on page 6-31
More About
• Using garch Objects
1-18
Model Objects, Properties, and Methods
1-19
1 Getting Started
In this section...
“What Is a Stochastic Process?” on page 1-20
“Stationary Processes” on page 1-21
“Linear Time Series Model” on page 1-22
“Lag Operator Notation” on page 1-22
“Characteristic Equation” on page 1-23
“Unit Root Process” on page 1-24
1-20
Stochastic Process Characteristics
Stationary Processes
Stochastic processes are weakly stationary or covariance stationary (or simply, stationary)
if their first two moments are finite and constant over time. Specifically, if yt is a
stationary stochastic process, then for all t:
• E(yt) = μ < ∞.
•
V(yt) = s 2 < ∞.
• Cov(y , y ) = γ for all lags h π 0.
t t–h h
1-21
1 Getting Started
Does a plot of your stochastic process seem to increase or decrease without bound? The
answer to this question indicates whether the stochastic process is stationary. “Yes”
indicates that the stochastic process might be nonstationary. In Monthly Average CO2,
the concentration of CO2 is increasing without bound which indicates a nonstationary
stochastic process.
•
yt = m + Ây ie t- i + e t .
i =1
B( L) = (1 + b1 L + b2 L2 + … + bm Lm ).
In lag operator notation, you can write the general linear model using an infinite-degree
2
polynomial y ( L) = (1 + y 1 L + y 2 L + …),
yt = m + y ( L) et .
You cannot estimate a model that has an infinite-degree polynomial of coefficients with
a finite amount of data. However, if y ( L) is a rational polynomial (or approximately
1-22
Stochastic Process Characteristics
rational), you can write it (at least approximately) as the quotient of two finite-degree
polynomials.
q ( L)
y ( L) = .
f ( L)
Thus, by Wold’s theorem, you can model (or closely approximate) every stationary
stochastic process as
q ( L)
yt = m + et,
f ( L)
Characteristic Equation
A degree p characteristic polynomial of the linear times series model
yt = f1 yt-1 + f2 yt-2 + ... + f p yt- p + e t is
It is another way to assess that a series is a stationary process. For example, the
characteristic equation of yt = 0.5 yt-1 - 0 .02 yt- 2 + e t is f ( a) = a2 - 0.5 a + 0.02.
1-23
1 Getting Started
they have an absolute value less than one. This is a unit root process if one or more roots
lie inside the unit circle (i.e., have absolute value of one). Continuing the example, the
characteristic roots of f ( a) = 0 are a = {0.4562,0 .0438}. Since the absolute values of these
roots are less than one, the linear time series model is stationary.
For example, consider the linear time series model yt = yt-1 + e t , where e t is a white
noise sequence of innovations with variance σ2 (this is called the random walk). The
characteristic equation of this model is z - 1 = 0, which has a root of one. If the initial
t
observation y0 is fixed, then you can write the model as yt = y0 + Â e i . Its expected value
i =1
is y0, which is independent of time. However, the variance of the series is tσ2, which
grows with time making the series unstable. Take the first difference to transform the
series and the model becomes dt = yt - yt-1 = e t . The characteristic equation for this
series is z = 0 , so it does not have a unit root. Note that
• E( dt ) = 0,
which is independent of time,
•
V ( dt ) = s 2 ,
which is independent of time, and
• Cov( dt , dt- s ) = 0,
which is independent of time for all integers 0 < s < t.
Monthly Average CO2 appears nonstationary. What happens if you plot the first
difference dt = yt – yt–1 of this series? Figure 1-2 displays the dt. Ignoring the fluctuations,
the stochastic process does not seem to increase or decrease in general. You can conclude
that dt is stationary, and that yt is unit root nonstationary. For details, see “Differencing”
on page 2-3.
1-24
Stochastic Process Characteristics
References
[1] Wold, H. A Study in the Analysis of Stationary Time Series. Uppsala, Sweden:
Almqvist & Wiksell, 1938.
[2] Tans, P., and R. Keeling. (2012, August). “Trends in Atmospheric Carbon Dioxide.”
NOAA Research. Retrieved October 5, 2012 from http://www.esrl.noaa.gov/gmd/
ccgg/trends/mlo.html.
1-25
1 Getting Started
Related Examples
• “Specify Conditional Mean Models Using arima” on page 5-6
• “Specify GARCH Models Using garch” on page 6-8
• “Specify EGARCH Models Using egarch” on page 6-19
• “Specify GJR Models Using gjr” on page 6-31
• “Simulate Stationary Processes” on page 5-151
• “Assess Stationarity of a Time Series” on page 3-58
More About
• “Econometric Modeling” on page 1-3
• “Conditional Mean Models” on page 5-3
• “Conditional Variance Models” on page 6-2
1-26
Exploring the Variety of Random
Documents with Different Content
back
back
back
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
ebookbell.com