下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)
文檔簡介
1、# 軟件:R語言# 主要內(nèi)容:分析匯率和股價指數(shù)的聯(lián)系,用格蘭杰因果檢驗和脈沖響應(yīng)函數(shù)# 基本思路是:topix= read.csv ("topix(2012).csv", header= F)"日元兌人民幣匯率(2012) .csv"# # 1" 日元兌人民幣匯率(2012) .csv"匯率=read.csv ("日元兌人民幣匯率(2012) .csv")# (一)描繪時序圖一單位根檢驗(ADF檢驗)-平穩(wěn)性檢驗,不平穩(wěn)的話進行協(xié)整檢驗 一 格蘭杰因果檢驗plot (topix, 1 ,topix, 2, typ
2、e= "b" , xlab= "year" , ylab="股價指數(shù)")g(D2012/1/10 2013/12/2 2014/3/5 20157 2016/7Myearplot (匯率,1,匯率,2, type= "b" , xlab= "year" , ylab="匯率")# #平穩(wěn)性檢驗# install.packages("urca")library (urca)O g 榭 LJO 寸2012/1/10 2013/12/2 2014/3/4 201
3、5/5M 2016/7Myearlibrary (Imtest)# # Loading required package: zoo# # # Attaching package: 'zoo'# # The following objects are masked from 'package:base':# # # as.Date, as.Date.numeric# attach(data)lc.df <- ur.df (y=topix, 2, lags= 6, type= 'trend' ) summary(lc.df)# # # # #
4、# Augmented Dickey-Fuller Test Unit Root Test # # # # Test regression trend# # # # Call:# # lm(formula = z.diff z.lag.1 + 1 + tt + z.diff.lag)# # # Residuals:# # Min 1Q Median 3Q Max# -94.672 -7.561 0.450 8.866 93.071# Coefficients:# Estimate Std. Error t value Pr(>|t|)# (Intercept) 5.9046672.796
5、2262.1120.0349# z.lag.1 -0.0058410.003228-1.8090.0706 .# tt0.003041 0.002508 1.212 0.2256# z.diff.lag1 0.0105900.0287450.3680.7126# z.diff.lag2 0.0378380.0287581.3160.1885# z.diff.lag3 -0.0448560.028735-1.5610.1188# z.diff.lag4 -0.0491960.028726-1.7130.0871# z.diff.lag5 0.0102580.0287460.3570.7213#
6、z.diff.lag6 -0.0266270.028745-0.9260.3545# # -# # Signif. codes: 0 '*' 0.001 '*' 0.01 '*' 0.05 '.' 0.1 ' ' 1# # # Residual standard error: 16.84 on 1210 degrees of freedom# # Multiple R-squared: 0.009994, Adjusted R-squared: 0.003448# # F-statistic: 1.527 on 8
7、 and 1210 DF, p-value: 0.1432# # # # Value of test-statistic is: -1.8094 1.8787 1.7898# # # Critical values for test statistics:# # 1pct 5pct 10pct# # tau3 -3.96 -3.41 -3.12# # phi2 6.09 4.68 4.03# # phi3 8.27 6.25 5.34library ("fUnitRoots" )# # Loading required package: timeDate# # Loadin
8、g required package: timeSeries# # # Attaching package: 'timeSeries'# # The following object is masked from 'package:zoo':# # # time<-# # Loading required package: fBasics# # # Rmetrics Package fBasics# # Analysing Markets and calculating Basic Statistics# # Copyright (C) 2005-2014
9、 Rmetrics Association Zurich# # Educational Software for Financial Engineering and Computational Sci ence# # Rmetrics is free software and comes with ABSOLUTELY NO WARRANTY.# # - Mail to: # # # Attaching package: 'fUnitRoots'# # The following objects a
10、re masked from 'package:urca':# # # punitroot, qunitroot, unitrootTableunitrootTest (topix, 2)# # # Title:# # Augmented Dickey-Fuller Test# # # Test Results:# # PARAMETER:# # Lag Order: 1# # STATISTIC:# # DF: 0.9535# # P VALUE:# # t: 0.91# # n: 0.9043# # # Description:# # Thu Mar 30 11:54:58 2017 by user: Administrator# #恩格爾-格蘭杰檢驗 Engle-Granger# 第一步:建立兩變量(y1,y2 )的回歸方程,# 第二部:對該回歸方程的殘差(resid)進行單位根檢驗其中,# 原假設(shè)兩變量不存在協(xié)整關(guān)系,備擇假設(shè)是兩變量存在協(xié)整關(guān)系。# 利用最小二乘法對回歸方程進行估計,從回歸方程中提取殘差進行檢驗。# #檢驗協(xié)整關(guān)系library ("tseries" )adf.test (topix
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 度沙子運輸合同范本
- 工地施工鋼筋班組承包合同
- 游泳館勞務(wù)承包合同常用范本
- 門面租賃合同簡易范本
- 銷售人員提成合同
- 物業(yè)管理的合作與協(xié)同
- 外籍人員雇傭合同
- 甲基轉(zhuǎn)移酶SUV39H2促進前列腺癌增殖、侵襲和轉(zhuǎn)移的機制研究
- 家具定制合約三篇
- 考慮兩類沖擊的退化系統(tǒng)的預(yù)防維修策略研究
- 人工智能大模型
- 極簡統(tǒng)計學(xué)(中文版)
- 2024年資格考試-對外漢語教師資格證筆試參考題庫含答案
- 2024年4月自考02382管理信息系統(tǒng)答案及評分參考
- (蘇版)初三化學(xué)上冊:第2單元課題1空氣
- 2023年12月廣東珠海市軌道交通局公開招聘工作人員1人筆試近6年高頻考題難、易錯點薈萃答案帶詳解附后
- 腹腔鏡腎上腺腫瘤切除術(shù)查房護理課件
- 專題23平拋運動臨界問題相遇問題類平拋運和斜拋運動
- 超聲科醫(yī)德醫(yī)風(fēng)制度內(nèi)容
- 高三開學(xué)收心班會課件
- 蒸汽換算計算表
評論
0/150
提交評論