Home » date » 2010 » Dec » 29 »

STSM

*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: Wed, 29 Dec 2010 07:42:49 +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/29/t1293608449z7shs7587kynzba.htm/, Retrieved Wed, 29 Dec 2010 08:40:51 +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/29/t1293608449z7shs7587kynzba.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 «
11974 10106 12069 11412 11180 10508 11288 10928 10199 11030 11234 13747 13912 12376 12264 11675 11271 10672 10933 10379 10187 10747 10970 12175 14200 11676 11258 10872 11148 10690 10684 11658 10178 10981 10773 11665 11359 10716 12928 12317 11641 10459 10953 10703 10703 11101 11334 13268 13145 12334 13153 11289 11374 10914 11299 11284 10694 11077 11104 12820 14915 11773 11608 11468 11511 11200 11164 10960 10667 11556 11372 12333 13102 11115 12572 11557 12059 11420 11185 11113 10706 11523 11391 12634 13469 11735 13281 11968 11623 11084 11509 11134 10438 11530 11491 13093 13106 11305 13113 12203 11309 11088 11234 11619 10942 11445 11291 13281 13726 11300 11983 11092 11093 10692 10786 11166 10553 11103 10969 12090 12544 12264 13783 11214 11453 10883 10381 10348 10024 10805 10796 11907 12261 11377 12689 11474 10992 10764 12164 10409 10398 10349 10865 11630 12221 10884 12 etc...
 
Output produced by software:


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


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
11197411974000
21010610288.6331588304-94.3319241213452-119.801444939188-1.86511694532136
31206911851.3528317392-68.476345822216466.24968385675762.95987197106859
41141211558.8491323164-69.9767917180702-125.816866051587-0.404234270662072
51118011280.2018529245-71.2995301190069-80.606215405552-0.376440797643103
61050810666.2249159066-74.9105962928306-107.285171936414-0.978774843464354
71128811239.4262286544-70.4398403105454-12.24349200232791.16872413714164
81092811037.1795004818-71.3774978561549-96.8145819241931-0.237642438150626
91019910368.4001414436-75.7528139686791-113.373015634434-1.07690375487893
101103010974.8705347874-70.6150531252246-8.834880684875321.22959389145419
111123411261.6377467532-67.8507702935784-61.13624524265240.644011490937853
121374713445.1009307693-49.985454536358490.9340188015044.05623073370266
131391213322.1702910378-46.8900697865202596.704675202634-0.157378209910291
141237612685.9860423602-62.1582815967602-268.587695422704-0.916107799060301
151226412249.9339895529-67.265944233891246.7827835064837-0.664730250023255
161167511850.0519593738-69.6922344253802-145.137128351993-0.598371879891218
171127111382.1384511938-72.3180939398076-75.2994343714726-0.716234599066081
181067210894.6258288107-75.187666554459-185.276260629545-0.74657643288933
191093310910.0854149045-74.535641330435314.76316003475610.162966553055529
201037910504.3187119327-76.9912697553053-95.5411647763397-0.595394526398482
211018710337.4496008101-77.676623985553-142.371735107665-0.161532669419138
221074710664.1112520895-74.489289191477346.55776198348880.72662381242145
231097011091.2135161529-70.385059062924-166.2740831571670.901401882011826
241217511922.1258096126-64.499710396937171.9125721926361.61773435161406
251420012983.1425925507-78.3148775623411114.435068696422.18708970752965
261167612109.4727679586-92.8029808472873-371.024566234092-1.32721097137573
271125811356.6710984977-102.279433901278-42.3759521387226-1.1687956835327
281087211043.3520037007-104.308394249624-152.851935381117-0.378760952943354
291114811155.9165850061-102.457868209579-26.95610071178020.389223866660999
301069010957.1110616271-103.296050838633-258.655529572986-0.172869318532237
311068410702.3758393987-104.655217204624-5.09025521310375-0.271666791561023
321165811538.4097241315-96.011179666763137.08697154841581.68725956101269
331017810616.6990634862-103.770204441559-366.297585542656-1.48084969652805
341098110884.1112817598-100.18304660506364.34781812463260.665693897766914
351077311018.2404295298-97.90295622009-265.7803570011670.420179642908202
361166511499.0949332703-93.564137673489115.1926351174961.0369819225904
371135910401.5657408222-92.54271974730861046.64856202457-1.8773600351685
381071610851.7809531777-84.1033284334732-180.1311857009380.933018530779497
391292812507.0816374955-57.9938719871614274.2683971427143.07435115304901
401231712518.8444971878-57.1767848165446-207.8701651826210.124928922355648
411164111802.0132477685-64.1025952056239-103.899395026303-1.181816132249
421045910862.6584108717-73.2705998851216-327.893058331922-1.56761891153424
431095310963.8606879757-71.404183289385-25.95901976413530.312436522220334
441070310601.4764868244-74.5768482177738126.697760117682-0.521011878317739
451070310959.9687146842-69.7661800668654-294.4290246104110.775394197636288
461110111021.0125668983-68.285922213363468.67357817983470.234220902454909
471133411513.3710309381-62.0578625883579-227.8555406159451.00347447542509
481326812731.4950162578-50.4851315381511425.8566071633392.29155557526052
491314512390.5101165202-51.9725285810497779.897980282216-0.532944762971243
501233412696.7134280552-46.6942613088613-392.4887642056950.624848295629302
511315312861.4423046174-43.4284321870969273.8097623229590.373510741874095
521128911708.4861712349-58.1744559432974-324.478178060299-1.98346185006281
531137411388.7588192322-61.35175377649637.7040748989023-0.467936035259529
541091411257.1082303511-62.1936192633091-337.071246452208-0.125730313522017
551129911254.0062473201-61.477242911101739.92042773391840.105669913164812
561128411199.2676228884-61.394289864276884.15394817429580.0120493959095228
571069411019.0019299259-62.8796249486238-314.799516541353-0.212558109520197
581107711049.500656033-61.702228133979719.48533414763860.166975335620976
591110411398.4512666287-56.6773917482701-329.6844542223170.733864374276155
601282012163.5278624571-47.9682776765278585.9916095057091.46992946117186
611491513756.7192096608-33.41052749255721016.244222282492.97895280234067
621177312537.6838834639-50.7972818913669-665.32872616662-2.08472757797321
631160811436.9176420777-67.3047856691306259.129589450659-1.85558299680101
641146811660.6214303692-63.1205799415339-217.4058037539850.519468332350188
651151111529.5481907224-64.0318062468607-12.7416247194808-0.12143988870106
661120011540.6284877045-63.043539666522-347.0469433545950.134192049029607
671116411210.2067462172-66.5817035402455-23.3629460516247-0.477617481304508
681096010916.4801785876-69.622605965598462.9235269627374-0.405737226558986
691066710958.2945765344-68.1142205623941-300.8133542292970.199063214238793
701155611456.4489498494-60.433936295705951.18422126597371.01146659950065
711137211767.47248976-55.5531497226754-427.1849411742610.663029595624067
721233311923.9428158331-53.0204785715216390.9556947304570.379028983257436
731310211884.6554548939-52.86575894520581216.16433936560.0247706063067002
741111511669.3554252348-55.2794811480279-540.690443570613-0.28688840154525
751257212200.4213441327-45.9611701440147322.3952367253341.03697741254061
761155711862.0851061829-50.3731515921928-280.269817871876-0.521334463853941
771205912020.8110763757-47.378532412804820.38078162184830.373375362796789
781142011778.5139228278-50.1162428656797-341.911799604946-0.347949493791171
791118511278.3199419615-56.4463743896005-54.9901455461402-0.80331588940561
801111311080.6444392173-58.448959263448944.3820185674071-0.252071497559398
811070611063.0087091515-57.8659752757266-360.4840684629590.0728484630877976
821152311413.7856362026-52.042426218415374.42149963478530.729264531879137
831139111755.9023669001-46.5834231817232-398.4424783547550.702948571149021
841263412143.9774152775-40.9239786456532453.0219884599480.776599477828592
851346912223.8261929124-39.37448311745721234.844177929920.216986889565455
861173512333.0750035379-37.1277827107647-610.602173008280.263187019784613
871328112801.7210033697-29.0375921183247436.8223145522590.895221248348465
881196812399.1091481458-34.8420933147374-399.472202942067-0.665593346852686
891162311733.6893862859-44.2718316192163-57.1084180092573-1.12527230867893
901108411410.3619437065-48.3712667728911-302.645988628655-0.497848783900966
911150911487.3921374883-46.53150840420610.95175149950080.223686154061401
921113411161.0202887057-50.6583049075945-3.2416176826922-0.499173260933412
931043810898.6035741787-53.7945403983452-442.610416422954-0.377737915193525
941153011365.2751799552-46.1213521993287120.5095600079970.92816330015298
951149111828.4171953584-38.7890968142022-380.6543574967170.907691020644872
961309312490.4886613451-29.0892589203439542.9670771443351.25161309847739
971310612042.0945330889-34.90236959005241099.65077463327-0.751449636022514
981130511992.9900359025-35.1204342106582-686.79182089044-0.0251903923792902
991311312484.5933842859-26.6631896491565584.1546461339970.933051374095123
1001220312511.6660521019-25.8136690504029-313.2102777253730.0956879621864104
1011130911574.5456046715-39.829049591734-188.236206441315-1.6254576674997
1021108811411.1644320683-41.7004082211628-312.680399285678-0.220330897790261
1031123411204.166043742-44.197027932588943.858651912701-0.294722818571801
1041161911489.2446637381-39.2097535730121101.8188109245860.587090067201093
1051094211460.986948692-39.0435413592997-519.9161093802640.0195267668072562
1061144511409.3665869764-39.233379544508836.7001245063064-0.0224161564092115
1071129111685.2844248568-34.5646940520321-420.9990791310490.561491715449074
1081328112469.8815599011-22.7300638520742741.6190540079281.46227134169718
1091372612613.9797965-20.30209725224731097.830975011180.298478995805036
1101130012188.3287972971-26.6041260798726-854.113918070788-0.719717376789001
1111198311553.3159701347-36.3930856779976480.837709068181-1.07853078162122
1121109211312.8136884583-39.6521634614933-203.568969421813-0.363325254393175
1131109311256.2999517245-39.9161777277259-161.871204035266-0.0300642837530551
1141069211029.0335469594-42.8128975571494-321.15347354472-0.334004559526906
1151078610823.4398468145-45.320937499221-23.644018112252-0.290143688753088
1161116610997.2777108304-41.9406326181038150.1491175824170.390619936003342
1171055311051.959606798-40.4497612268479-507.1475392652480.172203366920802
1181110311105.5143506994-39.0071762447833-10.47776989823740.167476354347785
1191096911426.9099968966-33.5554425187868-488.4263902211560.641949599069207
1201209011384.1886446194-33.6919217288313706.58823555151-0.0163561867161505
1211254411373.6533716951-33.34415939816341168.380329361250.0413831983586047
1221226412677.9744105821-12.3515150935896-526.9099106461292.37673578630805
1231378313177.6973420495-4.10452737107034562.2204251075890.908328725412734
1241121411800.3983005316-26.1505509234803-470.449468171411-2.44377867269521
1251145311604.2807873693-28.8420029302018-136.891307544347-0.302967300411489
1261088311257.3967965344-33.8273992455782-347.460812616056-0.566883601332621
1271038110588.2279815807-43.7499591356481-153.425789567897-1.13219262516484
1281034810259.9267009111-48.1934873527838112.168136553671-0.507038207584371
1291002410460.6484714194-44.3090152878012-457.7233118487890.443482019684721
1301080510765.9719935435-38.88028065822479.436712132589960.622696647101722
1311079611167.3783545325-32.117579440532-408.6288067585450.784109960546268
1321190711215.3454976076-30.8995435453511684.8717641204060.142866107193599
1331226111282.1995911473-29.4007639252628970.5098409709250.174555366197188
1341137711822.1495262161-20.4049110744262-493.2228341218421.01209236353321
1351268911918.1185639683-18.5301535290976761.0853068873810.206536740853065
1361147411923.2871385836-18.1486383758-451.2874290132450.0421688382842324
1371099211253.1388252711-28.5447511922899-205.976247793639-1.16194139546861
1381076411044.8370750551-31.3880763053875-265.622024454881-0.32035578953797
1391216412002.6458466875-15.796871163411977.63714306288131.76249267598623
1401040910695.7750884654-36.1285881627075-177.521428218576-2.30007136233203
1411039810832.3934779293-33.411632129616-449.0093027936410.307696832889202
1421034910483.15774471-38.3568216090592-107.446703833372-0.562348529856667
1431086511098.2342230374-28.2073078706679-288.4855990017641.16358460620486
1441163010998.0062379301-29.3192200057714638.090041639916-0.128448934488949
1451222111258.9608938276-24.8064555729714937.4428474655460.518032687362263
1461088411369.2126209028-22.6622732139737-496.6166023395440.240163912597532
1471201911278.3277263642-23.7612026297213746.41761304243-0.121133507059421
1481102111353.6779325302-22.1638297945551-341.0413845242390.17634149462409
1491079911070.5639789289-26.3417665995619-249.497262898327-0.464964727268742
1501042310860.6427720742-29.2626258740487-422.111306392259-0.327133793102958
1511048410343.1345961414-37.0056128851051182.167350523455-0.869829460635096
1521045010562.6271452391-32.9430716409256-134.3217444986450.456881835355568
153990610361.5655944079-35.6016399041749-441.349197648287-0.299390442884022
1541104911050.7609257093-24.183488770267-63.02754389653881.29032770875313
1551128111462.7435513808-17.3529001665782-218.607827198860.776642037639409
1561248511808.0964604462-11.6934890297853646.2156259358520.646752948598114
1571284911913.8808404636-9.84983338957658925.1715450217860.209565306128153
1581138011884.1480145546-10.1665464785951-502.469161342374-0.0353651132740267
1591207911459.5679120289-16.8396920261753654.343834220098-0.736091827631705
1601136611614.2513674016-14.0746113072277-262.7229928306110.305166163325339
1611132811556.3233551236-14.7783505471523-224.616425544671-0.0781279391307815
1621044410949.4177648797-24.2346703505017-455.339740298764-1.05507212759247
1631085410736.3467938842-27.2416941917953133.62167979368-0.336392354475838
1641043410576.8919949054-29.3439561961839-131.713874209007-0.235471479229079
1651013710653.8162078331-27.6570386215763-525.7984473743080.189214124282665
1661099211019.4421464994-21.4338440233263-60.67184146946810.700057045993196
1671090611148.7552109806-19.0587965989896-255.4920176774820.268410999539788
1681236711614.2834378019-11.440437007314711.7313098459280.863932450075731
1691437113060.983774016911.5911154680011186.612242555262.60028920465827
1701169512366.53943564080.319125284101127-611.926031714499-1.25602628296922
1711154611217.0464670931-18.1877245364446425.844518015323-2.04296047876323
1721092211160.6056695412-18.8042382972311-235.378525944544-0.068057333536816
1731067010873.7308599267-23.1112564903605-181.077850662056-0.47753372347642
1741025410706.0275462902-25.4257601735265-439.802498371478-0.257622800584749
1751057310467.100642369-28.8347620033793123.948449086276-0.380307425562548
1761023910392.1698911503-29.5696748939431-149.273905861347-0.0820885428499276
1771025310734.3858470722-23.6518794792658-512.799396583890.66188977898432
1781117611157.6346959333-16.5570905394366-19.38194062940240.795426631337606
1791071911095.8110238979-17.2734502085604-372.987349142346-0.0805970222730988
1801181711263.7750907956-14.345546399043537.5626187636040.330196030519748
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/29/t1293608449z7shs7587kynzba/13tkj1293608563.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/29/t1293608449z7shs7587kynzba/13tkj1293608563.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/29/t1293608449z7shs7587kynzba/2e3241293608563.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/29/t1293608449z7shs7587kynzba/2e3241293608563.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/29/t1293608449z7shs7587kynzba/36cj61293608563.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/29/t1293608449z7shs7587kynzba/36cj61293608563.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/29/t1293608449z7shs7587kynzba/46cj61293608563.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/29/t1293608449z7shs7587kynzba/46cj61293608563.ps (open in new window)


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