Home » date » 2010 » Dec » 28 »

*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: Tue, 28 Dec 2010 10:42:50 +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/28/t1293533028f9ooalxq6jgu2zi.htm/, Retrieved Tue, 28 Dec 2010 11:43:54 +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/28/t1293533028f9ooalxq6jgu2zi.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 «
655362 873127 1107897 1555964 1671159 1493308 2957796 2638691 1305669 1280496 921900 867888 652586 913831 1108544 1555827 1699283 1509458 3268975 2425016 1312703 1365498 934453 775019 651142 843192 1146766 1652601 1465906 1652734 2922334 2702805 1458956 1410363 1019279 936574 708917 885295 1099663 1576220 1487870 1488635 2882530 2677026 1404398 1344370 936865 872705 628151 953712 1160384 1400618 1661511 1495347 2918786 2775677 1407026 1370199 964526 850851 683118 847224 1073256 1514326 1503734 1507712 2865698 2788128 1391596 1366378 946295 859626
 
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'Gwilym Jenkins' @ 72.249.127.135


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
1655362655362000
2873127804406.285730027154723.68343579468720.71426997270.792697786821828
311078971106300.64103651252402.5242667991596.35896348690.434957272742389
415559641514241.73925271361658.42190053541722.26074728750.490125218490501
516711591734860.34344928263973.653008982-63701.3434492812-0.413797699272963
614933081606381.3245862-4624.93070922245-113073.324586201-1.14966332958283
729577962589589.26262942673905.456188023368206.7373705762.90713365936900
826386912870691.93217134403718.853278761-232000.932171341-1.15615675723536
913056691764653.79148623-634755.586934305-458984.791486227-4.44411005156445
1012804961125357.46497959-637878.217048106155138.535020414-0.0133632996398641
11921900813555.896314699-413672.590087513108344.1036853010.959470907078068
12867888776975.173500372-154394.41513097390912.8264996281.10956300157995
13652586674263.051614344-118967.082874995-21677.05161434360.152133710391677
14913831817118.30747920861258.590857129296712.6925207920.783697800299816
1511085441100837.21270453209625.3843289847706.787295470840.630196206051504
1615558271402058.79522844270175.015422369153768.2047715590.263216819291442
1716992831685824.29326389279252.41820775413458.70673610820.0389642270491927
1815094582025952.91210091319595.247558002-516494.9121009080.172020794623345
1932689752693984.95255166549922.975517657574990.0474483360.986118487001621
2024250162455590.5474617927803.9000785844-30574.5474617950-2.23553745599879
2113127031887240.71049179-367364.840682602-574537.710491789-1.69095084036959
2213654981322291.45042066-498337.7880842743206.5495793387-0.56052309358586
23934453883149.563472569-459116.91024800151303.4365274310.167847776186944
24775019614397.061963756-333135.144410646160621.9380362440.539355036853022
25651142633505.38111326-99975.476758447117636.61888674051.00094348095493
26843192752375.1384769245074.423835702490816.86152308070.621717087192154
2711467661071980.15866668225370.49593516774785.84133331690.769405225037162
2816526011471062.66692537338941.269568832181538.3330746280.488287288313136
2914659061626318.17121237218206.590290659-160412.171212373-0.518534370758853
3016527342205887.04772438455393.041312502-553153.0477243841.01320223921361
3129223342258299.19082140191716.798301726664034.809178603-1.12747131346868
3227028052485325.21462377214831.185691687217479.7853762260.0989512068727316
3314589562139065.58578316-152861.924261836-680109.585783157-1.57359291035739
3414103631487508.54590282-479723.888368583-77145.5459028232-1.39878277247667
351019279985788.802204873-494133.65946335433490.1977951272-0.0616689736602361
36936574774886.575725905-308681.219509099161687.4242740950.79421395774286
37708917691302.923382195-161180.387582717614.07661780500.632314884873522
38885295800990.6696077716266.182453737084304.33039222970.759309206825336
3910996631017114.01883775146601.34534249982548.9811622480.557010075370487
4015762201322724.97451576250074.735001702253495.0254842440.443697283395574
4114878701748618.91718001364798.299043137-260748.9171800120.492143367464302
4214886352010215.69909771297435.387932727-521580.699097708-0.288124852859087
4328825302267215.05333694271094.361359321615314.946663062-0.112615994237108
4426770262324713.89115924132015.684770908352312.108840758-0.595133427404052
4514043982019831.92600212-152644.443415346-615433.92600212-1.21828661742676
4613443701491863.05342577-397249.244480888-147493.053425775-1.04681171889161
47936865991231.006925688-464609.907957584-54366.0069256883-0.288319993519011
48872705704400.332736259-348773.915920572168304.6672637410.496064698220531
49628151609708.905283165-183123.00447095318442.09471683480.709492600952514
50953712811251.92351592667500.5843725041142460.0764840741.07209027581935
5111603841091172.38151680205525.40154008169211.61848320140.590213562923718
5214006181248644.16569597174338.279100505151973.834304031-0.133612469497581
5316615111797784.55968851417973.371191647-136273.5596885131.04435187600874
5414953472109124.00036111348610.229218776-613777.000361107-0.296844019695559
5529187862296705.38818896243985.542129311622080.611811039-0.447395876638402
5627756772327785.81065524105763.618165130447891.189344763-0.591320949131602
5714070261999944.58645493-175778.847318824-592918.586454928-1.20487958506547
5813701991527005.27346226-368766.867424514-156806.273462259-0.825997990953125
599645261068224.35481020-427227.557583701-103698.354810196-0.250262185271716
60850851726189.256137018-371883.91773934124661.7438629820.236982880845807
61683118681906.498318281-158988.640218111211.501681719150.9114208826073
62847224711405.312438976-36586.6640156648135818.6875610240.523566333984858
631073256929423.35132979128451.277713616143832.6486702110.705916075044084
6415143261412776.70752070358337.199943239101549.2924793040.984508098733805
6515037341684675.44206594302288.600588527-180941.442065942-0.240149787659462
6615077122069108.48627377355589.330451279-561396.4862737750.228154299283835
6728656982249922.92165048242260.618262726615775.078349524-0.484722186461353
6827881282252724.5518505987120.3993972594535403.44814941-0.663634973325712
6913915961969764.57690924-152592.232197099-578168.576909244-1.02579742665646
7013663781535961.6943205-334761.579187746-169583.694320501-0.779759955153367
719462951084296.47693913-410508.134465556-138001.476939130-0.324294331167833
72859626782388.217916578-340116.39827475777237.78208342240.301390911931582
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/28/t1293533028f9ooalxq6jgu2zi/1fsdf1293532966.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/28/t1293533028f9ooalxq6jgu2zi/1fsdf1293532966.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/28/t1293533028f9ooalxq6jgu2zi/28kci1293532966.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/28/t1293533028f9ooalxq6jgu2zi/28kci1293532966.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/28/t1293533028f9ooalxq6jgu2zi/3jtt31293532966.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/28/t1293533028f9ooalxq6jgu2zi/3jtt31293532966.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/28/t1293533028f9ooalxq6jgu2zi/4jtt31293532966.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/28/t1293533028f9ooalxq6jgu2zi/4jtt31293532966.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/28/t1293533028f9ooalxq6jgu2zi/5tks61293532966.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/28/t1293533028f9ooalxq6jgu2zi/5tks61293532966.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