Home » date » 2009 » Dec » 04 »

ws9 Structural Time Series

*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, 04 Dec 2009 08:38:11 -0700
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2009/Dec/04/t1259941160prd4mse9qhm2pvx.htm/, Retrieved Fri, 04 Dec 2009 16:39:27 +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/2009/Dec/04/t1259941160prd4mse9qhm2pvx.htm/},
    year = {2009},
}
@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 = {2009},
    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 «
9,3 9,3 8,7 8,2 8,3 8,5 8,6 8,5 8,2 8,1 7,9 8,6 8,7 8,7 8,5 8,4 8,5 8,7 8,7 8,6 8,5 8,3 8 8,2 8,1 8,1 8 7,9 7,9 8 8 7,9 8 7,7 7,2 7,5 7,3 7 7 7 7,2 7,3 7,1 6,8 6,4 6,1 6,5 7,7 7,9 7,5 6,9 6,6 6,9 7,7 8 8 7,7 7,3 7,4 8,1 8,3
 
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
19.39.3000
29.39.3000
38.78.77525230598956-0.0076745553976964-0.0752523059895582-1.97088465287498
48.28.25227981210922-0.00993735738546997-0.052279812109215-1.94953585912716
58.38.28214163216692-0.009761782895529040.01785836783308570.150511606241261
68.58.48399129646074-0.008749233250639790.01600870353926320.800213212939008
78.68.60159861615121-0.00814027592986616-0.001598616151210140.477817965309843
88.58.52286633642054-0.00847838428486613-0.0228663364205374-0.266942509635764
98.28.2409379298869-0.00978098535056802-0.0409379298869055-1.03403735512353
108.18.11312599318411-0.0103405433559001-0.0131259931841093-0.446323798175294
117.97.92789423457948-0.0111657666971488-0.0278942345794744-0.661329766165156
128.68.524502767595-0.008311441254366910.07549723240499722.29820304191118
138.78.61233532731105-0.0121674846843430.08766467268894490.426479468888753
148.78.64697890568697-0.01123646423740910.0530210943130270.156250978450350
158.58.5414998315855-0.0123895402946268-0.0414998315854959-0.35019598916982
168.48.46170941023772-0.0126545537920266-0.0617094102377202-0.254804525035108
178.58.4932025633073-0.01255005022356090.006797436692697670.166823768911631
188.78.67075545093492-0.01205428323365880.02924454906507710.718216130902494
198.78.70713914010227-0.0119189153143273-0.007139140102269710.182991857196360
208.68.61864935694136-0.012134911536214-0.0186493569413626-0.289273523363328
218.58.53834411827887-0.0123275704592064-0.0383441182788657-0.257541197498903
228.38.31741955181045-0.012943739849171-0.0174195518104463-0.78816999941086
2388.11865880983634-0.0135061293569174-0.118658809836342-0.702266477523946
248.28.12305790757048-0.01351030886722940.07694209242952130.0675869056758669
258.18.03590561762649-0.01239694287625490.064094382373513-0.295275808183713
268.18.02453126597765-0.01238663282005430.07546873402234950.00366062845961385
2788.02335656546262-0.0122723147413111-0.02335656546262000.0415232736116278
287.97.97356668589169-0.0124421967098636-0.0735666858916876-0.141689227325010
297.97.9294054700144-0.0125125259591850-0.0294054700143992-0.119854608939092
3087.9684984754914-0.01240848632983550.0315015245086030.194940090506568
3187.99431405307434-0.01232414331937860.005685946925659160.144373966838509
327.97.92856970049737-0.0124480476790977-0.0285697004973683-0.201766120028321
3387.98919102969673-0.01227096265309840.01080897030326850.276004804148458
347.77.74282660249692-0.0128739875002979-0.0428266024969196-0.88447287872128
357.27.38545840629785-0.0135799508315851-0.185458406297851-1.30129562410372
367.57.38506995222871-0.01360128991510140.1149300477712860.0498450948200217
377.37.25700557979932-0.01274534131947780.0429944202006818-0.444270438266987
3876.97393055634415-0.01436574467550380.0260694436558471-0.992453666237136
3976.99392138534081-0.01407917081845290.006078614659187630.127358032673715
4077.05009140078826-0.0137416967681016-0.05009140078826320.264930560610493
417.27.2041689772245-0.0133346411833875-0.004168977224493160.634115094862683
427.37.26878015878369-0.01319157243195700.03121984121630930.294440074528764
437.17.12777865036264-0.0134366216164051-0.0277786503626356-0.482720136809865
446.86.89613654726884-0.0138933880354078-0.0961365472688436-0.824109094208999
456.46.44159726325472-0.0148917002820362-0.0415972632547197-1.66446254292099
466.16.13019169630231-0.0155658547521039-0.0301916963023118-1.12024668920766
476.56.56784204306559-0.0149794427572034-0.06784204306558751.71118825389689
487.77.38388762251882-0.01647088020912400.3161123774811803.14249305286777
497.97.73901752778758-0.01796787270481040.1609824722124191.42236376118628
507.57.53985705828932-0.0187061261454646-0.039857058289324-0.672434601146582
516.97.02530961969086-0.0221005128758527-0.125309619690864-1.84228285775196
526.66.73933288466165-0.0233604449147042-0.139332884661648-0.993893188274412
536.96.88126093732315-0.02292225090909240.01873906267684710.624450050849338
547.77.51025364709912-0.02172730561815530.1897463529008832.46267021661483
5587.92012530155855-0.02095875912211300.07987469844144551.63012339275497
5688.00804481067862-0.0207455461472738-0.00804481067862050.411219467997272
577.77.74922543206893-0.0212502099453783-0.0492254320689253-0.899308834759664
587.37.47439277422635-0.0217454481387501-0.174392774226348-0.957896051554856
597.47.58921952411478-0.0216367556764171-0.1892195241147840.515519067666413
608.17.79947334592646-0.02199827876981120.3005266540735420.877003018098422
618.38.03382385406515-0.02256630736940650.2661761459348550.974579542652016
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259941160prd4mse9qhm2pvx/1nd6x1259941088.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259941160prd4mse9qhm2pvx/1nd6x1259941088.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259941160prd4mse9qhm2pvx/2oc3c1259941088.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259941160prd4mse9qhm2pvx/2oc3c1259941088.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259941160prd4mse9qhm2pvx/3s7v91259941088.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259941160prd4mse9qhm2pvx/3s7v91259941088.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259941160prd4mse9qhm2pvx/4jz9p1259941088.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259941160prd4mse9qhm2pvx/4jz9p1259941088.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259941160prd4mse9qhm2pvx/57r311259941088.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259941160prd4mse9qhm2pvx/57r311259941088.ps (open in new window)


 
Parameters (Session):
par1 = 12 ; par2 = periodic ; par3 = 0 ; par5 = 1 ; par7 = 1 ; par8 = FALSE ;
 
Parameters (R input):
par1 = 12 ; par2 = periodic ; par3 = 0 ; par5 = 1 ; par7 = 1 ; par8 = FALSE ;
 
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