Home » date » 2010 » Dec » 07 »

*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, 07 Dec 2010 19:00:52 +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/07/t1291748318k2kn01gb2lrhoes.htm/, Retrieved Tue, 07 Dec 2010 19:58:39 +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/07/t1291748318k2kn01gb2lrhoes.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 «
103,48 103,93 103,89 104,4 104,79 104,77 105,13 105,26 104,96 104,75 105,01 105,15 105,2 105,77 105,78 106,26 106,13 106,12 106,57 106,44 106,54 107,1 108,1 108,4 108,84 109,62 110,42 110,67 111,66 112,28 112,87 112,18 112,36 112,16 111,49 111,25 111,36 111,74 111,1 111,33 111,25 111,04 110,97 111,31 111,02 111,07 111,36 111,54 112,05 112,52 112,94 113,33 113,78 113,77 113,82 113,89 114,25 114,41
 
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
1103.48103.48000
2103.93103.8739150119630.06715470681405720.02051636832304091.05673372968296
3103.89103.8786585982220.04411070697743920.0204037216127486-0.212745217106742
4104.4104.3288966053870.2127666431894110.0185327486458151.29441439184492
5104.79104.7464363451680.299877064783550.01780852815006330.642593675078283
6104.77104.7844231378910.1877522747086220.0183498153606676-0.820063166157854
7105.13105.0962679135760.2409937502660820.01821154529680720.388621717198104
8105.26105.252359643820.2045367784058070.0182610280463516-0.265976068843939
9104.96104.9989037092440.007804261514746360.0183989511065719-1.43510339524529
10104.75104.762163590399-0.09725813774541220.0184368095504773-0.766372861116432
11105.01104.9552520034520.02749206584565580.01841375206863290.909976860503057
12105.15105.1150358930020.08433480399747860.01840836788405310.41463227353378
13105.2105.3313719912860.138908704581269-0.1472596649199980.47449730748307
14105.77105.7289927945460.2407108068491840.01946588896619980.655989540727187
15105.78105.7839255765310.1610161284267020.0193336915853151-0.582603370340138
16106.26106.208418229860.2744541590910590.01877334418246570.822739281923393
17106.13106.1519633349330.1322563008142880.0193121816321711-1.03451463989318
18106.12106.1209361541710.06212497764874690.0194675510226062-0.511135457885316
19106.57106.5098323424190.2024848488722940.01929992431327231.02359417310278
20106.44106.4530657838420.09111153333833870.0193694853632611-0.812346035400039
21106.54106.5232466974190.0821189148544460.0193723871055168-0.0655943654371804
22107.1107.0277944311370.2636218366964430.01934228147614521.32394345266921
23108.1107.9928960232930.5650330739404430.01931663706189262.19860238118453
24108.4108.400395468510.4973429843254340.019319588531805-0.493756381673127
25108.84109.0145596143470.546622951315751-0.1889096296018560.393645454873374
26109.62109.598596461020.5618089977477490.01775162525654160.103005724369347
27110.42110.3752532700460.6540272805571820.017851564663810.673642701863089
28110.67110.6935582282240.5095826087892910.0183192319478328-1.04969404269016
29111.66111.5933666868260.6772667442444950.01790289839053631.22104152281305
30112.28112.2630415441350.6740054868698270.0179076310698452-0.0237757695965795
31112.87112.8615155739750.6415578948999440.0179330122335132-0.236647995490579
32112.18112.3110137573180.1294134307792240.0181425174185119-3.73561412849186
33112.36112.3528133664240.09176941443411120.0181504731993205-0.274586305285415
34112.16112.175509953511-0.02384452549524320.0181630331419322-0.843328331237461
35111.49111.547439850187-0.2834708804007880.0181775007011105-1.89380913622189
36111.25111.235397803403-0.2957476063763880.0181778512986996-0.0895509590826834
37111.36111.433201285786-0.086226373888755-0.1342169651096671.62498585041849
38111.74111.6881710244410.05433451304789580.01612803915960240.97392945897528
39111.1111.15732384563-0.1969112441027840.0159258200750152-1.834638742933
40111.33111.275111774956-0.06155665952911280.01559988304057330.98458133416731
41111.25111.232097947643-0.05358868588454550.01558517186662580.0580468408749427
42111.04111.041486937155-0.1124538838136940.0156486864920975-0.429209414913862
43110.97110.951540990476-0.102784088061870.01564306281967370.0705269254169159
44111.31111.2448455489010.06739400036173230.01559130524030211.24130311966288
45111.02111.03863009701-0.05016714227704380.015609777377275-0.8575273141104
46111.07111.047059169843-0.02498950755744010.01560774381040450.183654572447691
47111.36111.3085453945020.0981054107687040.01560264401698990.89789931886991
48111.54111.5113013512410.1430727762275570.01560168926681650.328008536002872
49112.05112.1180545337310.340523530686371-0.1255571396063251.50853262492872
50112.52112.5033086649860.3591121676860810.01182443919904380.130307665725181
51112.94112.9208464288690.3842011571544090.0118404745525760.183163962727882
52113.33113.3167121573560.3892171967539560.01183085965603120.0365078715921515
53113.78113.7612852235750.4130038344601830.01179590453001560.173331500971737
54113.77113.8043395076510.254065491851860.0119323906637665-1.15897875629395
55113.82113.8358667895490.1584557438899510.0119766431916989-0.697348796286899
56113.89113.8909483695180.1140403842663350.0119873938080219-0.323973999545938
57114.25114.2121045780020.2030324994683240.01197626537988140.649137096645285
58114.41114.3999268312390.1964969129287430.0119766854838765-0.0476729010209747
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/07/t1291748318k2kn01gb2lrhoes/14jzp1291748448.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/07/t1291748318k2kn01gb2lrhoes/14jzp1291748448.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/07/t1291748318k2kn01gb2lrhoes/2fsga1291748448.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/07/t1291748318k2kn01gb2lrhoes/2fsga1291748448.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/07/t1291748318k2kn01gb2lrhoes/3fsga1291748448.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/07/t1291748318k2kn01gb2lrhoes/3fsga1291748448.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/07/t1291748318k2kn01gb2lrhoes/4p1gd1291748448.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/07/t1291748318k2kn01gb2lrhoes/4p1gd1291748448.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/07/t1291748318k2kn01gb2lrhoes/5iafy1291748448.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/07/t1291748318k2kn01gb2lrhoes/5iafy1291748448.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
bitmap(file='test1.png')
plot(as.numeric(m$resid),main='Standardized Residuals',ylab='Residuals',xlab='time')
grid()
dev.off()
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='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