Home » date » 2010 » Dec » 09 »

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: Thu, 09 Dec 2010 16:27:14 +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/09/t1291911933em4k9x61f80n0qa.htm/, Retrieved Thu, 09 Dec 2010 17:25:35 +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/09/t1291911933em4k9x61f80n0qa.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 «
31514 27071 29462 26105 22397 23843 21705 18089 20764 25316 17704 15548 28029 29383 36438 32034 22679 24319 18004 17537 20366 22782 19169 13807 29743 25591 29096 26482 22405 27044 17970 18730 19684 19785 18479 10698 31956 29506 34506 27165 26736 23691 18157 17328 18205 20995 17382 9367 31124 26551 30651 25859 25100 25778 20418 18688 20424 24776 19814 12738 31566 30111 30019 31934 25826 26835 20205 17789 20520 22518 15572 11509 25447 24090 27786 26195 20516 22759 19028 16971 20036 22485 18730 14538
 
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
13151431514000
22707128488.2212273871-1092.63511967583-1417.22122738713-1.46598300534814
32946228256.6349716561-703.1433937271161205.365028343950.311490301374225
42610526681.1863445095-1151.42398132673-576.186344509478-0.309348729200586
52239723266.1456560182-2311.8923233458-869.145656018176-0.773902918482607
62384322753.2425014063-1398.551163185871089.757498593730.621016281464426
72170521809.5519609645-1167.00062176535-104.5519609645240.158797925588194
81808918952.9154866462-2029.74342518538-863.915486646162-0.591919734718616
92076419423.4582449803-752.0092155006411340.541755019720.876493082066904
102531623548.09752792281739.877411081581767.902472077221.7094055674526
111770420588.7166309384-660.821193441494-2884.71663093844-1.64686183446903
121554816432.9158986701-2446.0898610964-884.915898670094-1.22467857740565
132802921943.65809112471543.873818280016085.341908875312.88637957046384
142938329386.94310556034496.42366564184-3.943105560292831.99736580372881
153643835122.86360573565090.311003827091315.136394264350.403221519417058
163203434834.21237721792469.73346978688-2800.21237721788-1.83277717885368
172267928115.1589124382-2084.13305485642-5436.15891243816-3.12236828533848
182431923375.7949989356-3394.70451896832943.20500106442-0.89166031005516
191800418142.4003279398-4299.60362375608-138.400327939775-0.619028939551949
201753717756.7072176541-2369.74896154116-219.7072176540751.3238400442228
212036619234.9677852415-468.6072820969171131.032214758521.30421222697792
222278218961.2397152154-372.2904438506083820.760284784560.0660722955655084
231916920082.6207999373364.866350614665-913.6207999372980.505788839182921
241380719011.6124477755-342.283221651173-5204.61244777549-0.486851166435701
252974323961.36080303422270.027516975785781.639196965791.81086866717164
262559126781.71249926142540.7681319951-1190.712499261410.185062379425685
272909626651.43502085361247.054845364752444.5649791464-0.882823073454282
282648226083.6978991895367.493641551635398.302100810479-0.608103734693225
292240526319.7769794379303.19324958791-3914.77697943795-0.0443024160915607
302704425817.5742423243-91.2278373383341226.4257576757-0.269655334946142
311797021602.5780615616-2104.92347908123-3632.57806156159-1.37682344777417
321873019759.9225270495-1976.89122823787-1029.922527049460.0877484655676938
331968418318.0297126147-1715.422088199391365.97028738530.179359381648078
341978516370.9629013692-1828.661416189833414.03709863076-0.077695110328347
351847917692.5620884627-289.879399954303786.4379115373461.05670711850978
361069818138.715016282969.696047029169-7440.71501628290.247479031943035
373195623764.08412808322788.248872532828191.915871916761.8706676840445
382950629092.14932134894027.60057321021413.8506786510810.848002732211462
393450632248.88091694393605.674050172062257.11908305605-0.288666585293711
402716529681.1770239054617.433506084196-2516.17702390538-2.05735468034303
412673629778.3258637963364.350265418488-3042.32586379626-0.17430263086117
422369123811.5921987584-2721.31134715396-120.592198758363-2.11544564455643
431815721100.1115898896-2716.52816758589-2943.111589889590.00327304663945432
441732818284.8278370536-2764.51200622069-956.827837053579-0.0328679746865906
451820516196.0630878301-2436.200722422962008.936912169860.225156364196841
462099517041.4817046502-841.6371436502513953.51829534981.09444070399215
471738217150.3468270701-379.713517185379231.6531729298650.317369819034716
48936718676.3965326998547.316984630072-9309.39653269980.637433920144565
493112422814.11167537292295.147377930788309.888324627071.20007575058211
502655125761.01029744312611.71108081836789.9897025569440.216709054194197
513065126900.78120262311899.695480103543750.21879737695-0.487645385788549
522585927990.58798227021508.24231731052-2131.58798227022-0.2690959440572
532510026773.807452881187.378996447071-1673.80745288103-0.908922851010369
542577825929.1190478969-313.810950606371-151.119047896935-0.343984937948234
552041823857.1357457246-1166.84705259402-3439.13574572458-0.584207483168731
561868820657.7921073125-2151.35322136518-1969.79210731248-0.674280897650774
572042419060.1900979504-1883.351313485621363.809902049640.183761235129989
582477619961.1418024234-535.8183690737874814.858197576640.925086773851587
591981420438.026705414-45.3659375627472-624.0267054140130.337018949556687
601273822675.83545353341061.62281234123-9937.835453533440.760683058345722
613156623795.62301694921089.832809416637770.376983050790.0193537559141595
623011127632.20462985522419.553050982622478.795370144810.910600280274049
633001927424.71081957391151.240439066132594.2891804261-0.869069542329468
643193431443.63133725992534.91514941043490.3686627401430.950530719347023
652582629391.1525439304317.335125140292-3565.1525439304-1.52496652118284
662683526809.4430710926-1086.2806477594825.5569289073651-0.963697357874404
672020523458.147856514-2182.4166615121-3253.14785651397-0.751122983402322
681778920273.8898930891-2666.48518493185-2484.8898930891-0.331567149409735
692052019320.7733431684-1839.583157818021199.226656831550.566935581227682
702251818071.6119185777-1554.66204510874446.388081422260.195608479914645
711557216923.6835349286-1358.21542188005-1351.68353492860.134982435235803
721150919836.2460455606706.787143468736-8327.246045560571.41842718367463
732544719628.2687863865264.4291086841585818.73121361346-0.303393890663685
742409020637.0681093318623.8374307246923452.931890668240.246192740508689
752778624742.26070453722301.420891695113043.739295462781.14982269207412
762619525022.4835432411327.878504605971172.51645675902-0.668539730547871
772051623679.832459702639.8456708709375-3163.83245970261-0.885312009111272
782275922113.0981708124-736.030694326834645.901829187568-0.532730011919173
791902821634.7581063078-611.612160398208-2606.75810630780.0852871052821534
801697120354.3949683974-934.051594808297-3383.39496839739-0.220897776081142
812003619036.5520929539-1118.87350012147999.447907046087-0.126715897967117
822248518251.6346566049-958.0747871181924233.36534339510.110388168502649
831873020300.4474713421490.970715153167-1570.447471342150.995514662440418
841453822239.33186750641189.43281575743-7701.33186750640.479639832666078
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291911933em4k9x61f80n0qa/1xlu01291912029.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291911933em4k9x61f80n0qa/1xlu01291912029.ps (open in new window)


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


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291911933em4k9x61f80n0qa/313to1291912029.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291911933em4k9x61f80n0qa/313to1291912029.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291911933em4k9x61f80n0qa/413to1291912029.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291911933em4k9x61f80n0qa/413to1291912029.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291911933em4k9x61f80n0qa/513to1291912029.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291911933em4k9x61f80n0qa/513to1291912029.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