Home
»
date
»
2009
»
Dec
»
11
»
*The author of this computation has been verified*
R Software Module:
/rwasp_arimabackwardselection.wasp
(opens new window with default values)
Title produced by software: ARIMA Backward Selection
Date of computation: Fri, 11 Dec 2009 10:25:03 -0700
Cite this page as follows:
Statistical Computations at FreeStatistics.org
, Office for Research Development and Education, URL
http://www.freestatistics.org/blog/date/2009/Dec/11/t1260552333qlfd6zwzk61enst.htm/
, Retrieved Wed, 22 May 2013 19:18:53 +0000
Original text written by user:
IsPrivate?
No (this computation is public)
User-defined keywords:
System-generated keywords (parent):
t1260457743507lh3bg5rk9vdf (pk = 65451)
Estimated Impact
39
Dataseries X:
»
Textfile
« »
CSV
« »
Stem and Leaf
« »
Histogram
« »
Kernel Density
« »
Harrell-Davis Quantiles
« »
Central Tendency
« »
Variability
«
255 280.2 299.9 339.2 374.2 393.5 389.2 381.7 375.2 369 357.4 352.1 346.5 342.9 340.3 328.3 322.9 314.3 308.9 294 285.6 281.2 280.3 278.8 274.5 270.4 263.4 259.9 258 262.7 284.7 311.3 322.1 327 331.3 333.3 321.4 327 320 314.7 316.7 314.4 321.3 318.2 307.2 301.3 287.5 277.7 274.4 258.8 253.3 251 248.4 249.5 246.1 244.5 243.6 244 240.8 249.8 248 259.4 260.5 260.8 261.3 259.5 256.6 257.9 256.5 254.2 253.3 253.8 255.5 257.1 257.3 253.2 252.8 252 250.7 252.2 250 251 253.4 251.2 255.6 261.1 258.9 259.9 261.2 264.7 267.1 266.4 267.7 268.6 267.5 268.5 268.5 270.5 270.9 270.1 269.3 269.8 270.1 264.9 263.7 264.8 263.7 255.9 276.2 360.1 380.5 373.7 369.8 366.6 359.3 345.8 326.2 324.5 328.1 327.5 324.4 316.5 310.9 301.5 291.7 290.4 287.4 277.7 281.6 288 276 272.9 283 283.3 276.8 284.5 282.7 281.2 287.4 283.1 284 285.5 289.2 292.5 296.4 305.2 303.9 311.5 316.3 316.7 322.5 317.1 309.8 303.8 290.3 293.7 291.7 296.5 289.1 288.5 293.8 297.7 305.4 302.7 302.5 303 294.5 294.1 294.5 297.1 289.4 292.4 287.9 286.6 280.5 272.4 269.2 270.6 267.3 262.5 266.8 268.8 263.1 261.2 266 262.5 265.2 261.3 253.7 249.2 239.1 236.4 235.2 245.2 246.2 247.7 251.4 253.3 254.8 250 249.3 241.5 243.3 248 253 252.9 251.5 251.6 253.5 259.8 334.1 448 445.8 445 448.2 438.2 439.8 423.4 410.8 408.4 406.7 405.9 402.7 405.1 399.6 386.5 381.4 375.2 357.7 359 355 352.7 344.4 343.8 338 339 333.3 334.4 328.3 330.7 330 331.6 351.2 389.4 410.9 442.8 462.8 466.9 461.7 439.2 430.3 416.1 402.5 397.3 403.3 395.9 387.8 378.6 377.1 370.4 362 350.3 348.2 344.6 343.5 342.8 347.6 346.6 349.5 342.1 342 342.8 339.3 348.2 333.7 334.7 354 367.7 363.3 358.4 353.1 343.1 344.6 344.4 333.9 331.7 324.3 321.2 322.4 321.7 320.5 312.8 309.7 315.6 309.7 304.6 302.5 301.5 298.8 291.3 293.6 294.6 285.9 297.6 301.1 293.8 297.7 292.9 292.1 287.2 288.2 283.8 299.9 292.4 293.3 300.8 293.7 293.1 294.4 292.1 291.9 282.5 277.9 287.5 289.2 285.6 293.2 290.8 283.1 275 287.8 287.8 287.4 284 277.8 277.6 304.9 294 300.9 324 332.9 341.6 333.4 348.2 344.7 344.7 329.3 323.5 323.2 317.4 330.1 329.2 334.9 315.8 315.4 319.6 317.3 313.8 315.8
Output produced by software:
Summary of computational transaction
Raw Input
view raw input (R code)
Raw Output
view raw output of R engine
Computing time
6 seconds
R Server
'Gwilym Jenkins' @ 72.249.127.135
ARIMA Parameter Estimation and Backward Selection
Iteration
ar1
ar2
ar3
ar4
ar5
ar6
ar7
ar8
ar9
ar10
ar11
Estimates ( 1 )
0.4714
-0.1016
0.1174
-0.0726
0.0063
-0.0956
-0.0141
0.0017
0.0381
-0.0615
0.0029
(p-val)
(0 )
(0.0833 )
(0.0474 )
(0.2214 )
(0.9163 )
(0.1108 )
(0.815 )
(0.9775 )
(0.5249 )
(0.3025 )
(0.9575 )
Estimates ( 2 )
0.4714
-0.1017
0.1174
-0.0728
0.0065
-0.0959
-0.0134
0
0.0388
-0.0618
0.0031
(p-val)
(0 )
(0.0821 )
(0.047 )
(0.2196 )
(0.9125 )
(0.1058 )
(0.8059 )
(NA )
(0.4741 )
(0.295 )
(0.9546 )
Estimates ( 3 )
0.4712
-0.1016
0.1174
-0.0728
0.0063
-0.0958
-0.0135
0
0.0386
-0.0604
0
(p-val)
(0 )
(0.0823 )
(0.0471 )
(0.2191 )
(0.9154 )
(0.1058 )
(0.8046 )
(NA )
(0.4755 )
(0.2624 )
(NA )
Estimates ( 4 )
0.4708
-0.1009
0.1166
-0.0702
0
-0.0933
-0.014
0
0.0385
-0.0604
0
(p-val)
(0 )
(0.0825 )
(0.0465 )
(0.1928 )
(NA )
(0.0842 )
(0.7952 )
(NA )
(0.476 )
(0.2624 )
(NA )
Estimates ( 5 )
0.4721
-0.101
0.1173
-0.0713
0
-0.0989
0
0
0.038
-0.0616
0
(p-val)
(0 )
(0.0821 )
(0.045 )
(0.1847 )
(NA )
(0.0457 )
(NA )
(NA )
(0.4816 )
(0.252 )
(NA )
Estimates ( 6 )
0.4718
-0.1031
0.115
-0.0707
0
-0.0952
0
0
0
-0.046
0
(p-val)
(0 )
(0.0757 )
(0.049 )
(0.1885 )
(NA )
(0.0531 )
(NA )
(NA )
(NA )
(0.348 )
(NA )
Estimates ( 7 )
0.4715
-0.1026
0.1177
-0.0672
0
-0.0958
0
0
0
0
0
(p-val)
(0 )
(0.0775 )
(0.044 )
(0.2113 )
(NA )
(0.0519 )
(NA )
(NA )
(NA )
(NA )
(NA )
Estimates ( 8 )
0.4667
-0.0958
0.0884
0
0
-0.1011
0
0
0
0
0
(p-val)
(0 )
(0.0985 )
(0.099 )
(NA )
(NA )
(0.04 )
(NA )
(NA )
(NA )
(NA )
(NA )
Estimates ( 9 )
0.4609
-0.0559
0
0
0
-0.094
0
0
0
0
0
(p-val)
(0 )
(0.2899 )
(NA )
(NA )
(NA )
(0.0562 )
(NA )
(NA )
(NA )
(NA )
(NA )
Estimates ( 10 )
0.4366
0
0
0
0
-0.0948
0
0
0
0
0
(p-val)
(0 )
(NA )
(NA )
(NA )
(NA )
(0.0544 )
(NA )
(NA )
(NA )
(NA )
(NA )
Estimates ( 11 )
0.4419
0
0
0
0
0
0
0
0
0
0
(p-val)
(0 )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
Estimates ( 12 )
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
(p-val)
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
Estimates ( 13 )
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
(p-val)
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
Estimates ( 14 )
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
(p-val)
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
Estimates ( 15 )
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
(p-val)
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
Estimates ( 16 )
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
(p-val)
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
Estimates ( 17 )
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
(p-val)
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
Estimates ( 18 )
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
(p-val)
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
Estimates ( 19 )
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
(p-val)
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
Estimates ( 20 )
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
(p-val)
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
Estimates ( 21 )
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
(p-val)
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
(NA )
Estimated ARIMA Residuals
Value
0.254999840129496
22.5044750036747
8.56666662771422
30.5224425186224
17.7574029835131
4.29599552355775
-11.6967564104387
-3.23382517886057
-1.3582203395938
0.363289924781157
-5.57531773752589
1.59376998313809
-3.69385227442251
-1.86624221154045
-1.64456945586153
-11.4526930140069
-1.26091474164383
-6.74499560813354
-2.17643243331952
-12.8838361522639
-2.14168358217944
-1.87046307725319
0.508960961751882
-1.92237013143057
-4.15707307840262
-3.63529234373198
-6.00640711665477
-0.861174356807055
-0.457347594503176
5.38727105814723
19.5405131043552
16.6069251456254
-1.47618585191458
-0.146684270651747
1.98071964374680
0.568335608514019
-10.6875339659314
13.3167766852150
-8.42091884471262
-1.77953733352012
4.7214249729181
-2.98352756439783
6.77597977179363
-5.58140968107278
-10.3102510268844
-1.60024022024908
-11.0346762136322
-3.99346348653688
1.63243972026879
-14.4532195827589
0.267593529950204
-0.458219069875355
-2.90413962006073
1.30602813826920
-4.19305875208141
-1.59455923558826
-0.72289670018273
0.574867852086356
-3.62110455264951
10.5012827267068
-6.05139007083937
12.0341347439427
-3.96214318012437
-0.142299936365134
0.0656719856086738
-1.16508461175118
-2.28482519204198
3.64675039128031
-1.86325285284317
-1.66037124905191
0.151495802842817
0.722267692048007
1.20679919716125
0.981081698292542
-0.631221091288239
-4.4053519562481
1.30459048277018
-0.57797477518946
-0.789589774432585
2.21921198863623
-2.83588525719867
1.57176092898328
1.92551666590845
-3.32359205303203
5.23720003276861
3.72132028654715
-4.80965833750361
2.05523929659222
1.09095576969378
2.72390820340979
1.28914647423488
-1.22635406951514
1.39703512765425
0.42726717916446
-1.36966753200971
1.81201868806608
-0.209044230306233
1.93364022405365
-0.349887340344139
-0.889305672917828
-0.555028878217911
0.944050449621102
0.0817182689389142
-5.14136967879006
1.10804987500495
1.54803641060801
-1.65605955227312
-7.27238035170387
23.7336349085304
74.5448033833175
-16.3414340879630
-15.6016149793778
-1.03564810548448
-2.23684000112524
-3.97856341876542
-2.35939358094083
-11.7724797909141
6.21200603411711
3.97243913390685
-2.47498743939468
-3.53009958616695
-7.82644894638594
-4.00922237573161
-7.11640406798512
-5.35502460832708
2.92144212084384
-2.72634650700343
-9.13922708502753
7.60378737501503
3.806285506444
-15.7230430208308
2.01552196156638
11.1689476928090
-5.02884786269072
-6.26125028693571
11.1443804553037
-6.29913481742108
-1.00806477594227
7.81232196040889
-6.97825356118074
2.16102496762392
1.83705041949958
2.87451538295466
1.54251567026279
3.04709859052122
6.68976387405303
-5.05643875474465
8.30973202064393
1.83287650358733
-1.38266567443975
5.99509336685207
-7.09783089698362
-5.06579688844033
-2.09260915909044
-10.4255807636347
9.33152661061939
-2.93447762766027
5.1612086526585
-10.1875422816269
2.0617715401645
4.28214239830851
1.90853256249147
5.80780313787665
-5.60650019470921
0.277203716297436
0.530432884470429
-8.21584342746746
3.68050817973995
1.30458292025844
2.16941547935818
-8.85402493750252
6.40893849830286
-6.61548766571497
0.626615707580754
-5.4945476272718
-5.1904837132538
-0.393793492219515
3.08140211856113
-4.33778740662609
-3.48258015889695
5.81722657065444
-0.645100294504516
-6.87648589999907
0.721131285989316
5.31663163428527
-6.05054308181866
4.63561074109811
-4.88912198788336
-6.43776067328628
-1.36223707972536
-7.68042595681803
1.37749208770288
0.234680483522965
10.1541574028457
-4.08611218863956
0.636837978222815
2.08767803959111
0.0287560543547727
0.556769806059776
-4.50684839395012
1.49030429811003
-7.35220605662946
5.55595382026971
4.09430516003428
3.09035124791052
-2.73785577424309
-1.42270342973413
-0.0282486564308044
2.02698307764976
5.9160879176074
72.0236485882466
81.453854796326
-52.0572978876145
0.169919584661216
3.72937016155208
-10.7997650952742
13.0092508395253
-6.30081799612901
-5.64891851702669
3.02485987880135
-0.348888715151986
-1.00583891362544
-2.69906974242491
2.24228832804863
-7.7422282761272
-10.9264201901437
0.457821897931524
-4.04936608711529
-15.0966655105968
9.167379818955
-5.08893074033716
-1.79562195850667
-7.77938240472781
2.43571872008994
-7.19705632138488
3.65530766420926
-6.51576218181549
3.37037247027303
-7.36705715169802
5.00615731099157
-2.29759045264859
2.00039410340889
18.3611402850415
29.74763579032
4.24499769939860
22.7414047961881
6.00726578235458
-4.47958975456731
-5.13183646820397
-16.6085222238934
2.96087101610163
-7.29047539755811
-5.50480523939791
1.12594177254795
7.77717166743429
-12.1523735710082
-5.71314753161306
-7.00999141172116
1.22710820456729
-6.53811314241801
-4.90622672424109
-8.73438454960586
2.23991509945114
-3.55537378483785
0.329428943754976
-0.85493804715179
4.30927711212962
-4.20466087328958
3.13748413428323
-9.00731288787841
3.0262899717888
0.777296570265946
-3.39421230606587
10.3331724375045
-18.1104957411102
6.62865256933969
18.8539565698854
5.35016492497965
-10.7127183108062
-2.13540361534467
-4.53543439448919
-7.59141397082891
7.69526844374246
0.443910421766134
-10.8298058992382
1.91939792065915
-6.94199868692471
-0.817427179528806
2.69554625246388
-1.24283609053134
-1.88980221570932
-7.38468314128465
-0.439978973091456
6.95946772481665
-8.36196481061319
-2.59063534942516
0.0127140409153412
-0.81317426495292
-2.55731554564005
-5.76196054072238
5.01490785436914
-0.487574330490077
-9.33564278996124
15.4033024405401
-1.86375164262307
-9.53896971685276
7.3049525373159
-6.40779782235336
0.470747402853817
-3.44159297519934
3.47095984413050
-5.52860112556243
18.3905979850387
-14.9837102037998
4.0983862219781
6.64257445246568
-10.2794262859934
2.08248198940521
3.08821292403883
-3.5785301001838
0.889415674812085
-8.60168970815062
-1.16938118350669
11.5513121178083
-2.3677696524731
-4.56019714943142
9.1526685276553
-6.60899930340815
-7.08832621855396
-3.82838441439492
16.4973234990597
-5.92929116288849
0.320477567417242
-3.45289384696707
-5.44564176419402
1.73881605777888
28.6007485954430
-22.8181825159368
11.6206218651629
19.7653931996173
-1.77237399054815
4.79562525112755
-9.4100708585567
17.3465038782381
-9.30702144793804
3.71784472365658
-14.5562828486824
1.74783453201519
1.45471070493767
-4.26599569849816
14.9002692005773
-6.44435596895232
4.63299204509082
-22.1382498776520
7.9099222225575
3.82478724129368
-2.92961060588715
-2.58122374904985
4.06833029299077
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/11/t1260552333qlfd6zwzk61enst/1l5ul1260552296.png (
opens in new window
)
http://www.freestatistics.org/blog/date/2009/Dec/11/t1260552333qlfd6zwzk61enst/1l5ul1260552296.ps (
opens in new window
)
Click here to open pdf file.
http://www.freestatistics.org/blog/date/2009/Dec/11/t1260552333qlfd6zwzk61enst/20x8j1260552296.png (
opens in new window
)
http://www.freestatistics.org/blog/date/2009/Dec/11/t1260552333qlfd6zwzk61enst/20x8j1260552296.ps (
opens in new window
)
Click here to open pdf file.
http://www.freestatistics.org/blog/date/2009/Dec/11/t1260552333qlfd6zwzk61enst/3x5jw1260552296.png (
opens in new window
)
http://www.freestatistics.org/blog/date/2009/Dec/11/t1260552333qlfd6zwzk61enst/3x5jw1260552296.ps (
opens in new window
)
Click here to open pdf file.
http://www.freestatistics.org/blog/date/2009/Dec/11/t1260552333qlfd6zwzk61enst/48krm1260552296.png (
opens in new window
)
http://www.freestatistics.org/blog/date/2009/Dec/11/t1260552333qlfd6zwzk61enst/48krm1260552296.ps (
opens in new window
)
Click here to open pdf file.
http://www.freestatistics.org/blog/date/2009/Dec/11/t1260552333qlfd6zwzk61enst/5caa11260552296.png (
opens in new window
)
http://www.freestatistics.org/blog/date/2009/Dec/11/t1260552333qlfd6zwzk61enst/5caa11260552296.ps (
opens in new window
)
Click here to open pdf file.
http://www.freestatistics.org/blog/date/2009/Dec/11/t1260552333qlfd6zwzk61enst/6rzp81260552296.png (
opens in new window
)
http://www.freestatistics.org/blog/date/2009/Dec/11/t1260552333qlfd6zwzk61enst/6rzp81260552296.ps (
opens in new window
)
Click here to open pdf file.
http://www.freestatistics.org/blog/date/2009/Dec/11/t1260552333qlfd6zwzk61enst/7wn0h1260552296.png (
opens in new window
)
http://www.freestatistics.org/blog/date/2009/Dec/11/t1260552333qlfd6zwzk61enst/7wn0h1260552296.ps (
opens in new window
)
Click here to open pdf file.
Parameters (Session):
par1 = FALSE ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 0 ; par9 = 0 ;
Parameters (R input):
par1 = FALSE ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 0 ; par9 = 0 ;
R code (references can be found in the
software module
):
library(lattice) if (par1 == 'TRUE') par1 <- TRUE if (par1 == 'FALSE') par1 <- FALSE par2 <- as.numeric(par2) #Box-Cox lambda transformation parameter par3 <- as.numeric(par3) #degree of non-seasonal differencing par4 <- as.numeric(par4) #degree of seasonal differencing par5 <- as.numeric(par5) #seasonal period par6 <- as.numeric(par6) #degree (p) of the non-seasonal AR(p) polynomial par6 <- 11 par7 <- as.numeric(par7) #degree (q) of the non-seasonal MA(q) polynomial par8 <- as.numeric(par8) #degree (P) of the seasonal AR(P) polynomial par9 <- as.numeric(par9) #degree (Q) of the seasonal MA(Q) polynomial armaGR <- function(arima.out, names, n){ try1 <- arima.out$coef try2 <- sqrt(diag(arima.out$var.coef)) try.data.frame <- data.frame(matrix(NA,ncol=4,nrow=length(names))) dimnames(try.data.frame) <- list(names,c('coef','std','tstat','pv')) try.data.frame[,1] <- try1 for(i in 1:length(try2)) try.data.frame[which(rownames(try.data.frame)==names(try2)[i]),2] <- try2[i] try.data.frame[,3] <- try.data.frame[,1] / try.data.frame[,2] try.data.frame[,4] <- round((1-pt(abs(try.data.frame[,3]),df=n-(length(try2)+1)))*2,5) vector <- rep(NA,length(names)) vector[is.na(try.data.frame[,4])] <- 0 maxi <- which.max(try.data.frame[,4]) continue <- max(try.data.frame[,4],na.rm=TRUE) > .05 vector[maxi] <- 0 list(summary=try.data.frame,next.vector=vector,continue=continue) } arimaSelect <- function(series, order=c(13,0,0), seasonal=list(order=c(2,0,0),period=12), include.mean=F){ nrc <- order[1]+order[3]+seasonal$order[1]+seasonal$order[3] coeff <- matrix(NA, nrow=nrc*2, ncol=nrc) pval <- matrix(NA, nrow=nrc*2, ncol=nrc) mylist <- rep(list(NULL), nrc) names <- NULL if(order[1] > 0) names <- paste('ar',1:order[1],sep='') if(order[3] > 0) names <- c( names , paste('ma',1:order[3],sep='') ) if(seasonal$order[1] > 0) names <- c(names, paste('sar',1:seasonal$order[1],sep='')) if(seasonal$order[3] > 0) names <- c(names, paste('sma',1:seasonal$order[3],sep='')) arima.out <- arima(series, order=order, seasonal=seasonal, include.mean=include.mean, method='ML') mylist[[1]] <- arima.out last.arma <- armaGR(arima.out, names, length(series)) mystop <- FALSE i <- 1 coeff[i,] <- last.arma[[1]][,1] pval [i,] <- last.arma[[1]][,4] i <- 2 aic <- arima.out$aic while(!mystop){ mylist[[i]] <- arima.out arima.out <- arima(series, order=order, seasonal=seasonal, include.mean=include.mean, method='ML', fixed=last.arma$next.vector) aic <- c(aic, arima.out$aic) last.arma <- armaGR(arima.out, names, length(series)) mystop <- !last.arma$continue coeff[i,] <- last.arma[[1]][,1] pval [i,] <- last.arma[[1]][,4] i <- i+1 } list(coeff, pval, mylist, aic=aic) } arimaSelectplot <- function(arimaSelect.out,noms,choix){ noms <- names(arimaSelect.out[[3]][[1]]$coef) coeff <- arimaSelect.out[[1]] k <- min(which(is.na(coeff[,1])))-1 coeff <- coeff[1:k,] pval <- arimaSelect.out[[2]][1:k,] aic <- arimaSelect.out$aic[1:k] coeff[coeff==0] <- NA n <- ncol(coeff) if(missing(choix)) choix <- k layout(matrix(c(1,1,1,2, 3,3,3,2, 3,3,3,4, 5,6,7,7),nr=4), widths=c(10,35,45,15), heights=c(30,30,15,15)) couleurs <- rainbow(75)[1:50]#(50) ticks <- pretty(coeff) par(mar=c(1,1,3,1)) plot(aic,k:1-.5,type='o',pch=21,bg='blue',cex=2,axes=F,lty=2,xpd=NA) points(aic[choix],k-choix+.5,pch=21,cex=4,bg=2,xpd=NA) title('aic',line=2) par(mar=c(3,0,0,0)) plot(0,axes=F,xlab='',ylab='',xlim=range(ticks),ylim=c(.1,1)) rect(xleft = min(ticks) + (0:49)/50*(max(ticks)-min(ticks)), xright = min(ticks) + (1:50)/50*(max(ticks)-min(ticks)), ytop = rep(1,50), ybottom= rep(0,50),col=couleurs,border=NA) axis(1,ticks) rect(xleft=min(ticks),xright=max(ticks),ytop=1,ybottom=0) text(mean(coeff,na.rm=T),.5,'coefficients',cex=2,font=2) par(mar=c(1,1,3,1)) image(1:n,1:k,t(coeff[k:1,]),axes=F,col=couleurs,zlim=range(ticks)) for(i in 1:n) for(j in 1:k) if(!is.na(coeff[j,i])) { if(pval[j,i]<.01) symb = 'green' else if( (pval[j,i]<.05) & (pval[j,i]>=.01)) symb = 'orange' else if( (pval[j,i]<.1) & (pval[j,i]>=.05)) symb = 'red' else symb = 'black' polygon(c(i+.5 ,i+.2 ,i+.5 ,i+.5), c(k-j+0.5,k-j+0.5,k-j+0.8,k-j+0.5), col=symb) if(j==choix) { rect(xleft=i-.5, xright=i+.5, ybottom=k-j+1.5, ytop=k-j+.5, lwd=4) text(i, k-j+1, round(coeff[j,i],2), cex=1.2, font=2) } else{ rect(xleft=i-.5,xright=i+.5,ybottom=k-j+1.5,ytop=k-j+.5) text(i,k-j+1,round(coeff[j,i],2),cex=1.2,font=1) } } axis(3,1:n,noms) par(mar=c(0.5,0,0,0.5)) plot(0,axes=F,xlab='',ylab='',type='n',xlim=c(0,8),ylim=c(-.2,.8)) cols <- c('green','orange','red','black') niv <- c('0','0.01','0.05','0.1') for(i in 0:3){ polygon(c(1+2*i ,1+2*i ,1+2*i-.5 ,1+2*i), c(.4 ,.7 , .4 , .4), col=cols[i+1]) text(2*i,0.5,niv[i+1],cex=1.5) } text(8,.5,1,cex=1.5) text(4,0,'p-value',cex=2) box() residus <- arimaSelect.out[[3]][[choix]]$res par(mar=c(1,2,4,1)) acf(residus,main='') title('acf',line=.5) par(mar=c(1,2,4,1)) pacf(residus,main='') title('pacf',line=.5) par(mar=c(2,2,4,1)) qqnorm(residus,main='') title('qq-norm',line=.5) qqline(residus) residus } if (par2 == 0) x <- log(x) if (par2 != 0) x <- x^par2 (selection <- arimaSelect(x, order=c(par6,par3,par7), seasonal=list(order=c(par8,par4,par9), period=par5))) bitmap(file='test1.png') resid <- arimaSelectplot(selection) dev.off() resid bitmap(file='test2.png') acf(resid,length(resid)/2, main='Residual Autocorrelation Function') dev.off() bitmap(file='test3.png') pacf(resid,length(resid)/2, main='Residual Partial Autocorrelation Function') dev.off() bitmap(file='test4.png') cpgram(resid, main='Residual Cumulative Periodogram') dev.off() bitmap(file='test5.png') hist(resid, main='Residual Histogram', xlab='values of Residuals') dev.off() bitmap(file='test6.png') densityplot(~resid,col='black',main='Residual Density Plot', xlab='values of Residuals') dev.off() bitmap(file='test7.png') qqnorm(resid, main='Residual Normal Q-Q Plot') qqline(resid) dev.off() ncols <- length(selection[[1]][1,]) nrows <- length(selection[[2]][,1])-1 load(file='createtable') a<-table.start() a<-table.row.start(a) a<-table.element(a,'ARIMA Parameter Estimation and Backward Selection', ncols+1,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'Iteration', header=TRUE) for (i in 1:ncols) { a<-table.element(a,names(selection[[3]][[1]]$coef)[i],header=TRUE) } a<-table.row.end(a) for (j in 1:nrows) { a<-table.row.start(a) mydum <- 'Estimates (' mydum <- paste(mydum,j) mydum <- paste(mydum,')') a<-table.element(a,mydum, header=TRUE) for (i in 1:ncols) { a<-table.element(a,round(selection[[1]][j,i],4)) } a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'(p-val)', header=TRUE) for (i in 1:ncols) { mydum <- '(' mydum <- paste(mydum,round(selection[[2]][j,i],4),sep='') mydum <- paste(mydum,')') a<-table.element(a,mydum) } a<-table.row.end(a) } a<-table.end(a) table.save(a,file='mytable.tab') a<-table.start() a<-table.row.start(a) a<-table.element(a,'Estimated ARIMA Residuals', 1,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'Value', 1,TRUE) a<-table.row.end(a) for (i in (par4*par5+par3):length(resid)) { a<-table.row.start(a) a<-table.element(a,resid[i]) a<-table.row.end(a) } a<-table.end(a) table.save(a,file='mytable1.tab')