时间序列作业文档格式.docx
《时间序列作业文档格式.docx》由会员分享,可在线阅读,更多相关《时间序列作业文档格式.docx(7页珍藏版)》请在冰点文库上搜索。
9.48
9.18
8.62
8.3
8.47
8.44
8.54
8.5
8.49
8.4
8.46
8.48
8.56
8.39
8.89
9.91
9.89
9.9
9.88
9.86
9.74
9.42
9.27
9.26
8.99
8.83
8.82
8.79
8.69
8.66
8.67
9
9.61
9.7
9.94
9.95
9.96
10.75
11.2
11.4
11.54
11.5
11.34
11.58
13.1
13.12
13.15
13.2
14.2
14.75
14.6
14.5
14.8
15.85
16.2
16.5
16.4
16.35
16.1
14
12.3
12
14.35
12.5
12.75
13.7
13.45
11.6
12.05
12.35
12.7
12.45
12.55
12.2
11.85
12.1
12.9
13.65
13.5
14.45
14.3
15.05
15.55
15.65
14.65
14.15
13.3
12.65
15.1
15.15
14.25
14.05
14.7
13
12.85
12.6
11.8
11.45
11.35
11.55
11.7
13.05
13.85
14.85
15.7
15.4
15.8
15
14.4
14.1
13.75
12.25
11.1
11.15
10.7
10.25
10.55
10.3
9.6
8.35
8.25
7.4
7.15
7.2
6.85
6.25
5.95
5.85
5.2
5.4
5.35
5.1
6.95
7.85
(1) 考察序列的方差齐性
(2) 选择适当的模型拟合该序列的发展
程序如下:
w=read.table(”习题5.6数据.txt"
)
x=w$V2
r.x=diff(log(x))*100
a=arima(r.x,order=c(3,0,3))
par(mfrow=c(2,2))
ts.plot(x)
ts.plot(log(x))
ts.plot(r.x)
ts.plot(residuals(a),ylab="
Residuals"
y=residuals(a)
plot(density(y),lty=1,lwd=2)
x=rnorm(length(y))
curve(dnorm(x),col="
green”,lty=2,lwd=2,add=TRUE)library(TSA)
McLeod.Li.test(y)
屁RGraphics:
Device2(ACTIVE)
density.default(x=y)
08.0ooo
点我设置
>
library(fGarch)
Loadingrequiredpackage:
timeDate
timeSeries
fBasics
RmetricsPackagefBasics
AnalysingMarketsandcalculatingBasicStatistics
Copyright(C)2005-2014RmetricsAssociationZurich
EducationalSoftwareforFinancialEngineeringandComputationalScienceRmetricsisfreesoftwareandcomeswithABSOLUTEYNOWARRANTYhttps:
//www.rmetrics.org---Mailto:
info@rmetrics.org
Warningmessages:
1:
package‘fGarch’wasbuiltunderRversion3.1.2
2:
package‘timeDate’wasbuiltunderRversion3.1.2
3:
package‘timeSeries’wasbuiltunderRversion3.1.2
a4=garchFit(~arma(1,0)+garch(1,1),r.x)
SeriesInitialization:
ARMAModel:
arma
FormulaMean:
~arma(1,0)
GARCHModel:
garch
FormulaVariance:
~garch(1,1)
ARMAOrder:
10
MaxARMAOrder:
1
GARCHOrder:
11
MaxGARCHOrder:
MaximumOrder:
ConditionalDist:
norm
h.start:
2
llh.start:
LengthofSeries:
27
RecursionInit:
mci
SeriesScale:
ParameterInitialization:
20.7458
InitialParameters:
$params
LimitsofTransformations:
$U,$V
WhichParametersareFixed?
$includesParameterMatrix:
U
V paramsincludes
mu -0.12078958
0.12078960.007939075
TRUE
ar1 -0.99999999
1.00000000.234298886
omega0.00000100100.00000000.100000000
alpha10.00000001
1.00000000.100000000
gamma1-0.99999999
FALSE
beta10.00000001
1.00000000.800000000
delta0.00000000
2.00000002.000000000
skew0.10000000
10.00000001.000000000
shape1.00000000
10.00000004.000000000
IndexListofParameterstobeOptimized:
muar1
omegaalpha1
beta1
1 2
3 4
6
Persistence:
0.9
---STARTOFTRACE--SelectedAlgorithm:
nlminb
RcodednlminbSolver:
0:
37.574412:
0.007939080.2342990.1000000.1000000.800000
37.128348:
0.007948990.1671880.3333041.00000e-08 0.695922
36.902954:
0.007948610.1746640.3054721.00000e-08 0.664218
36.856091:
0.007946040.2165160.2989431.00000e-08 0.657780
4:
36.850350:
0.007945210.2209960.3066901.00000e-08 0.664983
5:
36.845754:
0.007936390.2267370.3092381.00000e-08 0.655392
6:
36.843474:
0.007889130.2397780.3234891.00000e-08 0.643582
7:
36.842988:
0.007766770.2402370.3307351.00000e-08 0.633896
8:
36.842682:
0.007610320.2404550.3434571.00000e-08 0.619815
9:
36.839712:
0.005232250.2433040.5533641.00000e-08 0.391087
10:
36.839252:
0.004445610.2402410.6050221.00000e-08 0.334519
11:
36.838980:
0.003639310.2388140.6448941.00000e-08 0.290676
12:
36.838327:
0.001480850.2370010.7337141.00000e-08 0.192581
13:
36.836416:
-0.004024660.2348570.9065711.00000e-081.00000e-08
14:
36.834786:
-0.006439440.2355890.9038721.00000e-081.00000e-08
15:
36.830950:
-0.01885830.2407730.8903821.00000e-08 1.00000e-08
16:
36.830919:
-0.01856110.2411920.8910001.00000e-08 1.00000e-08
17:
36.830860:
-0.01842260.2421300.8921111.00000e-08 1.00000e-08
18:
36.830795:
-0.01866460.2427270.8931821.00000e-08 1.00000e-08
19:
36.830668:
-0.01969790.2431420.8951621.00000e-08 1.00000e-08
20:
36.830575:
-0.02102430.2425930.8964351.00000e-08 1.00000e-08
21:
36.830543:
-0.02180660.2416840.8965071.00000e-08 1.00000e-08
22:
36.830540:
-0.02188850.2413310.8962101.00000e-08 1.00000e-08
23:
-0.02185780.2412930.8961201.00000e-08 1.00000e-08
24:
-0.02185200.2412950.8961131.00000e-08 1.00000e-08
FinalEstimateoftheNegativeLLH:
LLH:
118.7038normLLH:
4.396438
mu ar1 omegaalpha1 beta1
-0.45333703 0.24129492385.67626085 0.00000001 0.00000001
R-optimhessDifferenceApproximatedHessianMatrix:
mu ar1 omegaalpha1
mu-6.741405e-02-6.802707e-02-9.871808e-10-0.11938093-3.297415e-07ar1-6.802707e-02-2.803564e+01-2.267559e-08-30.35044019-7.739587e-06omega-9.871808e-10-2.267559e-08-9.075930e-05-0.01226946-3.370707e-02alpha1-1.193809e-01-3.035044e+01-1.226946e-02-25.849479556.352009e+00beta1-3.297415e-07-7.739587e-06-3.370707e-02 6.35200878-1.250003e+01
attr(,"
time"
Timedifferenceof0.01200104secs
---ENDOFTRACE---
TimetoEstimateParameters:
Timedifferenceof0.04300213secs
summary(a4)
Title:
GARCHModelling
Call:
garchFit(formula=~arma(1,0)+garch(1,1),data=r.x)
MeanandVarianceEquation:
data~arma(1,0)+garch(1,1)
<
environment:
0x05b32850>
[data=r.x]
ConditionalDistribution:
Coefficient(s):
-4.5334e-01 2.4129e-01 3.8568e+02 1.0000e-08 1.0000e-08
Std.Errors:
basedonHessian
ErrorAnalysis:
Std.ErrortvaluePr(>
|t|)
Estimate
mu
-4.533e-01
3.856e+00
-0.1180.906416
ar1
2.413e-01
1.896e-01
1.2730.203075
omega
3.857e+02
1.091e+02
3.5360.000406***
alpha1
1.000e-08
1.245e-02
0.0000.999999
2.705e-01
0.0001.000000
Signif.codes:
0‘***’0.001‘**’0.01‘*’0.05‘.’0.1‘’1
LogLikelihood:
-118.7038normalized:
-4.396438
Description:
MonFeb0410:
51:
452013byuser:
Administrator
StandardisedResidualsTests:
Statisticp-Value
Jarque-BeraTest
R
ChiA2
2.60177
0.2722907
Shapiro-WilkTest
W
0.94326970.1466993
Ljung-BoxTest
Q(10)
9.262967
0.5073422
Q(15)
15.35413
0.4262225
Q(20)
25.37351
0.1875132
RA2
5.081702
0.8856538
7.034229
0.9566929
12.08665
0.9130612
LMArchTest
TRA2
13.748190.3170765
InformationCriterionStatistics:
AICBICSICHQIC
9.1632469.4032159.1079569.234601
原序列方差非齐,差分序列方差非齐,对数变换后,差分序列方差齐性