Home » date » 2010 » Dec » 20 »

*The author of this computation has been verified*
R Software Module: /rwasp_structuraltimeseries.wasp (opens new window with default values)
Title produced by software: Structural Time Series Models
Date of computation: Mon, 20 Dec 2010 10:31:38 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Dec/20/t1292840969j0s7i9048j0im4p.htm/, Retrieved Mon, 20 Dec 2010 11:29:30 +0100
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2010/Dec/20/t1292840969j0s7i9048j0im4p.htm/},
    year = {2010},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2010},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
377 370 358 357 349 348 369 381 368 361 351 351 358 354 347 345 343 340 362 370 373 371 354 357 363 364 363 358 357 357 380 378 376 380 379 384 392 394 392 396 392 396 419 421 420 418 410 418 426 428 430 424 423 427 441 449 452 462 455 461 461 463 462 456 455 456 472 472 471 465 459 465 468 467 463 460 462 461 476 476 471 453 443 442 444 438 427 424 416 406 431 434 418 412 404 409 412 406 398 397 385 390 413 413 401 397 397 409 419 424 428 430 424 433 456 459 446 441 439 454 460 457 451 444 437 443 471 469 454 444 436
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
1377377000
2370370.77182044338-0.364085612821178-0.771820443379732-0.819667559650175
3358360.893609121638-0.857495727577432-2.89360912163831-1.91355436444758
4357357.415620668051-0.996056511308958-0.415620668050982-0.539604561315922
5349350.83970524568-1.3543561783321-1.83970524567983-1.13564667380614
6348348.360025830901-1.44026926413622-0.360025830900925-0.226985859116976
7369364.7482234550950.1009728281021774.251776544904943.56919909301561
8381379.3929570534731.476216282089541.607042946527412.89325467655363
9368372.15219226710.595226720096757-4.15219226710039-1.72504910273599
10361363.204447308049-0.418766238031085-2.204447308049-1.88047706531214
11351353.165321518602-1.48041460255603-2.16532151860176-1.8892437940748
12351350.892383082871-1.57041605225840.107616917128553-0.155211143839857
13358351.32485023196-1.368107284544466.67514976803990.438266450244164
14354352.076002270524-1.114035257940261.923997729476480.380781257302718
15347349.954315608161-1.23557568771516-2.95431560816111-0.188602799786637
16345345.006621479103-1.68137150246395-0.00662147910329645-0.718323472570808
17343343.587009975268-1.6498889856861-0.5870099752676220.0504900209587586
18340343.61466339716-1.4471591093792-3.614663397160230.323004817281015
19362356.6896269993250.3164402777313475.310373000675482.79584782160258
20370365.6406086248831.369044945946144.359391375117121.66223839209093
21373374.0996304704162.23583511633671-1.099630470415571.36477277648142
22371373.1356180140361.84376353855187-2.13561801403576-0.615951608616155
23354360.6058709082420.081014947189498-6.60587090824167-2.76472101998357
24357357.189883569378-0.346286523988329-0.189883569377656-0.67185312408269
25363356.594075456645-0.3765630144315256.40592454335518-0.049795096296961
26364360.2355728215240.1172629992436063.764427178475780.757845195309938
27363363.812074382430.541118643961598-0.8120743824299710.649314572456457
28358359.50948449846-0.052734660459822-1.50948449846026-0.929504086686762
29357357.956856502646-0.236887098776109-0.95685650264629-0.287984504425376
30357362.4871316051390.34855666508877-5.487131605138880.913195549643585
31380373.7761420961451.69217680284276.223857903855352.09542913377379
32378376.4809473158761.816559643229431.519052684123680.194039986755237
33376376.9677230368411.65318516910728-0.967723036840695-0.25491793623416
34380378.3622620522331.621406728816121.63773794776696-0.0495799181184586
35379383.3581793870282.03569926364257-4.358179387028180.646020970100626
36384384.6974995056241.9503842862427-0.697499505623628-0.13362166335584
37392386.7819784663611.966813102896195.21802153363940.0261408019573997
38394390.366705751192.165458930816363.633294248810440.308168360185925
39392391.5849326704522.049518836930860.415067329547941-0.178795550749138
40396396.0481688788262.34498936057412-0.04816887882604750.461538675977981
41392395.6572311463162.00947837623672-3.6572311463158-0.524664089560504
42396402.5845592810252.61296206357534-6.584559281025220.941174230757757
43419411.1889088575623.348152154296087.811091142437531.14575356941826
44421418.2226450048763.80036807879812.777354995124110.704988509357126
45420421.5408739656663.74121033224067-1.54087396566616-0.092251729837293
46418419.4203452013033.02210563705586-1.42034520130258-1.12115410578939
47410416.0460671700862.23801765568379-6.04606717008585-1.22241688976023
48418418.2611139277052.23520472976684-0.261113927705485-0.00440541806308474
49426420.8810398153432.282353041943045.118960184657270.0743092737279108
50428423.7900140258642.359201281855884.209985974136070.119580913899457
51430428.9668462713612.70400928429921.033153728639090.533780219947932
52424425.6392029445561.96619549060588-1.63920294455554-1.15113009152482
53423427.794529983481.98936070280676-4.794529983480160.0362267310518663
54427434.0068827409562.5070123665471-7.006882740955970.80792065169002
55441435.1479922254122.339566535514135.85200777458842-0.261032918501219
56449443.7180242512513.103290009858075.281975748748921.19051788788743
57452450.7461213821343.58434736569211.25387861786570.749950498681144
58462459.9615216192884.274349097267692.038478380711571.0754619111606
59455462.2472564961824.03083406243002-7.24725649618191-0.379776504009806
60461462.7023220821683.59316567385327-1.70232208216846-0.685217858541987
61461458.7766028221352.672145119063282.22339717786457-1.44567609583215
62463459.4892333610392.432032659845923.51076663896065-0.374004328178865
63462459.6966477940252.159833946388932.30335220597479-0.422337765361319
64456458.57813900311.75894162609772-2.57813900310029-0.625057931716198
65455460.3843089979771.76472168977558-5.38430899797650.00903628424572416
66456462.5141352277321.80943856374319-6.514135227731870.069828509226207
67472467.0403432514982.142240123334074.959656748502170.519007671322199
68472468.5598507871332.065961830050333.4401492128667-0.118904411124607
69471471.2228399539362.1390804674289-0.2228399539361870.113962276449176
70465465.3779433410811.16159236816581-0.377943341080785-1.52337964930848
71459465.1102968986250.986698782633627-6.11029689862496-0.27284469344212
72465464.9041569072950.8407537716875470.095843092705268-0.228380088120873
73468465.2030700434260.7744145190336582.79692995657397-0.103908823073392
74467463.4997048371490.4709920299451053.50029516285095-0.472817491477764
75463460.7149842377360.07271654564931032.28501576226447-0.618844746909385
76460461.963511666720.216469654198623-1.963511666719550.224072916997709
77462466.2311796310620.71200826329687-4.231179631061890.774399137178819
78461468.1498776677990.859704521590386-7.149877667798670.230700766303188
79476470.5342591198061.046365493550925.465740880193680.291194156305576
80476472.3314467997721.138280708399123.668553200228480.143283764387947
81471470.2277512161710.7414775972156220.77224878382903-0.618361931042568
82453457.613439884611-0.89264850803403-4.61343988461131-2.54673025457714
83443450.294990766958-1.67856596034968-7.2949907669579-1.22633383089189
84442443.169469633218-2.34478253898502-1.16946963321799-1.04200783037378
85444440.150113751741-2.427335434762853.84988624825905-0.129145953899806
86438434.589412651668-2.810837481311473.41058734833206-0.597741884616217
87427426.756398117148-3.425052488001540.243601882851705-0.955282341767888
88424425.940663608999-3.10610261904724-1.940663608999230.497121782484273
89416421.427165284535-3.27818470621251-5.42716528453461-0.26882400381483
90406414.923467592817-3.67277887304397-8.92346759281678-0.616406772481001
91431421.831706341288-2.378014792182819.168293658712182.02031356674395
92434426.947223948541-1.461093792869457.052776051459491.42943278590965
93418416.869559562373-2.515200172729521.13044043762744-1.64257234565825
94412414.271739515864-2.52530406171486-2.27173951586367-0.015747501774449
95404410.366231823789-2.69404714138637-6.36623182378885-0.263332374531435
96409409.22075434622-2.50469851032565-0.2207543462196170.29602569033092
97412406.982911665032-2.472054234232265.017088334967640.0510294650765298
98406402.070506644262-2.770604674506323.92949335573771-0.465403965078753
99398398.457860671294-2.87356026566692-0.457860671294424-0.160231321976855
100397397.556668923814-2.63251292740968-0.5566689238136820.375710414754938
101385391.380899274974-3.06561020495785-6.38089927497433-0.676378661957069
102390398.412677184335-1.83085258605721-8.412677184335031.9287900953799
103413403.634772097366-0.9681629470030749.365227902633731.34630156421877
104413403.594187556936-0.8547081165357789.405812443064160.176881487629252
105401400.659750006732-1.109028649064650.340249993268361-0.396299940547861
106397399.088927178462-1.16548159281065-2.08892717846199-0.087992563025745
107397402.268280572463-0.634446023318783-5.26828057246290.8287398188054
108409407.3337031372590.0623082294693261.666296862741221.08889843578405
109419411.8581016561680.6079622008260457.141898343832010.852527948642628
110424418.0246457798091.287740221054195.975354220190621.05981250206448
111428426.5089025042292.167434541354711.491097495771411.36973309683167
112430429.9444231037432.322382436406130.05557689625654040.241526792630361
113424433.2811118438452.44633089993157-9.28111184384520.193527956233552
114433441.4354581745223.14409920473569-8.435458174521651.08986481447066
115456446.3842786345673.364768318124779.615721365433270.344395841259839
116459449.1486788429593.291360497393229.8513211570414-0.11445405523389
117446447.3528278281162.66947573471673-1.35282782811619-0.96911579267617
118441445.6790406225492.13868614165583-4.67904062254922-0.827410190793463
119439446.2531480692451.94750731670341-7.25314806924458-0.298354125337589
120454452.2054319619332.436935973902931.794568038066640.764651870631468
121460454.8370971145992.46074151869135.162902885401340.0371803987763305
122457454.1966845736842.081611878140392.80331542631626-0.591138382960509
123451451.4691648020831.49388222389752-0.469164802083169-0.915454023901634
124444446.5707536539160.712934872938267-2.57075365391579-1.21740888983367
125437447.5886435670130.750192576524574-10.58864356701320.058161869203174
126443451.0205102900821.07791880795666-8.020510290082330.511819873914855
127471458.7409417736731.8898772496072212.25905822632681.26723397921852
128469458.6133195827341.6432666913868410.3866804172657-0.384529323267877
129454455.6503263290311.08033099232356-1.65032632903076-0.877323910597753
130444450.5103864885160.320338132477274-6.51038648851589-1.18480272773939
131436445.92693724783-0.278741832755345-9.9269372478295-0.93489805075211
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/20/t1292840969j0s7i9048j0im4p/1dikr1292841093.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/20/t1292840969j0s7i9048j0im4p/1dikr1292841093.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/20/t1292840969j0s7i9048j0im4p/26rkc1292841093.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/20/t1292840969j0s7i9048j0im4p/26rkc1292841093.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/20/t1292840969j0s7i9048j0im4p/36rkc1292841093.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/20/t1292840969j0s7i9048j0im4p/36rkc1292841093.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/20/t1292840969j0s7i9048j0im4p/4yi1f1292841093.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/20/t1292840969j0s7i9048j0im4p/4yi1f1292841093.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/20/t1292840969j0s7i9048j0im4p/5yi1f1292841093.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/20/t1292840969j0s7i9048j0im4p/5yi1f1292841093.ps (open in new window)


 
Parameters (Session):
par1 = 12 ;
 
Parameters (R input):
par1 = 12 ;
 
R code (references can be found in the software module):
par1 <- as.numeric(par1)
nx <- length(x)
x <- ts(x,frequency=par1)
m <- StructTS(x,type='BSM')
m$coef
m$fitted
m$resid
mylevel <- as.numeric(m$fitted[,'level'])
myslope <- as.numeric(m$fitted[,'slope'])
myseas <- as.numeric(m$fitted[,'sea'])
myresid <- as.numeric(m$resid)
myfit <- mylevel+myseas
mylagmax <- nx/2
bitmap(file='test2.png')
op <- par(mfrow = c(2,2))
acf(as.numeric(x),lag.max = mylagmax,main='Observed')
acf(mylevel,na.action=na.pass,lag.max = mylagmax,main='Level')
acf(myseas,na.action=na.pass,lag.max = mylagmax,main='Seasonal')
acf(myresid,na.action=na.pass,lag.max = mylagmax,main='Standardized Residals')
par(op)
dev.off()
bitmap(file='test3.png')
op <- par(mfrow = c(2,2))
spectrum(as.numeric(x),main='Observed')
spectrum(mylevel,main='Level')
spectrum(myseas,main='Seasonal')
spectrum(myresid,main='Standardized Residals')
par(op)
dev.off()
bitmap(file='test4.png')
op <- par(mfrow = c(2,2))
cpgram(as.numeric(x),main='Observed')
cpgram(mylevel,main='Level')
cpgram(myseas,main='Seasonal')
cpgram(myresid,main='Standardized Residals')
par(op)
dev.off()
bitmap(file='test1.png')
plot(as.numeric(m$resid),main='Standardized Residuals',ylab='Residuals',xlab='time',type='b')
grid()
dev.off()
bitmap(file='test5.png')
op <- par(mfrow = c(2,2))
hist(m$resid,main='Residual Histogram')
plot(density(m$resid),main='Residual Kernel Density')
qqnorm(m$resid,main='Residual Normal QQ Plot')
qqline(m$resid)
plot(m$resid^2, myfit^2,main='Sq.Resid vs. Sq.Fit',xlab='Squared residuals',ylab='Squared Fit')
par(op)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Structural Time Series Model',6,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'t',header=TRUE)
a<-table.element(a,'Observed',header=TRUE)
a<-table.element(a,'Level',header=TRUE)
a<-table.element(a,'Slope',header=TRUE)
a<-table.element(a,'Seasonal',header=TRUE)
a<-table.element(a,'Stand. Residuals',header=TRUE)
a<-table.row.end(a)
for (i in 1:nx) {
a<-table.row.start(a)
a<-table.element(a,i,header=TRUE)
a<-table.element(a,x[i])
a<-table.element(a,mylevel[i])
a<-table.element(a,myslope[i])
a<-table.element(a,myseas[i])
a<-table.element(a,myresid[i])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable.tab')
 





Copyright

Creative Commons License

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

Software written by Ed van Stee & Patrick Wessa


Disclaimer

Information provided on this web site is provided "AS IS" without warranty of any kind, either express or implied, including, without limitation, warranties of merchantability, fitness for a particular purpose, and noninfringement. We use reasonable efforts to include accurate and timely information and periodically update the information, and software without notice. However, we make no warranties or representations as to the accuracy or completeness of such information (or software), and we assume no liability or responsibility for errors or omissions in the content of this web site, or any software bugs in online applications. Your use of this web site is AT YOUR OWN RISK. Under no circumstances and under no legal theory shall we be liable to you or any other person for any direct, indirect, special, incidental, exemplary, or consequential damages arising from your access to, or use of, this web site.


Privacy Policy

We may request personal information to be submitted to our servers in order to be able to:

  • personalize online software applications according to your needs
  • enforce strict security rules with respect to the data that you upload (e.g. statistical data)
  • manage user sessions of online applications
  • alert you about important changes or upgrades in resources or applications

We NEVER allow other companies to directly offer registered users information about their products and services. Banner references and hyperlinks of third parties NEVER contain any personal data of the visitor.

We do NOT sell, nor transmit by any means, personal information, nor statistical data series uploaded by you to third parties.

We carefully protect your data from loss, misuse, alteration, and destruction. However, at any time, and under any circumstance you are solely responsible for managing your passwords, and keeping them secret.

We store a unique ANONYMOUS USER ID in the form of a small 'Cookie' on your computer. This allows us to track your progress when using this website which is necessary to create state-dependent features. The cookie is used for NO OTHER PURPOSE. At any time you may opt to disallow cookies from this website - this will not affect other features of this website.

We examine cookies that are used by third-parties (banner and online ads) very closely: abuse from third-parties automatically results in termination of the advertising contract without refund. We have very good reason to believe that the cookies that are produced by third parties (banner ads) do NOT cause any privacy or security risk.

FreeStatistics.org is safe. There is no need to download any software to use the applications and services contained in this website. Hence, your system's security is not compromised by their use, and your personal data - other than data you submit in the account application form, and the user-agent information that is transmitted by your browser - is never transmitted to our servers.

As a general rule, we do not log on-line behavior of individuals (other than normal logging of webserver 'hits'). However, in cases of abuse, hacking, unauthorized access, Denial of Service attacks, illegal copying, hotlinking, non-compliance with international webstandards (such as robots.txt), or any other harmful behavior, our system engineers are empowered to log, track, identify, publish, and ban misbehaving individuals - even if this leads to ban entire blocks of IP addresses, or disclosing user's identity.


FreeStatistics.org is powered by