Home » date » 2010 » Dec » 21 »

paper - 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: Tue, 21 Dec 2010 13:23:33 +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/21/t12929377223vrm0emu9rexghj.htm/, Retrieved Tue, 21 Dec 2010 14:22: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/21/t12929377223vrm0emu9rexghj.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 time7 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
11197411974000
21010610288.6761488662-94.3309153892973-119.814781737905-1.86547076766942
31206911851.2381409920-68.466228867177666.31674576331862.96015872646792
41141211558.8568661654-69.9669646095791-125.82614408213-0.404112936458519
51118011280.2111061911-71.2907855329146-80.6063047048021-0.376531320946304
61050810666.2539223581-74.9050374278076-107.293485839413-0.978950613489178
71128811239.3762972649-70.4302668806122-12.21148779790411.16880445557799
81092811037.1814165162-71.3686966591231-96.8152234561487-0.237613350587852
91019910368.4334436356-75.7493237583732-113.384754423652-1.07707590023951
101103010974.8188577523-70.6052905218587-8.801864541969041.22967657409098
111123411261.6081074640-67.8369253809144-61.12183529064230.644159995120321
121374713444.9512703685-49.945384769194991.00781787050354.05678264448875
131391213322.1792203051-46.8561868875406596.687433442245-0.157152057774532
141237612686.0844571880-62.1294119058034-268.671765160443-0.91620742366794
151226412249.9288871609-67.245260163342546.8121364254245-0.665088203130406
161167511850.0781070069-69.6771219189104-145.152236849751-0.598467879622381
171127111382.1631979195-72.3098861934024-75.3083261053976-0.716401620772872
181067210894.6802258274-75.1867252817501-185.317653549538-0.746680465101444
191093310910.0602493345-74.533578122739314.79231804409350.162852810519665
201037910504.328107231-76.9954777397382-95.5416444174121-0.595449025978688
211018710337.4747186747-77.6825230652622-142.395442139896-0.161527378002824
221074710664.0670019755-74.48705964568546.59334934832460.726646662842116
231097011091.2141291681-70.3714152102647-166.2963047581150.90164780691025
241217511922.0177329899-64.4663645396153171.9998289653251.61781713891677
251420012983.0627030190-78.24714563815341114.475505541682.18746878825269
261167612109.5797716247-92.7487917587394-371.114623991981-1.32727691185305
271125811356.7111215903-102.243396612429-42.3843617040768-1.16921929337679
281087211043.3695698557-104.278558710312-152.857245553242-0.378935732866253
291114811155.9013666861-102.422720631995-26.94272355635670.389183043062264
301069010957.1515938558-103.263362522687-258.694616418356-0.172864038519487
311068410702.3677235479-104.627503987352-5.06989867920155-0.271862399058197
321165811538.3368122543-95.95735643613737.13638278201921.68740128037266
331017810616.7895715378-103.739523227957-366.370017332353-1.48092247938322
341098110884.0942737014-100.14263869552364.36452323011520.665566816482771
351077311018.2676163230-97.8554327876133-265.8157002384700.420262391570986
361166511499.0278471748-93.4993197207673115.2529582522591.03691487136305
371135910401.5912182251-92.51752182724641046.65405478323-1.87763276553070
381071610851.7754469518-84.064321039676-180.1391319203720.933103492177491
391292812506.9707174743-57.9047660148884274.3363092754533.07463863970359
401231712518.8548829416-57.0849988997478-207.8856042245890.125008905220263
411164111802.0755455944-64.0334947634512-103.936717532787-1.18209816655808
421045910862.7679527978-73.2314692338772-327.972198197936-1.56793659454203
431095310963.8685462377-71.3605816546932-25.96036329743320.312239744025691
441070310601.4471022375-74.5442181214921126.743593183500-0.521248955417992
451070310959.9904791628-69.718179119171-294.4664397989610.775564525342491
461110111021.0218891377-68.233996123824168.66524741073080.234154010143634
471133411513.3730391049-61.9866168586502-227.8705338546701.00354479391087
481326812731.344530238-50.3672450907706425.9854134447292.29155828251032
491314512390.5165389299-51.8672150216547779.89749093993-0.532964406545242
501233412696.7597538110-46.5783398952982-392.5414584283770.624852886821781
511315312861.416522538-43.3084066174926273.8446422799970.373244293417689
521128911708.5678969110-58.0949050436922-324.52339291362-1.98383186492771
531137411388.8055298678-61.28343254754937.67556769317756-0.468222771718569
541091411257.1832560214-62.1284386885407-337.140592335995-0.125823766701128
551129911254.0137439656-61.411435172871539.92244473936170.105450941140815
561128411199.2587557441-61.329240366284884.16965656891780.0119045345005826
571069411019.0532439882-62.8191721050455-314.846625183433-0.212603767408369
581107711049.5475685553-61.639026131708219.44101737975250.166888312909857
591110411398.4757339590-56.599296630207-329.7145880089920.733838071852131
601282012163.3860390954-47.8586042065403586.1285246477211.46974726431391
611491513756.5903036158-33.22705919956341016.329539962072.97928731551369
621177312537.8055122875-50.6549956129809-665.417262028728-2.08499835463702
631160811436.9675085819-67.2024816141221259.130976744932-1.85628886853446
641146811660.6367249155-63.0092940214459-217.4186544537780.519314262553488
651151111529.5935710616-63.9242781289594-12.7779136431349-0.121606031030551
661120011540.6922795179-62.9342126690772-347.1054881425100.134055923119720
671116411210.2451104257-66.4847514188489-23.3813552192143-0.477940472159159
681096010916.4993819274-69.536192980531362.92141701508-0.406014569143223
691066710958.3392054399-68.0242375713078-300.8562901450390.198988539835368
701155611456.4834304831-60.322941658610451.1404391139951.01146153473015
711137211767.5133537439-55.4285447331433-427.2285296882340.662956455890298
721233311923.8859974058-52.8894141406611391.0248711335590.378696908693787
731310211884.5721760655-52.7358552264621216.260728236160.0244906903618049
741111511669.3864267220-55.1558581979215-540.714864997467-0.286968777794965
751257212200.4050558968-45.8193765665695322.4072214313991.03685871206487
761155711862.1341468395-50.2435665620512-280.303126774423-0.521561319689465
771205912020.8499926665-47.242700260544320.34717616235850.373190233516098
781142011778.5828389673-49.9896976743665-341.965572017931-0.348198160083185
791118511278.3829157561-56.3396909117114-55.0276926512683-0.803690165203208
801111311080.6868833751-58.349708244146344.354851321222-0.252341856430518
811070611063.0757817579-57.7661740585595-360.5460678864780.0727277465034647
821152311413.8265203103-51.928172676898174.37851593326810.72916451281781
831139111755.9223517731-46.4549803982669-398.4632783746170.702827731595619
841263412143.9022709709-40.7797276436392453.1026080801780.7763338273158
851346912223.7436066280-39.22686065319281234.935942272160.216751868670573
861173512333.0861660043-36.9753535289058-610.6135869058520.26313957096457
871328112801.6956973232-28.8700561301295436.8473614338150.895045819206645
881196812399.1822163738-34.6896058562916-399.527599552900-0.665832333123519
891162311733.7812956881-44.1459297846579-57.1690912338956-1.12570510134530
901108411410.4321737624-48.2585930532463-302.694905694254-0.498197619535192
911150911487.4288741565-46.416014360805310.92350424257790.223463746442583
921113411161.0859675734-50.5551315890395-3.29115054537517-0.49941333762602
931043810898.6993136357-53.7007752456906-442.693289302248-0.377933159386938
941153011365.3101896408-46.0093213233248120.4713610549430.928046644759478
951149111828.4184171548-38.6585424591193-380.6591019852370.907586610975004
961309312490.3900077103-28.9321991539184543.0634122712691.25141779002353
971310612042.0582262695-34.76450213997131099.70837877634-0.751750243477367
981130511993.0034848016-34.9844600111125-686.797376342769-0.0253512671365578
991311312484.5427626693-26.5115803174581584.2052605576510.932862995196988
1001220312511.6928490038-25.661257492225-313.2325003105080.0955725183885657
1011130911574.6671043548-39.7123418779066-188.324041532899-1.62584207346830
1021108811411.2385991999-41.5909947693084-312.736754845383-0.220661433416762
1031123411204.2154408677-44.096086526607943.8258369918338-0.295012768940742
1041161911489.2801661617-39.0977778934772101.7827070508130.58698620324048
1051094211461.0867299519-38.9318676134852-520.0121867434470.0194450666069419
1061144511409.4437319319-39.124228117346436.6347698082711-0.0226594289543731
1071129111685.2944927043-34.4455810021456-421.0040599313290.561274239131841
1081328112469.7509948726-22.5808415288528741.745992360231.46206115401243
1091372612613.9133633898-20.14724774663451097.899375085870.298378946868846
1101130012188.3667563287-26.4652556018005-854.134603716504-0.719936744214248
1111198311553.3352974496-36.2784200395313480.851080921672-1.07900221636442
1121109211312.8293637291-39.5467831118268-203.568167032058-0.363599487902000
1131109311256.3680041686-39.8122595928444-161.934230279424-0.030164029520598
1141069211029.1064241731-42.7176437657351-321.212041362189-0.334239004648249
1151078610823.5048012248-45.2334938579906-23.6951012766148-0.2903776626058
1161116610997.3153622727-41.8466155358904150.1142971908180.390482701806929
1171055311052.0444223924-40.3527938020681-507.2314224785770.172149503247967
1181110311105.5926638690-38.908197718601-10.55026616570770.167320798179465
1191096911426.9210754652-33.4448581991925-488.4346868258860.641764333430728
1201209011384.1068424071-33.5847441249859706.687577525676-0.0167221714807242
1211254411373.5776341250-33.23758115901711168.463922271900.0412097336920563
1221226412677.8598921259-12.1976845598153-526.8260105789092.37690455419086
1231378313177.6446417948-3.93405976902408562.2644866967490.908327418946898
1241121411800.5087350762-26.0292333909332-470.515630236916-2.44422062568694
1251145311604.3641809605-28.7292688539512-136.956749241076-0.303284622944083
1261088311257.4901465562-33.7281334476466-347.535403552455-0.567165224139084
1271038110588.3431967953-43.6757009050235-153.514407500136-1.13252651520368
1281034810260.0046450553-48.1316212993387112.108609515112-0.507324606480606
1291002410460.7145959926-44.2389876794805-457.7910357982170.443427280537125
1301080510766.0239017215-38.79837287673409.380942239996150.622654067660781
1311079611167.3612630365-32.0210555727925-408.612777754620.783977086702713
1321190711215.2757590869-30.8021527368023684.9516161908490.142624893580122
1331226111282.1524932274-29.3007333042067970.5601775706260.174452590760165
1341137711822.0491723479-20.286480591951-493.1277765306261.01200121812026
1351268911918.0367615340-18.4092411725028761.1717959280340.206396266581290
1361147411923.3187914276-18.0270095995249-451.3192065676500.0421629846206461
1371099211253.2401789642-28.4474521853153-206.052505979688-1.16223714052466
1381076411044.9150775097-31.2992696235985-265.68411785979-0.320626644336654
1391216412002.6652324930-15.673978267578377.59897332858161.76253597883205
1401040910695.9466535059-36.0527827196571-177.654709564421-2.30041779812759
1411039810832.4811199197-33.3319731155220-449.0888738752310.307465536367971
1421034910483.2522840770-38.2900510229712-107.525140083621-0.562575483875295
1431086511098.193547048-28.1189746979975-288.4484181149351.16342727091399
1441163010997.9553864348-29.2351723751113638.15151118422-0.128647142593106
1451222111258.9025004853-24.7128467760431937.4997750396440.517960553725297
1461088411369.1269434396-22.5657024623551-496.5250383281690.239991848296145
1471201911278.2596519649-23.6682951500358746.494523443175-0.121295328963794
1481102111353.6732196045-22.0679294324237-341.0373352136980.176319986236736
1491079911070.6469964859-26.2552807199201-249.571293309232-0.465060782998379
1501042310860.7414553899-29.1838897553077-422.198171359888-0.327317160166663
1511048410343.1970453332-36.9464205576451182.130089836455-0.870185786679487
1521045010562.7210095035-32.8749973014423-134.4213686352280.456911729984344
153990610361.660991287-35.5407464040072-441.433656436748-0.299560912366392
1541104911050.7999831843-24.0978227786582-63.07955022101091.29034303602882
1551128111462.7016668290-17.2536087507467-218.5656219473290.776480813771126
1561248511808.0304785588-11.5824940180202646.2805632415320.646646350847647
1571284911913.8232923777-9.73608891302009925.2340413887140.209419312640308
1581138011884.0742410237-10.0555893908768-502.383773005848-0.0356026395884208
1591207911459.5364478625-16.7442959167456654.394342863409-0.736344855213633
1601136611614.2332789948-13.9745701727754-262.7034497505510.305074038809083
1611132811556.3839509460-14.6801978342672-224.673819868032-0.0781797125408249
1621044410949.5337069232-24.1583094456248-455.433248204194-1.05533314916330
1631085410736.4295876136-27.1738542747355133.554137804687-0.336646189334357
1641043410577.0025138754-29.2815102116579-131.816814719344-0.235583939298266
1651013710653.9222331789-27.5918236056499-525.9021722297320.189127819663821
1661099211019.4883992409-21.356316154783-60.71995193860770.69995639724051
1671090611148.7346699236-18.9780079193667-255.46404432790.268200920515683
1681236711614.1996731277-11.343997296488711.8118866292410.863827449579941
1691437113060.817488259511.7380542676621186.747229313242.6004293175344
1701169512366.50233256710.440674651154646-611.864841113362-1.25628170232410
1711154611217.0888175726-18.1068430460391425.842491706643-2.04339875523442
1721092211160.5991580968-18.7267786155626-235.359844932678-0.0683002182482825
1731067010873.7818155866-23.0434970248222-181.118579998477-0.47765329866475
1741025410706.1148165875-25.3636140473172-439.882510517337-0.257724025036179
1751057310467.1911893849-28.7811473346323123.869658600755-0.380478829410642
1761023910392.2805384355-29.5182395902259-149.380258633077-0.0821625583167873
1771025310734.4751340287-23.5882985299474-512.8942958874280.661875486687084
1781117611157.6689586039-16.4792935183831-19.4203144249130.795354264744201
1791071911095.8223999063-17.1988956414131-372.988783923905-0.0807904405502526
1801181711263.7307189385-14.2662958924131537.6121289052210.330021797717185
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/21/t12929377223vrm0emu9rexghj/1k8rk1292937806.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/21/t12929377223vrm0emu9rexghj/1k8rk1292937806.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/21/t12929377223vrm0emu9rexghj/2k8rk1292937806.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/21/t12929377223vrm0emu9rexghj/2k8rk1292937806.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/21/t12929377223vrm0emu9rexghj/3vz8n1292937806.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/21/t12929377223vrm0emu9rexghj/3vz8n1292937806.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/21/t12929377223vrm0emu9rexghj/4vz8n1292937806.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/21/t12929377223vrm0emu9rexghj/4vz8n1292937806.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/21/t12929377223vrm0emu9rexghj/56rpq1292937806.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/21/t12929377223vrm0emu9rexghj/56rpq1292937806.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