Eviews 基本操作
1.启动Eviews
双击 Eviews 图标,出现 Eviews 窗口,它由以下部分组成:标题栏“ Eviews ”、主菜单“文件,编辑,…,帮助”、命令窗口(空白处)和工作区域。
2.产生文件
Eviews 的操作在工作文件中进行,故首先要有工作文件,然后进行数据输入、分析等等操作。
)读已存在文件:文件/打开/Workfile 。
(2)新建文件:文件/新建/Workfile ,出现对话框“工作文件范围”,选取或填上数据类型、起止时间。填好后,得到一个无名字的工作文件,其中有:时间范围、当前工作文件样本范围、Filter、默认方程、系数向量 C 、序列残差
附:1
Annual选项:可以用四位年份如Start date:1955 End date 1998,在1900年和2000年之间的年份只需要后两位即可。
Quarterly选项: 输入格式为: 1992:1, 65:4, 2002:3年后面只能跟1、2、3、4代表季度。
Monthly选项: 输入格式Examples: 1956:1, 1990:11年后面为月
Weekly and daily选项: 在缺省状态下的格式如8:10:97即为October 8, 1997.它的格式可以通过Options/Dates-Frequency……调整
Undated or irregular选项:为非日期数据如:Start date:1 End date 100,即为100个数的一个序列。
附:2
保存Workfile
可以用两种方法保存Workfile,第一种方法点击主窗口中File/SaveAs or File/Save;第二,Workfile窗口中的工具栏中的Save按钮即可以保存。
打开Workfile
用File/Open/Workfile的方式可以打开以前保存的Workfile
改变workfile的显示方式:
选择View/Display Filter,或者双击workfile窗口中的Filter.*就会出现如下的对话框
在*号后面填入你想要显示的变量(中间用空格阁开),点OK即可。
3.输入数据
(1)从键盘输入:快速的/空组(编辑系列) ,打开组窗口,产生一个无标题“组”;
按列在表中输入序列名(在 OBS )及其数据,每输入一个数据完,敲一次进入。
(2)从 excel 复制数据:先取定 excel 中的数据区域,选“复制”;其次,打开 Eview ,同 2-- ( 2 ),建工作文件,使样本区域包含与被复制数据同样多的观察值个数;第三,击快速的/空组(编辑系列)
;第四,按向上滚动指针,击数据区 OBS 右边的单元格,点编辑/粘贴,于是,在工作文件中有被复制的数据序列的图标。
(3)从 excel 复制部分数据到已存在的序列中:取定要复制的数据,复制之;打开包含已存在序列的组窗口,使之处于编辑模式(开关键是 edit+/- );将光标指到目标单元格,点编辑/粘贴,其它同 3-- ( 2 )。
4.从Excel工作表中读取数据
击 Procs/导入/Read-Lotus-Excel ,选取文件类型为 Text-ASCII 或 Excel.xls ,打开文件;在对话框中,选取要打开的序列名,多个之间用空格隔开(如全用原序列名,输入序列的个数即可)。
5. 执行Eviews命令的几种方式
以执行最小二乘法为例:
方式1:使用窗口快捷命令: “Quick”→ “Estimate Equation”→ “Method”→“LS”,在对话框中依次输入因变量与自变量,如“Y c X1 X2 X3”
方式2:在“Command”窗口中输入命令:LS Y c X1 X2 X3
方式3:编程并执行程序:“File” → “New”→ “Program”;输入命令:LS Y c X1 X2 X3;按“Run”执行命令
Matrix Algebra
1、矩阵定义
如何在Eviews中 定义各种矩阵
The most basic method of assigning matrix values is to assign a value for a specific row and column element of the matrix. Simply enter the matrix name, followed by the row and column indices, in parentheses, and then an assignment to a scalar value.
For example, suppose we declare the matrix A:
matrix(2,2) a
a(1,1) = 1
a(2,1) = 4excel口内打 或者x
vector(7) y = 2
rowvector(12) z = 3
matrix(10,2) zdata = 5
matrix ydata = zdata
matrix(10,10) xdata = ydata
2.矩阵运算
2.1 矩阵转置
matrix y = @transpose(x)
2.2 矩阵加减
matrix(6,4) xdata=6
matrix(6,4) ydata=4
matrix(6,4) zdata=xdata-ydata
2.3 矩阵乘法
内积:
vector(8) x1=2
vector(8) x2=3
matrix x=@inner(x1)
matrix y=@transpose(x1)*x2
二次形:
scalar z = vec1*@inverse(matrix)*@transpose(vec1)
2.4 行列式
matrix(4,4) x
scalar xdet=@det(x)
2.5 矩阵求逆
matrix(4,4) x
matrix xinv=@inverse(x)
2.6 矩阵求迹
matrix(4,4) x
scalar xinv=@trace(x)
2.7 矩阵求特征根与特征向量
sym(4,4) x
vector v1 = @eigenvalues(x)
matrix m2 = @eigenvectors(x)
2.8 矩阵求秩
scalar rank1 = @rank(m1)
3.矩阵数值的提取及其与其他对象之间的转化
3.1 从矩阵中提取向量或子块
matrix(10, 10) m1
vector v1 = @vec(m1)
vector v2 = @columnextract(m1,3)
vector v3 = @rowextract(m1,4)
vector v4 = @columnextract(sym1,5)
The @vec function creates a 100 element vector, V1, from the columns of M1 stacked one on top of another. V2 will be a 10 element vector containing the contents of the third column of M1 while V3 will be a 10 element vector containing the fourth row of M1. The @vec, @rowextract, and @columne
xtract functions also work with sym objects. V4 is a 10 element vector containing the fifth column of SYM1.
You can also copy data from one matrix into a smaller matrix using @subextract. For example:
matrix(20,20) m1=1
matrix m2 = @subextract(m1,5,5,10,7)
matrix m3 = @subextract(m1,5,10)
matrix m4 = m1
M2 is a matrix containing a submatrix of M1 defined by taking the part of the matrix M1 beginning at row 5 and column 5 and ending at row 10 and column 7. M3 is the matrix taken from M1 at row 5 and column 10 to the last element of the matrix (row 20 and column 20). In contrast, M4 is defined to be an exact copy of the full matrix.
3.2 从时间序列中生成矩阵
smpl 1963:3 1993:6
group mygrp hsf gmpyq
vector xvec = gmpyq
matrix xmat = mygrp
These statements create the vector XVEC and the two column matrix XMAT containing the non-missing series and group data from 1963:3 to 1993:6. Note that if GMPYQ has a missing value in 1970:01, and HSF contains a missing value in 1980:01, both observations for both series will be excluded from XMAT.
When performing matrix assignment, you may refer to an element of a series, just as you would refer to an element of a vector, by placing an index value in parentheses after the name. An index value i refers to the i-th element of the series from the beginning of the workfile range. For example, if the range of the current annual workfile is 1961 to 1980, the expression GNP(6) refers to the 1966 value of GNP. These series element expressions may be used in assigning specific series values to matrix elements, or to assign matrix values to a specific series element. For example:
smpl 61 90
group groupx inv gdp m1
vector v = @convert(gdp)
matrix x = @convert(groupx)
X is a matrix with the first column containing data from INV, the second column from GDP, and the third column from M1.
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论