Eviews Time Series Regression
EVIEWS用面板数据模型预测
第8讲用面板数据模型预测1.面板数据定义时间序列数据或截面数据都是一维数据。
时间序列数据是变量按时间得到的数据;截面数据是变量在固定时点的一组数据。
面板数据是同时在时间和截面上取得的二维数据。
面板数据也可以定义为相同截面上的个体在不同时点的重复观测数据或者称为纵向变量序列(个体)的多次测量。
所以,面板数据(panel data)也称时间序列截面数据(time series and cross section data)或混合数据(pool data)。
面板数据示意图见图1。
面板数据从横截面(cross section)看,是由若干个体(entity, unit, individual)在某一时点构成的截面观测值,从纵剖面(longitudinal section)看每个个体都是一个时间序列。
图1 N=15,T=50的面板数据示意图图2是1978~2005年中国各省级地区消费性支出占可支配收入比率序列图。
图2 1978-2005年中国各省级地区消费性支出占可支配收入比率序列图(价格平减过)面板数据用双下标变量表示。
例如y i t, i = 1, 2, …, N; t = 1, 2, …, Ti对应面板数据中不同个体。
N表示面板数据中含有N个个体。
t对应面板数据中不同时点。
T表示时间序列的最大长度。
若固定t不变,y i ., ( i = 1, 2, …, N)是横截面上的N个随机变量;若固定i不变,y. t, (t = 1, 2, …, T)是纵剖面上的一个时间序列(个体)。
这里所讨论的面板数据主要指时期短而截面上包括的个体多的面板数据。
利用面板数据建立模型的好处是:(1)由于观测值的增多,可以增加估计量的抽样精度。
(2)对于固定效应回归模型能得到参数的一致估计量,甚至有效估计量。
(3)面板数据建模比单截面数据建模可以获得更多的动态信息。
例如1990-2000年30个省份的农业总产值数据。
固定在某一年份上,它是由30个农业总产值数字组成的截面数据;固定在某一省份上,它是由11年农业总产值数据组成的一个时间序列。
Eviews软件基本知识
Eviews简介Eviews (Econometric Views)软件是QMS(Quantitative Micro Software)公司开发的、基于Windows平台下的应用软件,其前身是DOS操作系统下的TSP软件。
Eviews软件是由经济学家开发,主要应用在经济学领域,可用于回归分析与预测(regression and forecasting)、时间序列(Time series)以及横截面数据(cross-sectional data )分析。
与其他统计软件(如EXCEL、SAS、SPSS)相比,Eviews功能优势是回归分析与预测。
从多方面的因素考虑,本指导书以Eviews5.0版本为蓝本介绍该软件的使用。
第一章Eviews软件基本操作一、实验内容及要求本实验主要是要求学生掌握利用Eviews软件进行基本的统计分析,掌握Eviews软件建立工作文件,对序列对象进行基本操作,掌握数据分析的常用操作和序列描述的统计分析。
二、实验指导一)Eviews软件的安装Eviews文件大小约11MB,可在网上下载。
下载完毕后,点击SETUP安装,安装过程与其他软件安装类似。
安装完毕后,将快捷键发送的桌面,电脑桌面显示有Eviews图标,整个安装过程就结束了。
双击Eviews按钮即可启动该软件。
(图1.1.1)图1.1.1初学者需牢记以下两点:Eviews软件的具体操作是在Workfile中进行。
如果想用Eviews进行某项具体的操作,必须先新建一个Workfile或打开一个已经存在硬盘(或软盘)上的Workfile,然后才能够定义变量、输入数据、建造模型等操作;Eviews处理的对象及运行结果都称之为objects,如序列(series)、方程(equations)、模型(models)、系数(coefficients)等objects。
可以以不同形式浏览(views)objects,比如表格(spreadsheet)、图(graph)、描述统计(descriptive statistics)等,但这些浏览(views)不是独立的objects,他们随原变量序列(views)的改变而改变。
时间序列 eviews操作
1.打开EVIEWS新建一个工作文件,步骤如下:
出现如下对话框,选择数据频率为季度,开始日期为1989年1季度,结束日期为2004年4季度,即为工作文件的范围区间。
点击ok生成工作文件
2.若要改变工作文件的范围区间,双击Range,出现如下对话框
3.利用命令series 生成时间序列gdp
点击Edit+/-改变数据的编辑状态,打开EXCEL文件将数据复制粘贴到数据区域,查看数据序列的折线图,步骤如下:
结果:
从图中可看出时间序列有明显的季节波动。
4.对gdp序列进行描述统计分析:
5.对原GDP数据进行季节调整,调整后时间序列存为GDP_SA
6.做出折线图:
由图知序列受季节影响程度变小。
7.进行单位根检验,结果如下:
计算自相关函数和偏相关函数如下:
9.利用方程建立ARMA(3,3)模型
10.建立组,包括gdp gdp_sa dgdp
建组后展示如下:
11.将建组后的收据以EXCEL格式输出:
点击ok即可。
计量经济学软件Eviews6.0基本操作
计量经济学软件EVIEWS6.0基本操作一、什么是EVIEWSEVIEWS (ECONOMETRIC VIEWS)软件是QMS(QUANTITATIVE MICRO SOFTWARE)公司开发的、基于Windows平台下的应用软件,其前身是DOS操作系统下的TSP软件。
EVIEWS软件主要应用在经济学领域,可用于回归分析与预测(REGRESSION AND FORECASTING)、时间序列(TIME SERIES)以及横截面数据(CROSS-SECTIONAL DATA )分析。
与其他统计软件(如EXCEL、SAS、SPSS、stata、R)相比,EVIEWS功能优势是菜单操作简单明了,使用方法,非常适用计量经济学初级学员。
本手册对EVIEWS软件6.0版本进行简单介绍,目的是让初级学员通过本章介绍,能够对学过的计量经济理论和方法进行简单应用,以便完成本书所述的相关实验项目。
二、EVIEWS安装EVIEWS6.0文件安装包大小约190MB,可在网上下载①。
下载完毕后,按照包中安装文件所述安装方法安装该软件。
安装完毕后,将快捷键发送的桌面,电脑桌面显示有EVIEWS6.0图标,整个安装过程就结束了。
双击EVIEWS按钮即可启动该软件(图1),图1所示界面称为EVIEWS软件主窗口,主窗口中的菜单,如File菜单称为EVIEWS主菜单。
图1三、Eviews工作特点初次使EVIEWS6.0计量经济学软件,必须了解其工作过程。
如,想要完成一个校准一元线性回归模型的参数估计,必须要完成两大步工作。
第一大步工作就是在建立一个工作文档(即EVIEWS6.0中的Workfile文档)、建立变量、导入数据;第二大步工作是在第一大步工作的基础上,根据模型特征,选用适当的参数估计方法,完成参数估计及相关检验。
四、具体示例在这里,我们通过一个简单的标准一元线性回归模型的估计过程来说明Eviews软件完成回归分析的基本过程。
Eviews简介
2011秋季
3. Regression(回归) 准回归输出(Standard Regression Output),主要有: 回归系数(Regression Coefficients)、T统计量 (t-Statistics)、可决(判定)系数()等; 实际值、拟合值、残差(Actual and Fitted Values and Residuals),包括实际值(Actual Values)、 拟合值(Fitted Values)、残差(Residuals)等; 共线性(Collinearity)、异方差性 (Heteroskedasticity)、加权最小二乘法 (Weighted Least Squares)、二段最小二乘法 (Two-Stage Least Squares)、多项式分布滞后 (Polynomial Distributed Lags)、非线性最小二 乘法(Nonlinear Least Squares)、对数概率单位 模型(Logit and Probit Models)、葛兰杰因果检 验(Granger Causality)、预测方差(Forecast )
2011秋季 经济学院计划统计系slz 14
SORT SERIES(序列排序):功能是 对序列排序
2011秋季
IMPORT(外部导入数据):功能是从其他软件中 (如EXCEL)导入数据。例如我们将EXCEL中的数 据导入当前workfile中。操作如下:点击 proc/import/Read-Text-lotus-Excel/OK,弹出对话框 (图2.1.7)。选择文件类型为.xls,选择所要导入的 EXCEL文件所在目录,选中要导入文件Book1,点 击OK。又弹出新的对话框(图2.1.8)。如果EXCEL 中的数据是以列的形式存在,则在“order of data” 下选择“by observation”; EXCEL中的数据是以行 的形式存在,则在“order of data”下选择“by series”,在“Upper-left data cell”下的空白处,键入 EXCEL中的第一个数据所在的单元格B2,在 “ Excel5+sheet name”下的空白处键入表格名 sheet1,在“ Name of series”下的空白处给导入的 数据一个名字shai点击OK,一个名为P的object出现 在workfile中。
计量经济学Eview分析教程
第一部分Eviews基本操作第一章预备知识一、什么是Eviews(全称Econometric Views)Eviews 软件是QMS(Quantitative Micro Software)公司开发的基于Windows平台下的应用软件,其前身是DOS操作系统下的TSP软件,最新版本是Eviews6.0。
该软件是由经济学家开发,主要应用在经济学领域,可用于回归分析与预测(regression and forecasting)、时间序列(Time series)以及横截面数据(cross-sectional data )分析。
与其他统计软件(如EXCEL、SAS、SPSS)相比,Eviews功能优势是回归分析与预测。
二、Eviews工作特点初学者需牢记以下两点。
一、Eviews软件对对象(objects)的具体操作是在Workfile 中进行,也就是说,如果想用Eviews进行具体的操作,必须先新建一个或打开一个已经存在在硬盘(或软盘)上的Workfile,在此Workfile中进行输入数据、建造模型等操作;二、Eviews处理的对象及运行结果都称之为objects,如序列(sereis)方程(equations)、模型(models)、系数(coefficients)等objects。
objects可以不同形式浏览(views),比如表格(spreadsheet)、图(graph)、描述统计(descriptive statistics)等,但这些浏览(views)不是独立的objects,他们随原变量序列(views)的改变而改变。
如果想将某个浏览(views)转换成一个独立的objects,可使用freeze 按钮将该views“冻结”,从而形成一个独立的objects,然后可对其进行编辑或存储。
三、一个作示例在这里,我们通过一个简单的回归分析例子来显示一个Eviews过程,不对Eviews的功能展开讨论,目的是使读者先对Eviews有个概括了解。
利用eviews实现时间序列的平稳性检验与协整检验
利用eviews实现时间序列的平稳性检验与协整检验在对时间序列Y、X1进行回归分析时需要考虑Y与X1之间是否存在某种切实的关系,所以需要进行协整检验。
1.1利用eviews创建时间序列Y、X1 :打开eviews软件点击file-new-workfile,见对话框又三块空白处workfile structure type处又三项选择,分别是非时间序列unstructured/undate,时间序列dated-regular frequency,和不明英语balance panel。
选择时间序列dated-regular frequency。
在date specification中选择年度,半年度或者季度等,和起始时间。
右下角为工作间取名字和页数。
点击ok。
在所创建的workfile中点击object-new object,选择series,以及填写名字如Y,点击OK。
将数据填写入内。
1.2对序列Y进行平稳性检验:此时应对序列数据取对数,取对数的好处在于可将间距很大的数据转换为间距较小的数据。
具体做法是在workfile y的窗口中点击Genr,输入logy=log(y),则生成y的对数序列logy。
再对logy序列进行平稳性检验。
点击view-United root test,test type选择ADF检验,滞后阶数中lag length选择SIC 检验,点击ok得结果如下:Null Hypothesis: LOGY has a unit rootExogenous: ConstantLag Length: 0 (Automatic based on SIC, MAXLAG=1)t-Statistic Prob.*Augmented Dickey-Fuller teststatistic -2.75094601716637 0.0995139988900359Test critical values: 1% level -4.297072756022265% level -3.2126963902622510% level -2.74767611540013当检验值Augmented Dickey-Fuller test statistic的绝对值大于临界值绝对值时,序列为平稳序列。
eviews--回归分析
5、关闭 Eviews
关闭 Eviews 的方法很多:选择主菜单上的“File”→“Close”;按 ALT-F4 键;单击 Eviews 窗口右上角的关闭按钮;双击 Eviews 窗口左上角等。 Eviews 关闭总是警告和给予机会将那些还没有保存的工作保存到磁盘文件中。
第二部分
案例:
单方程计量经济模型 Eviews 操作
1、Eviews 是什么
Eviews 是美国 QMS 公司研制的在 Windows 下专门从事数据分析、回归分析和预测的工 具。使用 Eviews 可以迅速地从数据中寻找出统计关系,并用得到的关系去预测数据的未来 值。Eviews 的应用范围包括:科学实验数据分析与评估、金融分析、宏观经济预测、仿真、 销售预测和成本分析等。 Eviews 是专门为大型机开发的、用以处理时间序列数据的时间序列软件包的新版本。 Eviews 的前身是 1981 年第 1 版的 Micro TSP。目前最新的版本是 Eviews4.0。我们以 Eviews3.1 版本为例,介绍经济计量学软件包使用的基本方法和技巧。虽然 Eviews 是经济 学家开发的,而且主要用于经济学领域,但是从软件包的设计来看,Eviews 的运用领域并 不局限于处理经济时间序列。即使是跨部门的大型项目,也可以采用 Eviews 进行处理。 Eviews 处理的基本数据对象是时间序列,每个序列有一个名称,只要提及序列的名称 就可以对序列中所有的观察值进行操作,Eviews 允许用户以简便的可视化的方式从键盘或 磁盘文件中输入数据, 根据已有的序列生成新的序列, 在屏幕上显示序列或打印机上打印输 出序列,对序列之间存在的关系进行统计分析。Eviews 具有操作简便且可视化的操作风格, 体现在从键盘或从键盘输入数据序列、 依据已有序列生成新序列、 显示和打印序列以及对序 列之间存在的关系进行统计分析等方面。 Eviews 具有现代 Windows 软件可视化操作的优良性。可以使用鼠标对标准的 Windows 菜单和对话框进行操作。 操作结果出现在窗口中并能采用标准的 Windows 技术对操作结果进 行处理。此外,Eviews 还拥有强大的命令功能和批处理语言功能。在 Eviews 的命令行中输 入、编辑和执行命令。在程序文件中建立和存储命令,以便在后续的研究项目中使用这些程 序。
eviews时间序列一阶自相关检验命令
eviews时间序列一阶自相关检验命令摘要:一、引言二、eviews 时间序列一阶自相关检验命令介绍1.语法结构2.参数说明三、eviews 时间序列一阶自相关检验命令实例1.数据准备2.命令执行3.结果解读四、结论正文:一、引言在时间序列分析中,自相关系数检验是评估时间序列数据之间关系的重要方法。
eviews 作为一款强大的时间序列分析软件,提供了丰富的自相关系数检验命令。
本文将详细介绍eviews 时间序列一阶自相关检验命令及其应用。
二、eviews 时间序列一阶自相关检验命令介绍1.语法结构eviews 时间序列一阶自相关检验命令为:ACF(depvar, type, lags, options)其中:- depvar:因变量(时间序列数据)- type:自相关系数类型,包括"ACF"(自相关系数)和"CCF"(偏自相关系数)- lags:滞后阶数- options:可选参数,如"plot"(绘制自相关系数图)2.参数说明在上述语法结构中,depvar 表示需要进行自相关检验的时间序列数据,type 表示需要计算的自相关系数类型,lags 表示需要计算的滞后阶数。
options 为可选参数,用于指定是否绘制自相关系数图等。
三、eviews 时间序列一阶自相关检验命令实例1.数据准备假设我们已经得到了一个时间序列数据集,包含以下变量:- 时间(time)- 因变量(y)2.命令执行我们可以通过以下命令计算时间序列一阶自相关系数:ACF(y, ACF, 1)该命令表示计算y 变量的一阶自相关系数(ACF),滞后阶数为1。
3.结果解读命令执行后,eviews 会显示计算得到的自相关系数结果。
对于一阶自相关系数,我们主要关注其p 值。
如果p 值小于显著性水平(通常为0.05),则说明因变量与自身存在显著的正相关或负相关关系;反之,则无法拒绝原假设,认为因变量与自身不存在显著的相关关系。
Eviews3章序列(Series)对象的基本操作
整理ppt
26
EViews统计分析基础教程
五、序列组对象
2.序列组对象的打开
双击群对象图标即可打开群对象窗口。也可单击工作文件工 具栏中的“View” | “Show”选项,或者直接单击工作文 件工具栏中的“Show”按钮,都将生成下图所示的对话框。 在“Objects to display in a single window”中输入想要 打开的群对象的名称,单击“OK”按钮即可。
整理ppt
25
EViews统计分析基础教程
五、序列组对象
1.序列组对象的建立
在弹出的图的“Series List(序列列举)”文本框中输入生 成群对象所用的序列,即哪些序列包括在该群对象中。例如 输 入 我 们 上 面 建 立 的 s1 序 列 和 s2 序 列 的 名 称 , 然 后 点 击 “OK”按钮,就生成了一个新的包含s1和s2两个序列的群 对象。
整理ppt
22
EViews统计分析基础教程
四、样本范围设定
在EViews主菜单中选择“Quick”|“Sample”选项和从工 作 文 件 工 具 栏 中 选 择 “ Proc”|“Set Sample” 选 项 或 “Sample”功能键都可以打开如图所示的对话框。
整理ppt
23
EViews统计分析基础教程
整理ppt
10
EViews统计分析基础教程
三、数据的处理
1.数据的输入
从外部文件中导入数据
选择EViews主菜单中的“File”|“Import” |“Read TextLotus-Excel”,然后选择文件所在的路径打开目标文件。 对于调入不同格式类型的数据会出现不同的对话框,其中从 Excel工作表读入数据是最常用的。
EVIEWS回归结果的理解
回归结果的理解参数解释:1、回归系数(coefficient)注意回归系数的正负要符合理论和实际。
截距项的回归系数无论是否通过T 检验都没有实际的经济意义。
2、回归系数的标准误差(Std.Error)标准误差越大,回归系数的估计值越不可靠,这可以通过T值的计算公式可知3、T检验值(t-Statistic)T值检验回归系数是否等于某一特定值,在回归方程中这一特定值为0,因此T值=回归系数/回归系数的标准误差,因此T值的正负应该与回归系数的正负一致,回归系数的标准误差越大,T值越小,回归系数的估计值越不可靠,越接近于0。
另外,回归系数的绝对值越大,T值的绝对值越大。
4、P值(Prob)P值为理论T值超越样本T值的概率,应该联系显著性水平α相比,α表示原假设成立的前提下,理论T值超过样本T值的概率,当P值<α值,说明这种结果实际出现的概率的概率比在原假设成立的前提下这种结果出现的可能性还小但它偏偏出现了,因此拒绝接受原假设。
5、可决系数(R-squared)都知道可决系数表示解释变量对被解释变量的解释贡献,其实质就是看(y 尖-y均)与(y=y均)的一致程度。
y尖为y的估计值,y均为y的总体均值。
6、调整后的可决系数(Adjusted R-squared)即经自由度修正后的可决系数,从计算公式可知调整后的可决系数小于可决系数,并且可决系数可能为负,此时说明模型极不可靠。
7、回归残差的标准误差(S.E.of regression)残差的经自由度修正后的标准差,OLS的实质其实就是使得均方差最小化,而均方差与此的区别就是没有经过自由度修正。
8、残差平方和(Sum Squared Resid)见上79、对数似然估计函数值(Log likelihood)首先,理解极大似然估计法。
极大似然估计法虽然没有OLS运用广泛,但它是一个具有更强理论性质的点估计方法。
极大似然估计的出发点是已知被观测现象的分布,但不知道其参数。
Eviews线性回归教程
系数向量,u 是 T 维扰动项第向15量页/共。41页
1 系数结果
(1). 回归系数 (Coefficient)
系数框描述了系数 的估计值。最小二乘估计的系数 b 是
由以下的公式计算得到的
b (X X )1 X y
如果使用列表法说明方程,系数会列在变量栏中相应的自 变量名下;如果是使用公式法来说明方程,EViews会列出实际 系数 c(1), c(2), c(3) 等等。
第12页/共41页
2 估计样本 可以说明估计中要使用的样本。EViews会用当前工作文档样 本来填充对话框。 如果估计中使用的任何一个序列的数据丢失了,EViews会 临时调整观测值的估计样本以排除掉这些观测值。EViews通过 在样本结果中报告实际样本来通知样本已经被调整了。
在方程结果的顶部, EViews报告样本已经得到了调整。从 1978年2002年期间的25个观测值中, EViews使用了24个观测值。
第17页/共41页
(3) t-统计量 t统计量是由系数估计值和标准差之间的比率来计算的,它 是用来检验系数为零的假设的。 (4) 概率(P值) 结果的最后一项是在误差项为正态分布或系数估计值为渐 近正态分布的假设下, 指出 t 统计量与实际观测值一致的概率。 这个概率称为边际显著性水平或 P 值。给定一个 P 值,可 以一眼就看出是拒绝还是接受实际系数为零的双边假设。例如, 如果显著水平为5% ,P 值小于0.05就可以拒绝系数为零的原假 设。
第10页/共41页
(二) 在EViews中对方程进行说明
当创建一个方程对象时,会出现如下对话框:
在这个对话框中需要说明三件事:方程说明,估计方法,估 计使用的样本。在最上面的编辑框中,可以说明方程:因变量 (左边)和自变量(右边)以及函数形式。
eviews教程
Eviews教程1. 介绍Eviews是一款被广泛应用于数据分析和经济建模的统计软件。
它提供了丰富的统计分析功能、高级计量经济学模型和强大的数据处理能力。
本教程将向您介绍Eviews的基本功能和操作,以帮助您快速上手使用Eviews进行数据分析和模型建立。
2. 安装和启动在开始之前,您需要先安装Eviews软件。
请根据官方网站提供的安装步骤下载和安装Eviews。
安装完成后,您可以通过以下步骤启动Eviews:1.双击桌面上的Eviews图标,或者在开始菜单中找到Eviews并点击打开。
2.Eviews启动后,您将看到一个欢迎界面。
您可以选择创建新工作文件或打开已有的文件。
3. Eviews界面介绍Eviews的界面由菜单栏、工具栏、项目管理器、文本窗口、对象浏览器和输出窗口等组成。
以下是对每个组件的简要介绍:•菜单栏:提供了各种菜单,包含Eviews的所有功能和选项。
•工具栏:包含一些常用的工具按钮,例如打开、保存、运行等。
•项目管理器:用于管理当前工作文件的对象和数据。
•文本窗口:用于编写Eviews命令和进行输出结果的展示。
•对象浏览器:显示当前工作文件中的对象列表,并提供了一些操作选项。
•输出窗口:显示Eviews的输出结果,例如数据统计、图表等。
4. 导入数据在Eviews中,您可以导入多种格式的数据,包括Excel、CSV、文本文件等。
以下是一些常用的数据导入方法:4.1 导入Excel数据要导入Excel数据,请按照以下步骤操作:1.在菜单栏中选择文件(File) -> 导入(Import) -> 导入数据(Import Data)。
2.浏览并选择要导入的Excel文件。
3.在导入向导中选择导入选项,例如数据范围、工作表等。
4.点击导入(Import)按钮完成导入过程。
4.2 导入CSV数据要导入CSV数据,请按照以下步骤操作:1.在菜单栏中选择文件(File) -> 导入(Import) -> 导入数据(Import Data)。
eviews实验教程-实验二 数据处理
一、实验目的1.回顾上节课所讲述的EViews的基本使用2.建立工作文件并将数据输入存盘二、实验要求熟悉EViews的基本使用三、实验数据四、实验内容(一)创建一个新的工作文件在主菜单上选择File,并点击其下的New,然后选择Workfile。
Eviews将进一步要求用户输入工作文件的日期信息(频数)。
在频数栏中选择一个频数,并按如下规则键入开始日期(Start date)和结束日期:(End Date)如果数据是月度数据,则按下面的形式输入(从Jan. 1950 到 Dec.1994): 1950:01 1994:12如果数据是季度数据,则按下面的形式输入(从1st Q. 1950 到 3rd Q. of1994): 1950:1 1995:3如果数据是年度数据,则按下面的形式输入(从1950 到 1994) 1950 1994如果数据是按周的数据,则按下面的形式输入(从2001年1月第一周到2010年1月第四周):1/01/2001 1/04/2010如果数据非时间型的或不是按一定时间间隔收集的数据,则按下面的形式输入(共30个观测值): 1 30然后,单击ok,就这样,就创建成功了一个新的工作文件。
(二)、打开工作文件并输入数据在主菜单上选择File,并点击其下的Open, 然后选择Workfile,并在驱动器栏中选择驱动器,在目录栏中选择保存该文件的路径,选择要打开的工作文件的文件名,最后点击OK按钮。
这样,就打开了一个已经存在的工作文件。
选择Objects/New Object/Series,在Name for Object对话框中输入序列名,单击OK。
这时会打开序列窗口,所有值用“NA”表示。
在对象窗口单击EDIT+/-按钮。
然后用鼠标单击单元格,这是可以向该单元输入数据。
D、建立组Group1、按C的步骤建立序列S1, S2, S3,按住CTRL键,用鼠标单击S1, S2, S3,选中这三个序列,单击Objects/New Object/Group,单击OK。
EViews基本操作
《计量经济学》E v i e w s上机基本操作前言《计量经济学》作为经济学类各专业的核心课程已开设多年。
多年的教学实践中,我们深感计量经济学软件在帮助同学们更好地学习、理解《计量经济学》基本思想、提高解决实际问题的能力等方面有着重要的作用。
在过去的教学中曾采用过多种版本的软件,包括TSP、Eviews、SPSS、SAS等。
从1998年以来,Eviews逐渐成为计量经济学本科教学的基本软件。
实践证明,Eviews 具有自身的特色和优良的性能。
《计量经济学》Eviews上机基本操作,主要介绍Eviews的基本功能和基本操作,以供同学们参考。
Eviews基本操作第一部分预备知识一、什么是EviewsEviews(EconometricViews)软件是QMS(QuantitativeMicroSoftware)公司开发的、基于Windows平台下的应用软件,其前身是DOS操作系统下的TSP软件。
Eviews软件是由经济学家开发,主要应用在经济学领域,可用于回归分析与预测(regressionandforecasting)、时间序列(Timeseries)以及横截面数据(cross-sectionaldata)分析。
与其他统计软件(如EXCEL、SAS、SPSS)相比,Eviews功能优势是回归分析与预测,其功能框架见表1.1。
从多方面的因素考虑,本手册不对最新版本的Eviews软件进行介绍,而只是以目前人们使用较为广泛的Eviews3.1版本为蓝本介绍该软件的使用。
Eviews3.1版本是QMS公司1998年7月推出的。
二、Eviews安装Eviews文件大小约11MB,可在网上下载。
下载完毕后,点击SETUP安装,安装过程与其他软件安装类似。
安装完毕后,将快捷键发送的桌面,电脑桌面显示有Eviews3.1图标,整个安装过程就结束了。
双击Eviews按钮即可启动该软件。
(图1.2.1)图1.2.1三、Eviews工作特点初学者需牢记以下两点。
EViews中模拟伪回归的设计与实现
EViews中模拟伪回归的设计与实现席珍沈民用两个独立的非平稳时间序列计算相关系数常得到相关系数显著不为零的结论,称这种错误的相关结论为伪相关或虚假相关(spurious correlation )。
用两个独立的非平稳时间序列建立回归模型常得到统计显著的回归函数,称这种错误的回归关系为伪回归或虚假回归(spurious regression )。
尤尔(Yule ,1926)[1]是第一个研究伪相关的学者,格朗杰-纽博尔德(Granger-Newbold ,1974)[2]首先提出伪回归,并用蒙特卡罗模拟方法模拟了伪回归和伪相关。
菲利普斯(Phillips ,1986)[3]利用泛函中心极限定理从理论上对虚假回归问题进行了分析。
张晓峒[4][5]给出了用Mathematica 和EViews 模拟伪回归的部分程序。
本文采用国内广泛使用的计量软件EViews ,给出了蒙特卡罗(Monte Carlo )模拟伪相关与伪回归的设计、模拟的结果和分析。
一、模拟伪回归的设计1.1确定概率分布和数据生成过程(1)生成两个相互独立的I (0)(白噪声)时间序列(2)生成两个相互独立的(1阶单整)时间序列x 1t ,y 1t 差分一次后平稳。
(3)生成两个相互独立的(2阶单整)时间序列x 2t ,y 2t 差分二次后平稳。
1.2生成随机样本,计算相关和回归按上述方法分三种情形分别生成样本容量为122的成对的0阶单整(I(0))序列、成对的1阶单整(I(1))和成对的2阶单整(I(2))序列,计算相关系数和估计如下回归模型:1.3模拟试验对步骤2重复10000次,记录每次模拟结果:简单相关系数γ,回归系数βi1,回归系数的t 检验值t(βi1),杜宾瓦特荪统计量DW ,决定系数R 2和F 检验统计量,并保存到矩阵m 中;再将m 中的各个列转换成相应的变量序列;最后通过计算统计量和绘制直方图展示蒙特卡罗模拟结果。
程序清单如下:∧∧!N=10000'指定试验模拟次数10000wfcreate xjhg_500u!Nmatrix(!T,18)m'记录各统计量模拟结果的矩阵m'通过循环生成各统计量并把它们加入到组g中,其中r是相关系数;b是回归系数;t是回归系数的t统计量值;dw是DW统计量值;r2决定系数;f是F统计量值group gfor%1r0b0t0dw0r20f0r1b1t1dw1r21f1r2b2t2dw2r22f2series{%1}=0g.add{%1}nextfor!k=1to!N'外循环控制模拟次数'生成0阶单整(白噪声)序列smpl1122for%1y0x0y1x1y2x2series{%1}=@rnormnext'生成一阶单整序列smpl2122x1=x1(-1)+@rnormy1=y1(-1)+@rnorm'生成二阶单整序列smpl3122x2=2*x2(-1)-x2(-2)+@rnormy2=2*y2(-1)-y2(-2)+@rnormsmpl1122'内循环计算相关系数、估计回归方程并将结果保存到矩阵中for%1%2%31y0x07y1x113y2x2m(!k,{%1})=@cor({%2},{%3})equation eq.ls{%2}c{%3}m(!k,{%1}+1)=eq.c(2)m(!k,{%1}+2)=eq.@tstats(2)m(!k,{%1}+3)=eq.@dwm(!k,{%1}+4)=eq.@r2m(!k,{%1}+5)=eq.@fnextnextsmpl1!Tmtos(m,g)for%1t0t1t2series xzh_{%1}=@abs({%1})>=2freeze(statby_{%1}){%1}.statby(nomean,nostd)xzh_{%1}next'生成统计量的描述统计量和直方图for%1r0b0t0dw0r20f0r1b1t1dw1r21f1r2b2t2dw2r22f2freeze(hist_{%1}){%1}.histnext二、模拟伪回归的结果和分析2.1简单相关系数γ的分布两独立0阶单整序列的相关系数(图1)最大可能取值为0,取值在±0.1范围内,属正态分布;两独立1阶单整序列的相关系数(图2)呈倒U型分布,取值在±1.0范围内,相关系数为0的可能性很小;两独立2阶单整序列的相关系数(图2)呈U型分布,最大可能取值在±1。
实验一 EVIEWS中时间序列相关函数操作
实验一 EVIEWS中时间序列相关函数操作【实验目的】熟悉Eviews的操作:菜单方式,命令方式;练习并掌握与时间序列分析相关的函数操作。
掌握时间序列的白噪声检验【实验内容】一、复习EViews软件的常用菜单方式和命令方式;二、各种常用差分函数表达式以及确定性趋势模型拟合;三、时间序列的自相关和偏自相关图与函数;四、时间序列的白噪声检验【实验步骤】复习:EViews软件的常用菜单方式和命令方式;(一)创建工作文件⒈菜单方式启动EViews软件之后,进入EViews主窗口在主菜单上依次点击File/New/Workfile,即选择新建对象的类型为工作文件,将弹出一个对话框,由用户选择数据的时间频率(frequency)、起始期和终止期。
选择时间频率为Annual(年度),再分别点击起始期栏(Start date)和终止期栏(End date),输入相应的日期,然后点击OK按钮,将在EViews软件的主显示窗口显示相应的工作文件窗口。
工作文件窗口是EViews的子窗口,工作文件一开始其中就包含了两个对象,一个是系数向量C(保存估计系数用),另一个是残差序列RESID(实际值与拟合值之差)。
⒉命令方式在EViews软件的命令窗口中直接键入CREATE命令,也可以建立工作文件。
命令格式为:CREATE 时间频率类型起始期终止期则菜单方式过程可写为:CREATE A 1985 1998(二)输入Y、X的数据⒈DATA命令方式在EViews软件的命令窗口键入DATA命令,命令格式为:DATA <序列名1> <序列名2>…<序列名n>本例中可在命令窗口键入如下命令:DATA Y X⒉鼠标图形界面方式在EViews软件主窗口或工作文件窗口点击Objects/New Object,对象类型选择Series,并给定序列名,一次只能创建一个新序列。
再从工作文件目录中选取并双击所创建的新序列就可以展示该对象,选择Edit+/-,进入编辑状态,输入数据。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Chapter 13. Time Series RegressionIn this section we discuss single equation regression techniques that are important for the analysis of time series data: testing for serial correlation, estimation of ARMA models, using polynomial distributed lags, and testing for unit roots in potentially nonstationary time series.The chapter focuses on the specification and estimation of time series models. A number of related topics are discussed elsewhere: standard multiple regression techniques are dis-cussed in Chapters 11 and 12, forecasting and inference are discussed extensively in Chapters 14 and 15, vector autoregressions are discussed in Chapter 20, and state space models and the Kalman filter are discussed in Chapter 22. Serial Correlation TheoryA common finding in time series regressions is that the residuals are correlated with their own lagged values. This serial correlation violates the standard assumption of regression theory that disturbances are not correlated with other disturbances. The primary problems associated with serial correlation are:OLS is no longer efficient among linear estimators. .urthermore, since prior residu-als help to predict current residuals, we can take advantage of this information to form a better prediction of the dependent variable.Standard errors computed using the textbook OLS formula are not correct, and are generally understated.If there are lagged dependent variables on the right-hand side, OLS estimates are biased and inconsistent.EViews provides tools for detecting serial correlation and estimation methods that take account of its presence.In general, we will be concerned with specifications of the form:(13.1)where is a vector of explanatory variables observed at time t, is a vector of vari-ables known in the previous period, b and g are vectors of parameters, is a disturbance term, and is the innovation in the disturbance. The vector may contain lagged values of u, lagged values of e , or both.y t x t ′¯u t+=u t z t 1−′°"t +=x t z t 1−u t "t z t 1−296296 Chapter 13. Time Series Regression The disturbance is termed the unconditional residual . It is the residual based on the structural component () but not using the information contained in . The innova-tion is also known as the one-period ahead forecast error or the prediction error . It is the difference between the actual value of the dependent variable and a forecast made on the basis of the independent variables and the past forecast errors.The .irst-Order Autoregressive ModelThe simplest and most widely used model of serial correlation is the first-order autoregres-sive, or AR(1), model. The AR(1) model is specified as(13.2)The parameter r is the first-order serial correlation coefficient. In effect, the AR(1) model incorporates the residual from the past observation into the regression model for the cur-rent observation.Higher-Order Autoregressive ModelsMore generally, a regression with an autoregressive process of order p , AR(p ) error is given by(13.3)The autocorrelations of a stationary AR(p ) process gradually die out to zero, while the par-tial autocorrelations for lags larger than p are zero.Testing for Serial CorrelationBefore you use an estimated equation for statistical inference (e.g. hypothesis tests and forecasting), you should generally examine the residuals for evidence of serial correlation. EViews provides several methods of testing a specification for the presence of serial corre-lation.The Durbin-Watson StatisticEViews reports the Durbin-Watson (DW) statistic as a part of the standard regression out-put. The Durbin-Watson statistic is a test for first-order serial correlation. More formally, the DW statistic measures the linear association between adjacent residuals from a regres-sion model. The Durbin-Watson is a test of the hypothesis r =0 in the specification:.(13.4)u t x t ′¯z t 1−"t y t x t ′¯u t+=u t ½u t 1−"t +=y t x t ′¯u t+=u t ½1u t 1−½2u t 2−…++½p u t p −+"t +=u t ½u t 1−"t +=Testing for Serial Correlation 297297If there is no serial correlation, the DW statistic will be around 2. The DW statistic will fall below 2 if there is positive serial correlation (in the worst case, it will be near zero). If there is negative correlation, the statistic will lie somewhere between 2 and 4.Positive serial correlation is the most commonly observed form of dependence. As a rule of thumb, with 50 or more observations and only a few independent variables, a DW statistic below about 1.5 is a strong indication of positive first order serial correlation. See Johnston and DiNardo (1997, Chapter 6.6.1) for a thorough discussion on the Durbin-Watson test and a table of the significance points of the statistic.There are three main limitations of the DW test as a test for serial correlation. .irst, the dis-tribution of the DW statistic under the null hypothesis depends on the data matrix x. The usual approach to handling this problem is to place bounds on the critical region, creating a region where the test results are inconclusive. Second, if there are lagged dependent vari-ables on the right-hand side of the regression, the DW test is no longer valid. Lastly, you may only test the null hypothesis of no serial correlation against the alternative hypothesis of first-order serial correlation.T wo other tests of serial correlation the Q-statistic and the Breusch-Godfrey LM test overcome these limitations, and are preferred in most applications. Correlograms and Q-statisticsView/Residual Tests/Correlogram-Q-statistics on the equation toolbar,If you select View/Residual Tests/Correlogram-Q-statisticsView/Residual Tests/Correlogram-Q-statisticsEViews will display the autocorrelation and partial autocorrelation functions of the residu-als, together with the Ljung-Box Q-statistics for high-order serial correlation. If there is no serial correlation in the residuals, the autocorrelations and partial autocorrelations at all lags should be nearly zero, and all Q-statistics should be insignificant with large p-values. Note that the p-values of the Q-statistics will be computed with the degrees of freedom adjusted for the inclusion of ARMA terms in your regression. There is evidence that some care should be taken in interpreting the results of a Ljung-Box test applied to the residuals from an ARMAX specification (see Dezhbaksh, 1990, for simulation evidence on the finite sample performance of the test in this setting).Details on the computation of correlograms and Q-statistics are provided in greater detail in Chapter7, Series , on page167.Serial Correlation LM TestView/Residual Tests/Serial Correlation LM Test carries out the Breusch-God-Selecting View/Residual Tests/Serial Correlation LM TestView/Residual Tests/Serial Correlation LM Testfrey Lagrange multiplier test for general, high-order, ARMA errors. In the Lag Specification dialog box, you should enter the highest order of serial correlation to be tested.The null hypothesis of the test is that there is no serial correlation in the residuals up to the specified order. EViews reports a statistic labeled F-statistic and an Obs*R-squared298298 Chapter 13. Time Series Regression ( the number of observations times the R-square) statistic. The statistic has an asymptotic distribution under the null hypothesis. The distribution of the F -statistic is not known, but is often used to conduct an informal test of the null.See Serial Correlation LM Test on page 297 for further discussion of the serial correlation LM test.ExampleAs an example of the application of these testing procedures, consider the following results from estimating a simple consumption function by ordinary least squares:A quick glance at the results reveals that the coefficients are statistically significant and the fit is very tight. However, if the error term is serially correlated, the estimated OLS standard errors are invalid and the estimated coefficients will be biased and inconsistent due to the presence of a lagged dependent variable on the right-hand side. The Durbin-Watson statis-tic is not appropriate as a test for serial correlation in this case, since there is a lagged dependent variable on the right-hand side of the equation.Selecting View/Residual Tests/Correlogram-Q-statistics View/Residual Tests/Correlogram-Q-statisticsView/Residual Tests/Correlogram-Q-statistics from this equation produces the following view:N R 2N R 2Â2Dependent Variable: CSMethod: Least SquaresDate: 08/19/97 Time: 13:03Sample: 1948:3 1988:4Included observations: 162VariableCoefficient Std. Error t-Statistic Prob.C-9.227624 5.898177-1.564487 0.1197GDP0.038732 0.017205 2.251193 0.0257CS(-1)0.952049 0.024484 38.88516 0.0000R-squared0.999625 Mean dependent var 1781.675Adjusted R-squared0.999621 S.D. dependent var 694.5419S.E. of regression13.53003 Akaike info criterion 8.066045Sum squared resid29106.82 Schwarz criterion 8.123223Log likelihood-650.3497 F-statistic 212047.1Durbin-Watson stat 1.672255 Prob(F-statistic)0.000000Estimating AR Models 299299The correlogram has spikes at lags up to three and at lag eight. The Q -statistics are signifi-cant at all lags, indicating significant serial correlation in the residuals.Selecting View/Residual Tests/Serial Correlation LM Test View/Residual Tests/Serial Correlation LM TestView/Residual Tests/Serial Correlation LM Test and entering a lag of 4 yields the following result:The test rejects the hypothesis of no serial correlation up to order four. The Q -statistic and the LM test both indicate that the residuals are serially correlated and the equation should be re-specified before using it for hypothesis tests and forecasting.Estimating AR ModelsBefore you use the tools described in this section, you may first wish to examine your model for other signs of misspecification. Serial correlation in the errors may be evidence of serious problems with your specification. In particular, you should be on guard for an excessively restrictive specification that you arrived at by experimenting with ordinary least squares. Sometimes, adding improperly excluded variables to your regression will eliminate the serial correlation..or a discussion of the efficiency gains from the serial correlation correction and someMonte-Carlo evidence, see Rao and Griliches (l969).Breusch-Godfrey Serial Correlation LM Test:F-statistic3.654696 Probability 0.007109Obs*R-squared 13.96215 Probability 0.007417300300 Chapter 13. Time Series Regression .irst-Order Serial CorrelationT o estimate an AR(1) model in EViews, open an equation by selecting Quick/Estimate Quick/Estimate EquationEquation and enter your specification as usual, adding the expression AR(1) to the end of your list. .or example, to estimate a simple consumption function with AR(1) errors,(13.5)you should specify your equation ascs c gdp ar(1)EViews automatically adjusts your sample to account for the lagged data used in estima-tion, estimates the model, and reports the adjusted sample along with the remainder of the estimation output.Higher-Order Serial CorrelationEstimating higher order AR models is only slightly more complicated. To estimate anAR(k ), you should enter your specification, followed by expressions for each AR term you wish to include. If you wish to estimate a model with autocorrelations from one to five:(13.6)you should entercs c gdp ar(1) ar(2) ar(3) ar(4) ar(5)By requiring that you enter all of the autocorrelations you wish to include in your model, EViews allows you great flexibility in restricting lower order correlations to be zero. .or example, if you have quarterly data and want to include a single term to account for sea-sonal autocorrelation, you could entercs c gdp ar(4)Nonlinear Models with Serial CorrelationEViews can estimate nonlinear regression models with additive AR errors. .or example, suppose you wish to estimate the following nonlinear specification with an AR(2) error:(13.7)CS t c 1c 2GDP t u t++=u t ½u t 1−"t+=CS t c 1c 2GDP t u t++=u t ½1u t 1−½2u t 2−…++½5u t 5−+"t+=CS t c 1GDP t c 2u t++=u t c 3u t 1−c 4u t 2−"t ++=Estimating AR Models 301301Simply specify your model using EViews expressions, followed by an additive termdescribing the AR correction enclosed in square brackets. The AR term should contain a coefficient assignment for each AR lag, separated by commas:cs = c(1) + gdp^c(2) + [ar(1)=c(3), ar(2)=c(4)]EViews transforms this nonlinear model by differencing, and estimates the transformed nonlinear specification using a Gauss-Newton iterative procedure (see How EViews Esti-mates AR Models on page 302).Two-Stage Regression Models with Serial CorrelationBy combining two-stage least squares or two-stage nonlinear least squares with AR terms, you can estimate models where there is correlation between regressors and the innovations as well as serial correlation in the residuals.If the original regression model is linear, EViews uses the Marquardt algorithm to estimate the parameters of the transformed specification. If the original model is nonlinear, EViews uses Gauss-Newton to estimate the AR corrected specification..or further details on the algorithms and related issues associated with the choice of instruments, see the discussion in TSLS with AR errors , beginning on page 278.Output from AR EstimationWhen estimating an AR model, some care must be taken in interpreting your results. While the estimated coefficients, coefficient standard errors, and t -statistics may be inter-preted in the usual manner, results involving residuals differ from those computed in OLS settings.T o understand these differences, keep in mind that there are two different residuals associ-ated with an AR model. The first are the estimated unconditional residuals ,,(13.8)which are computed using the original variables, and the estimated coefficients, b . These residuals are the errors that you would observe if you made a prediction of the value of using contemporaneous information, but ignoring the information contained in the lagged residual.Normally, there is no strong reason to examine these residuals, and EViews does not auto-matically compute them following estimation.The second set of residuals are the estimated one-period ahead forecast errors , . As the name suggests, these residuals represent the forecast errors you would make if you com-puted forecasts using a prediction of the residuals based upon past values of your data, in addition to the contemporaneous information. In essence, you improve upon the uncondi-u t y t x t ′b −=y t "302302 Chapter 13. Time Series Regression tional forecasts and residuals by taking advantage of the predictive power of the lagged residuals..or AR models, the residual-based regression statistics such as the , the standard error of regression, and the Durbin-Watson statistic reported by EViews are based on the one-period ahead forecast errors, .A set of statistics that is unique to AR models is the estimated AR parameters, . .or the simple AR(1) model, the estimated parameter is the serial correlation coefficient of the unconditional residuals. .or a stationary AR(1) model, the true r lies between 1 (extreme negative serial correlation) and +1 (extreme positive serial correlation). The stationarity condition for general AR(p ) processes is that the inverted roots of the lag polynomial lie inside the unit circle. EViews reports these roots as Inverted AR Roots as Inverted AR Rootsas Inverted AR Roots at the bottom of the regression output. There is no particular problem if the roots are imaginary, but a station-ary AR model should have all roots with modulus less than one. How EViews Estimates AR ModelsT extbooks often describe techniques for estimating AR models. The most widely discussed approaches, the Cochrane-Orcutt, Prais-Winsten, Hatanaka, and Hildreth-Lu procedures, are multi-step approaches designed so that estimation can be performed using standard linear regression. All of these approaches suffer from important drawbacks which occur when working with models containing lagged dependent variables as regressors, or models using higher-order AR specifications; see Davidson and MacKinnon (1994, pp. 329 341), Greene (1997, p. 600 607).EViews estimates AR models using nonlinear regression techniques. This approach has the advantage of being easy to understand, generally applicable, and easily extended to non-linear specifications and models that contain endogenous right-hand side variables. Note that the nonlinear least squares estimates are asymptotically equivalent to maximum likeli-hood estimates and are asymptotically efficient.T o estimate an AR(1) model, EViews transforms the linear model(13.9)into the nonlinear model,,(13.10)by substituting the second equation into the first, and rearranging terms. The coefficients r and b are estimated simultaneously by applying a Marquardt nonlinear least squares algo-rithm to the transformed equation. See AppendixD, Estimation Algorithms and Options , on page 645 for details on nonlinear estimation.R 2" ½ i ½ y t x t ′¯u t+=u t ½u t 1−"t+=y t ½y t 1−x t ½x t 1−−()′¯+"t +=ARIMA Theory 303303.or a nonlinear AR(1) specification, EViews transforms the nonlinear model(13.11)into the alternative nonlinear specification (13.12)and estimates the coefficients using a Marquardt nonlinear least squares algorithm.Higher order AR specifications are handled analogously. .or example, a nonlinear AR(3) is estimated using nonlinear least squares on the equation(13.13).or details, see .air (1984, pp. 210 214), and Davidson and MacKinnon (1996, pp. 331 341).ARIMA TheoryARIMA (autoregressive integrated moving average) models are generalizations of the sim-ple AR model that use three tools for modeling the serial correlation in the disturbance:The first tool is the autoregressive, or AR, term. The AR(1) model introduced above uses only the first-order term but, in general, you may use additional, higher-order AR terms. Each AR term corresponds to the use of a lagged value of the residual in the forecasting equation for the unconditional residual. An autoregressive model of order p , AR(p ) has the form.(13.14)The second tool is the integration order term. Each integration order corresponds to differencing the series being forecast. A first-order integrated component means that the forecasting model is designed for the first difference of the original series. A sec-ond-order component corresponds to using second differences, and so on.The third tool is the MA, or moving average term. A moving average forecasting model uses lagged values of the forecast error to improve the current forecast. A first-order moving average term uses the most recent forecast error, a second-order term uses the forecast error from the two most recent periods, and so on. An MA(q ) has the form:.(13.15)y t f x t ¯,()u t+=u t ½u t 1−"t+=y t ½y t 1−f x t ¯,()½f x t 1−¯,()−+"t +=y t ½1y t 1−½2y t 2−½3y t 3−++()f x t ¯,()½1f x t 1−¯,()−½2f x t 2−¯,()−½3f x t 3−¯,()−+"t +=u t ½1u t 1−½2u t 2−…++½p u t p −+"t +=u t "t µ1"t 1−µ2"t 2−…µq "t q −++++=304304 Chapter 13. Time Series Regression Please be aware that some authors and software packages use the opposite sign con-vention for the q coefficients so that the signs of the MA coefficients may bereversed.The autoregressive and moving average specifications can be combined to form an ARMA(p ,q ) specification(13.16)Although econometricians typically use ARIMA models applied to the residuals from a regression model, the specification can also be applied directly to a series. This latter approach provides a univariate model, specifying the conditional mean of the series as a constant, and measuring the residuals as differences of the series from its mean.Principles of ARIMA Modeling (Box-Jenkins 1976)In ARIMA forecasting, you assemble a complete forecasting model by using combinations of the three building blocks described above. The first step in forming an ARIMA model for a series of residuals is to look at its autocorrelation properties. Y ou can use the correlogram view of a series for this purpose, as outlined in Correlogram on page 165.This phase of the ARIMA modeling procedure is called identification (not to be confused with the same term used in the simultaneous equations literature). The nature of the corre-lation between current values of residuals and their past values provides guidance in selecting an ARIMA specification.The autocorrelations are easy to interpret each one is the correlation coefficient of the current value of the series with the series lagged a certain number of periods. The partial autocorrelations are a bit more complicated; they measure the correlation of the current and lagged series after taking into account the predictive power of all the values of the series with smaller lags. The partial autocorrelation for lag 6, for example, measures the added predictive power of when are already in the prediction model. In fact, the partial autocorrelation is precisely the regression coefficient of in a regression where the earlier lags are also used as predictors of .If you suspect that there is a distributed lag relationship between your dependent (left-hand) variable and some other predictor, you may want to look at their cross correlations before carrying out estimation.The next step is to decide what kind of ARIMA model to use. If the autocorrelation func-tion dies off smoothly at a geometric rate, and the partial autocorrelations were zero after one lag, then a first-order autoregressive model is appropriate. Alternatively, if the autocor-relations were zero after one lag and the partial autocorrelations declined geometrically, a first-order moving average process would seem appropriate. If the autocorrelations appear u t ½1u t 1−½2u t 2−…++½p u t p −+"t µ1"t 1−µ2"t 2−…µq "t q −+++++=u t 6−u 1…u t 5−,,u t 6−u tEstimating ARIMA Models 305305to have a seasonal pattern, this would suggest the presence of a seasonal ARMA structure (see Seasonal ARMA Terms on page308)..or example, we can examine the correlogram of the DRI Basics housing series in theHS.W.1 workfile by selecting View/CorrelogramView/Correlogram from the HS series toolbar:View/CorrelogramThe wavy cyclical correlo-gram with a seasonal frequencysuggests fitting a seasonalARMA model to HS.The goal of ARIMA analysis is aparsimonious representation ofthe process governing the resid-ual. Y ou should use onlyenough AR and MA terms to fitthe properties of the residuals.The Akaike information crite-rion and Schwarz criterion pro-vided with each set of estimatesmay also be used as a guide forthe appropriate lag order selec-tion.After fitting a candidate ARIMAspecification, you should verify that there are no remaining autocorrelations that yourmodel has not accounted for. Examine the autocorrelations and the partial autocorrelations of the innovations (the residuals from the ARIMA model) to see if any important forecast-ing power has been overlooked. EViews provides views for diagnostic checks after estima-tion.Estimating ARIMA ModelsEViews estimates general ARIMA specifications that allow for right-hand side explanatory variables. Despite the fact that these models are sometimes termed ARIMAX specifications, we will refer to this general class of models as ARIMA.T o specify your ARIMA model, you will:Difference your dependent variable, if necessary, to account for the order of integra-tion.Describe your structural regression model (dependent variables and regressors) andadd any AR or MA terms, as described above.306306 Chapter 13. Time Series Regression DifferencingThe d operator can be used to specify differences of series. T o specify first differencing, simply include the series name in parentheses after d . .or example, d(gdp) specifies the first difference of GDP, or GDP GDP( 1).More complicated forms of differencing may be specified with two optional parameters, n and s . d(x,n) specifies the n -th order difference of the series X:, (13.17)where L is the lag operator. .or example, d(gdp,2) specifies the second order difference of GDP:d(gdp,2) = gdp – 2*gdp(–1) + gdp(–2)d(x,n,s) specifies n -th order ordinary differencing of X with a seasonal difference at lag s :.(13.18).or example, d(gdp,0,4) specifies zero ordinary differencing with a seasonal difference at lag 4, or GDP GDP( 4).If you need to work in logs, you can also use the dlog operator, which returns differences in the log values. .or example, dlog(gdp) specifies the first difference of log(GDP) or log(GDP) log(GDP( 1)). Y ou may also specify the n and s options as described for the simple d operator, dlog(x,n,s).There are two ways to estimate integrated models in EViews. .irst, you may generate a new series containing the differenced data, and then estimate an ARMA model using the new data. .or example, to estimate a Box-Jenkins ARIMA(1, 1, 1) model for M1, you can enter:series dm1 = d(m1)ls dm1 c ar(1) ma(1)Alternatively, you may include the difference operator d directly in the estimation specifi-cation. .or example, the same ARIMA(1,1,1) model can be estimated by the one-line com-mandls d(m1) c ar(1) ma(1)The latter method should generally be preferred for an important reason. If you define a new variable, such as DM1 above, and use it in your estimation procedure, then when you forecast from the estimated model, EViews will make forecasts of the dependent variable DM1. That is, you will get a forecast of the differenced series. If you are really interested in forecasts of the level variable, in this case M1, you will have to manually transform thed x n ,()1L −()n x =d x n s ,,()1L −()n 1L s −()x =Estimating ARIMA Models 307307forecasted value and adjust the computed standard errors accordingly. Moreover, if any other transformation or lags of M1 are included as regressors, EViews will not know that they are related to DM1. If, however, you specify the model using the difference operator expression for the dependent variable, d(m1), the forecasting procedure will provide you with the option of forecasting the level variable, in this case M1.The difference operator may also be used in specifying exogenous variables and can be used in equations without ARMA terms. Simply include them in the list of regressors in addition to the endogenous variables. .or example,d(cs,2) c d(gdp,2) d(gdp(-1),2) d(gdp(-2),2) timeis a valid specification that employs the difference operator on both the left-hand and right-hand sides of the equation.ARMA TermsThe AR and MA parts of your model will be specified using the keywords ar and ma as part of the equation. We have already seen examples of this approach in our specification of the AR terms above, and the concepts carry over directly to MA terms..or example, to estimate a second-order autoregressive and first-order moving average error process ARMA(2,1), you would include expressions for the AR(1), AR(2), and MA(1) terms along with your other regressors:c gov ar(1) ar(2) ma(1)Once again, you need not use the AR and MA terms consecutively. .or example, if you want to fit a fourth-order autoregressive model to take account of seasonal movements, you could use AR(4) by itself:c gov ar(4)Y ou may also specify a pure moving average model by using only MA terms. Thus,c gov ma(1) ma(2)indicates an MA(2) model for the residuals.The traditional Box-Jenkins or ARMA models do not have any right-hand side variables except for the constant. In this case, your list of regressors would just contain a C in addi-tion to the AR and MA terms. .or example,c ar(1) ar(2) ma(1) ma(2)is a standard Box-Jenkins ARMA (2,2).。