Home » date » 2010 » Dec » 24 »

*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: Fri, 24 Dec 2010 11:10:31 +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/24/t1293188893qoxsjx76i8i2w2u.htm/, Retrieved Fri, 24 Dec 2010 12:08:13 +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/24/t1293188893qoxsjx76i8i2w2u.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 «
6.4 7.7 9.2 8.6 7.4 8.6 6.2 6 6.6 5.1 4.7 5 3.6 1.9 -0.1 -5.7 -5.6 -6.4 -7.7 -8 -11.9 -15.4 -15.5 -13.4 -10.9 -10.8 -7.3 -6.5 -5.1 -5.3 -6.8 -8.4 -8.4 -9.7 -8.8 -9.6 -11.5 -11 -14.9 -16.2 -14.4 -17.3 -15.7 -12.6 -9.4 -8.1 -5.4 -4.6 -4.9 -4 -3.1 -1.3 0 -0.4 3 0.4 1.2 0.6 -1.3 -3.2 -1.8 -3.6 -4.2 -6.9 -8 -7.5 -8.2 -7.6 -3.7 -1.7 -0.7 0.2 0.6 2.2 3.3 5.3 5.5 6.3 7.7 6.5 5.5 6.9 5.7 6.9 6.1 4.8 3.7 5.8 6.8 8.5 7.2 5 4.7 2.3 2.4 0.1 1.9 1.7 2 -1.9 0.5 -1.3 -3.3 -2.8 -8 -13.9 -21.9 -28.8 -27.6 -31.4 -31.8 -29.4 -27.6 -23.6 -22.8 -18.2 -17.8 -14.2 -8.8 -7.9 -7 -7 -3.6 -2.4 -4.9 -7.7 -6.5 -5.1 -3.4 -2.8 0.8
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
16.46.4000
27.77.603802757261530.1887969340208550.06046627218901260.466507988564282
39.29.073122032211130.6624066158636850.05618727981487490.667912037000793
48.68.596320437772910.1931580211046940.0613129984471699-0.567268451881281
57.47.40350209897595-0.3946414878460670.065088302310559-0.682808893518477
68.68.465473510978070.2288674767659280.06286374815294740.715807502377138
76.26.2549116996384-0.8186085457940430.0649266987924918-1.19824534535687
865.91193627672651-0.6141453088836270.0647045034891170.233638492231172
96.66.4776540500291-0.1067295425569450.06440019985151750.579627784896738
105.15.09794107320545-0.6542939737078850.0645814307154015-0.625427000041763
114.74.62645397989651-0.5756542751330320.06456706576667650.0898193447160561
1254.894050215296-0.2128904392433950.06453049320170870.41433150710664
133.64.41941638597563-0.321731944507249-0.806996822707501-0.146992399363553
141.91.94423572821245-1.166950005926840.0252698381774235-0.859979170687236
15-0.1-0.0842640279499554-1.538701627977550.0264650527868505-0.422438482659356
16-5.7-5.54233803705323-3.227355523385090.0339688449372715-1.91944138627479
17-5.6-5.77719360453071-1.939964503434600.03051485660602181.46797129717789
18-6.4-6.48994660682633-1.412154206732730.02972272732008240.602529673355523
19-7.7-7.73773419040903-1.341458636511390.02966404489161830.0807321861188502
20-8-8.0786051773133-0.9110598611893040.02946679766242500.491555539518069
21-11.9-11.7921291628312-2.116607893045960.0297717431203848-1.37689374777000
22-15.4-15.3586430154831-2.740346295605830.0298588226819208-0.712398115841548
23-15.5-15.6500661745556-1.686812232556420.02977764541773581.20328967775168
24-13.4-13.6126428638747-0.08461217852941460.02970950985896941.82994803291517
25-10.9-11.14478798551620.996119280065350.1214257645168361.34374156542834
26-10.8-10.75691756284090.74932618665675-0.0198529805423151-0.263981665850402
27-7.3-7.405387031395351.87099634543777-0.02220138777817091.27687557708577
28-6.5-6.434824931213061.48324423571604-0.0210785320077307-0.441486069015543
29-5.1-5.07305425820741.43098513410308-0.0209872059809898-0.0596236445878037
30-5.3-5.203040780639690.759558706338779-0.0203309687623448-0.766613257124456
31-6.8-6.67081129725204-0.198519468904899-0.0198130799609372-1.09415555439157
32-8.4-8.30963366552282-0.818095593866202-0.0196281757747800-0.707625438290224
33-8.4-8.41531298878417-0.511621850147074-0.01967865827060160.350034921944936
34-9.7-9.64507536418977-0.820566533582286-0.0196505713794382-0.352859384354870
35-8.8-8.85922137387733-0.129471846451820-0.01968524764864850.789331377077581
36-9.6-9.55262130986432-0.372080371855951-0.0196785291527574-0.277094646228957
37-11.5-11.4645305222624-1.027672832399630.0393711461505852-0.792636157370212
38-11-11.0700274898158-0.4415884792916590.01167377408605230.639489607250994
39-14.9-14.7547535956884-1.838834179781830.0138428778402815-1.59194703226260
40-16.2-16.2312655516052-1.682846617782300.01350784815095480.177747857925857
41-14.4-14.5754730317516-0.2465255659995610.01164659307836601.63918703337121
42-17.3-17.1958359423766-1.267643940405840.0123865771590610-1.16598052847565
43-15.7-15.8407370743436-0.1394323252265270.01193441092179281.28848712795872
44-12.6-12.76932999226751.241815061142540.01162878379440681.57755207633975
45-9.4-9.510589798426972.109488807202510.01152281664406220.991004475837045
46-8.1-8.078280009862631.818163001234350.0115424533582531-0.332736332175885
47-5.4-5.451260392250422.166141339264180.01152950800709920.397442330178966
48-4.6-4.549437147576561.622215110419740.0115406759396499-0.621243858109478
49-4.9-4.554596184180160.927487517029764-0.266092189475626-0.828188779853126
50-4-4.004845294825080.7704093954528610.0209746348785859-0.173226027416277
51-3.1-3.126226730710450.8170156323545330.02091714488599010.0531274699942224
52-1.3-1.366451141803791.222835185306080.02022445426493590.462652015815929
530-0.02594752558238561.273457629814660.02017232873103140.0577817943494162
54-0.4-0.3424928284049640.5894895172285660.0205661624114972-0.781039579130078
5532.851860320288301.710038001519360.02020933193595841.27975514218800
560.40.575296522978114-0.004956923857749810.0205108441102944-1.95874147957381
571.21.150992646220190.2448403249556920.02048660462572790.285303719235541
580.60.61771612671021-0.08991133371508980.0205045326871962-0.382335122732968
59-1.3-1.23398772886313-0.8478548077616570.0205269363545627-0.86568279589298
60-3.2-3.16722049849946-1.31479947875590.0205345539667284-0.533319603492941
61-1.8-1.87838109882391-0.201540844111999-0.04871420064517821.31588969490328
62-3.6-3.53065180587113-0.808379388946135-0.00580922992567405-0.673673904938567
63-4.2-4.20090852513943-0.74890075762594-0.005870094713753140.0678235527845756
64-6.9-6.8043007852979-1.54710687156649-0.00473969329204041-0.910275862911133
65-8-8.01180559335525-1.40100553141641-0.004864498688495220.166781878100931
66-7.5-7.58453842785194-0.614526156320503-0.00524018155112360.898129607462122
67-8.2-8.19496089869986-0.612760822486348-0.00524064789960850.00201617163498521
68-7.6-7.65147812230554-0.115351409309629-0.005313192825612750.568106331057676
69-3.7-3.885212663675721.55453302835629-0.00544761556649531.90724555060352
70-1.7-1.724324727224331.81539239647266-0.00545920514125370.297939456533914
71-0.7-0.657765924107321.49323486413477-0.00545130561555192-0.367951261981779
720.20.2349457066627051.23488112582282-0.00544780923576579-0.295078037120003
730.60.6287067662469880.8748603695363940.0123957376526022-0.423138823595452
742.22.167529299387671.153750519000220.002874442914521120.311009825169212
753.33.298247391024861.143833612916130.00288311403698353-0.0113109255236458
765.35.257536344872121.494796236146180.002458421753121930.400327640454205
775.55.555901120927050.9800748421353970.00283410273423844-0.587624661311565
786.36.308306298478080.8821354259867090.00287407409679779-0.111845741912317
797.77.673450068245161.089919595197740.00282717653001320.237310113945621
806.56.6031612731210.1606031508152460.00294297685934762-1.06140274669048
815.55.55632935643467-0.3588417975254060.00297870238945125-0.593280414062778
826.96.817474359245320.3380930251284860.002952247499402950.796001409494349
835.75.76532419435288-0.2600077924556360.00296477775202967-0.683119102364486
846.96.831880503066280.3106996535462610.00295817887423910.651832008419736
856.16.22203474826827-0.0836096247457896-0.0770170873189704-0.461557479171838
864.84.85757010912065-0.6232800855593360.000266148029649547-0.603802782043617
873.73.72458667079312-0.8427169560347240.000433622957724666-0.250327105928739
885.85.664306528584940.354751222629176-0.000831318129472011.36612622875762
896.86.764440575036780.675425527135285-0.001035625040191380.366114277832437
908.58.451509377230331.11062083145818-0.001190663616023160.496997040758866
917.27.31153852209490.142435951647924-0.000999916560964622-1.10576904094341
9255.11573987125026-0.863472666927765-0.000890504386909045-1.14888306271052
934.74.67989671006126-0.679503564105113-0.0009015488539624550.210119128910024
942.32.38044988431253-1.37642103009318-0.000878457159913245-0.795981706860443
952.42.33548739493846-0.803609500005544-0.0008889322510694890.654235046842367
960.10.167882985706366-1.39042059718936-0.000883009609001514-0.670224760732735
971.91.6303092091751-0.1677464994624560.1300987964108661.42683113296707
981.71.69989710663353-0.0675107301982554-0.01072019242212560.112427027807016
9921.993116510202880.0877780811394915-0.01082534324043140.177173005894065
100-1.9-1.70492141531801-1.54144713198587-0.0092983155039725-1.85893342897724
1010.50.334360818407338-0.000965313993765508-0.01016911618991851.75884763074481
102-1.3-1.21404532145824-0.666658797649266-0.0099587058193209-0.760238463763401
103-3.3-3.22415734074427-1.24460451343108-0.00985768242098883-0.660077593260864
104-2.8-2.86866966417225-0.556241754926039-0.009924111661472530.786203940181916
105-8-7.77643154268564-2.42830007254806-0.00982439818146275-2.13816020857631
106-13.9-13.7176648624865-3.93960502580483-0.00977996973532293-1.72613156774375
107-21.9-21.6920583157117-5.67542725072353-0.00975180628492066-1.98256444882152
108-28.8-28.7236386049055-6.25886493865877-0.00974658176728158-0.66637183746955
109-27.6-28.2858563707992-3.387581872793460.3580413814078613.34275537022097
110-31.4-31.3820633686062-3.26428959234133-0.03132819632140160.138558280510251
111-31.8-31.9026538566709-2.08324356300299-0.03204688740164831.34763206552816
112-29.4-29.5824666239146-0.188287265384134-0.033643053728542.16235231560535
113-27.6-27.66909077215450.715879249778494-0.03410236894629831.03236986409788
114-23.6-23.72409080657542.10502331968948-0.0344969493846071.58645424436042
115-22.8-22.71190083863241.63489029055794-0.0344230995358375-0.536945429063395
116-18.2-18.30178816724652.82880052969295-0.03452663927322151.3636093379913
117-17.8-17.65818262248201.88871040748318-0.0344816408484821-1.07371864079225
118-14.2-14.24059927300862.54645022223412-0.03449901711338640.751235256601043
119-8.8-8.902604958025853.74741223008509-0.03451652779898821.37167540268165
120-7.9-7.738594569926472.63599299167445-0.0345075839822455-1.26940460288320
121-7-7.20577546358481.733918510372150.308766062995488-1.04819861025028
122-7-6.900422726037321.12850359708754-0.0335042709891022-0.681448877892028
123-3.6-3.669231258540142.03357490008093-0.03400435152442781.03282265515809
124-2.4-2.332045030495571.73390120246519-0.033775148349878-0.341989071353872
125-4.9-4.66722987456049-0.0166804985108977-0.0329676766363624-1.99885703693101
126-7.7-7.5276828892239-1.24005692541326-0.0326521565820421-1.39715383747115
127-6.5-6.57491771303776-0.296708522388085-0.03278670491970321.07741417012446
128-5.1-5.151638602804770.443238211371043-0.03284497060186950.84512141448727
129-3.4-3.429929151936020.993248742588917-0.03286887488409180.628191590146622
130-2.8-2.751662431234230.857739494663727-0.0328656243997475-0.154771431141281
1310.80.7052101529453841.97592417743159-0.03288042789457581.27713154190420
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/24/t1293188893qoxsjx76i8i2w2u/153hk1293189026.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/24/t1293188893qoxsjx76i8i2w2u/153hk1293189026.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/24/t1293188893qoxsjx76i8i2w2u/2fuhn1293189026.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/24/t1293188893qoxsjx76i8i2w2u/2fuhn1293189026.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/24/t1293188893qoxsjx76i8i2w2u/3fuhn1293189026.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/24/t1293188893qoxsjx76i8i2w2u/3fuhn1293189026.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/24/t1293188893qoxsjx76i8i2w2u/48myq1293189026.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/24/t1293188893qoxsjx76i8i2w2u/48myq1293189026.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/24/t1293188893qoxsjx76i8i2w2u/58myq1293189026.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/24/t1293188893qoxsjx76i8i2w2u/58myq1293189026.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