Home » date » 2010 » Dec » 19 »

*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: Sun, 19 Dec 2010 16:16:29 +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/19/t1292775242qx2gmw0x2wjhktt.htm/, Retrieved Sun, 19 Dec 2010 17:14:08 +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/19/t1292775242qx2gmw0x2wjhktt.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 «
41.85 41.75 41.75 41.75 41.58 41.61 41.42 41.37 41.37 41.33 41.37 41.34 41.33 41.29 41.29 41.27 41.04 40.90 40.89 40.72 40.72 40.58 40.24 40.07 40.12 40.10 40.10 40.08 40.06 39.99 40.05 39.66 39.66 39.67 39.56 39.64 39.73 39.70 39.70 39.68 39.76 40.00 39.96 40.01 40.01 40.01 40.00 39.91 39.86 39.79 39.79 39.80 39.64 39.55 39.36 39.28
 
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
141.8541.85000
241.7541.756206659243-0.00655532687009518-0.00511075833543904-0.611576562414529
341.7541.7549293250002-0.00611881293324532-0.005092384135687550.055120253678442
441.7541.7549006470643-0.00542961114489046-0.005082228903792190.0623944469666825
541.5841.5899275202046-0.0272835816731802-0.00530433508855795-1.61054162477662
641.6141.6137933608939-0.0193905607223459-0.005244282033808050.510656844210574
741.4241.4299976569326-0.0467620739954582-0.0054049140975037-1.62835161924286
841.3741.37562148999-0.048093247715485-0.0054110433706842-0.0749955675225111
941.3741.3741024422218-0.0396889756507971-0.00538036418167130.456990456802158
1041.3341.3353541743772-0.0395157068168054-0.005379859434017740.00920652419246916
1141.3741.3732396978148-0.0250679423905262-0.005346132927334420.756198525342461
1241.3441.3454217800979-0.0255857183190295-0.00534710408280679-0.0268356937684549
1341.3341.2866305128029-0.03153498660052090.0442366669905512-0.379472202595628
1441.2941.2924523525088-0.0245981604354552-0.003162618769637410.307181895752628
1541.2941.2924931764532-0.0199060349383844-0.003160163561996490.24002500134155
1641.2741.2731453562957-0.0197995357958255-0.003160449885670280.0054330928948378
1741.0441.0486068882894-0.0588957057941325-0.00307165983083078-1.99266461057082
1840.940.9053234180359-0.0750196555600695-0.00304204780803118-0.821336457046198
1940.8940.8914074886272-0.0633399041356362-0.003059365525691910.59473069339813
2040.7240.7258006444799-0.0828931627038084-0.00303595913526675-0.995404710614221
2140.7240.7209408084507-0.0679705589322267-0.003050381458237240.759549208038474
2240.5840.5848809858171-0.0809931874332582-0.00304021952270384-0.662773013995983
2340.2440.2498767906408-0.129579188708272-0.00300960807409043-2.4725659939258
2440.0740.0742500389809-0.138387494447856-0.00300512717554939-0.448239296492928
2540.1240.0580116509722-0.1153783659678520.05875191605899651.29182445855628
2640.140.0995830626361-0.0859718933966938-0.003017414201533641.38099386918218
2740.140.1006658136264-0.0693166624135937-0.003019510130592500.847470039602337
2840.0840.0816798924705-0.0596851311650948-0.003039949997451960.489738862867107
2940.0640.0619731318085-0.0520357579506134-0.003053562825993210.389040522891892
3039.9939.9934934830199-0.0551818262367899-0.00304903504596354-0.160033497580385
3140.0540.0500534714982-0.0338042033228474-0.003073879882040491.08755313538400
3239.6639.6723094547514-0.0996028210092713-0.00301213234845259-3.34764464808775
3339.6639.6606475692484-0.0827790952756601-0.003024880426449870.85598332373161
3439.6739.6705306976985-0.0650521439734064-0.003035726503771350.901966834302367
3539.5639.5641491488406-0.072958794133059-0.0030318203892285-0.402307169190279
3639.6439.6390457907790-0.0446726650604528-0.003043103744798941.43927724735378
3739.7339.6820643210371-0.02805654927124860.04559626310874080.903116752463959
3839.739.7024882301847-0.0189261573335912-0.003614265022017670.438956779837005
3939.739.7030868243209-0.0151905984131268-0.003614712129459730.190071474671603
4039.6839.6837261396289-0.0159885750584377-0.0036134388135416-0.0405814342615171
4139.7639.76111353838470.00187758982478193-0.003637333122650000.908755126876263
424039.99735098316560.0467159285954982-0.003685827465833712.28098627094977
4339.9639.96578876354450.031740107668119-0.00367274811489267-0.761906248749854
4440.0140.01324987976140.0347477253435453-0.003674869115929570.153023501283735
4540.0140.01457478509220.0283535821764099-0.00367122813778830-0.325337336267606
4640.0140.01443892963930.0229032500503587-0.00366872218233920-0.277322418018295
474040.00455286536950.0166302870116107-0.00366639336209202-0.319184327637486
4839.9139.9164908325698-0.00339861813592170-0.00366038948023593-1.01913211199611
4939.8639.8304527756292-0.01909671574573860.0317594473143884-0.839560336643105
5039.7939.7934720853097-0.0224757867674678-0.00304263358392459-0.164528879740290
5139.7939.7924626444132-0.0183687714963313-0.00304302941340040.208973624250545
5239.839.8022878425352-0.0129738620872287-0.003049879192007570.274391768471011
5339.6439.6468711342301-0.0402278185437615-0.00302087800367791-1.38636913038035
5439.5539.5544238695646-0.0502185512037577-0.00301228083196918-0.508267754823595
5539.3639.3667109058834-0.076523484643191-0.00299400211797473-1.33832776940936
5639.2839.2831826186297-0.0778635987440587-0.00299325020006442-0.0681846572345311
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/19/t1292775242qx2gmw0x2wjhktt/1fbwm1292775385.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/19/t1292775242qx2gmw0x2wjhktt/1fbwm1292775385.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/19/t1292775242qx2gmw0x2wjhktt/2fbwm1292775385.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/19/t1292775242qx2gmw0x2wjhktt/2fbwm1292775385.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/19/t1292775242qx2gmw0x2wjhktt/383ep1292775385.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/19/t1292775242qx2gmw0x2wjhktt/383ep1292775385.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/19/t1292775242qx2gmw0x2wjhktt/4juvs1292775385.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/19/t1292775242qx2gmw0x2wjhktt/4juvs1292775385.ps (open in new window)


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